Rust: Add recipe for 1.27.0 (#2771)

This change includes both the rust and rust_bin recipe. The remark
regarding the memory usage of the build on Haiku remains, that's
why the build is marked as untested. I have, however, tested the 
recipe up to the point where the main build starts so the odds are 
good that it might build.

Also remove the rust~dev recipe for the 1.22 version.
This commit is contained in:
Niels Sascha Reedijk
2018-07-05 16:53:56 +02:00
committed by fbrosson
parent 2a621b9c92
commit 8b189c34ca
5 changed files with 1139 additions and 128 deletions

View File

@@ -0,0 +1,765 @@
From a0db0ad4ef54e89d61d55bd350326e3b2baf9776 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Wed, 20 Sep 2017 17:36:59 +0000
Subject: [PATCH 1/9] Haiku: reduce stack memory to 16MB (max on Haiku)
---
src/librustdoc/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 059d416989..f628edbfab 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -102,7 +102,7 @@ struct Output {
}
pub fn main() {
- const STACK_SIZE: usize = 32_000_000; // 32MB
+ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku
rustc_driver::set_sigpipe_handler();
env_logger::init();
let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
--
2.16.4
From 02cd183d8c0679fa2cb9cc7da9fd259dae11c203 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Wed, 9 May 2018 17:31:41 +0000
Subject: [PATCH 2/9] Haiku: there is no setpriority on this platform.
---
src/bootstrap/lib.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index e53fef0678..ad71386ce6 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -177,7 +177,7 @@ mod toolstate;
#[cfg(windows)]
mod job;
-#[cfg(unix)]
+#[cfg(all(unix, not(target_os = "haiku")))]
mod job {
use libc;
@@ -188,7 +188,7 @@ mod job {
}
}
-#[cfg(not(any(unix, windows)))]
+#[cfg(any(target_os = "haiku", not(any(unix, windows))))]
mod job {
pub unsafe fn setup(_build: &mut ::Build) {
}
--
2.16.4
From 9bb7ba3ff02e7d081f51e828daad071cb7ea9b2b Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Thu, 7 Jun 2018 21:13:17 +0200
Subject: [PATCH 3/9] Haiku: Revert "std: Handle OS errors when joining
threads"
This reverts commit dc7c7ba0c9f401f5597a245e05ee9e8d760715d3.
There is an issue with threading in cargo, where thread::join fails after completing a build. This prevents building Rust on Haiku (as the build system kills itself after failure).
The problem is documented at rust-on-haiku.com issue #10
---
src/libstd/sys/unix/thread.rs | 3 +--
src/libstd/sys/windows/c.rs | 1 -
src/libstd/sys/windows/thread.rs | 6 +-----
src/libstd/thread/mod.rs | 5 -----
4 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
index 9e38880803..5f2bbf7dc1 100644
--- a/src/libstd/sys/unix/thread.rs
+++ b/src/libstd/sys/unix/thread.rs
@@ -175,8 +175,7 @@ impl Thread {
unsafe {
let ret = libc::pthread_join(self.id, ptr::null_mut());
mem::forget(self);
- assert!(ret == 0,
- "failed to join thread: {}", io::Error::from_raw_os_error(ret));
+ debug_assert_eq!(ret, 0);
}
}
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
index 6d929f2136..8a6cba2968 100644
--- a/src/libstd/sys/windows/c.rs
+++ b/src/libstd/sys/windows/c.rs
@@ -269,7 +269,6 @@ pub const FILE_END: DWORD = 2;
pub const WAIT_OBJECT_0: DWORD = 0x00000000;
pub const WAIT_TIMEOUT: DWORD = 258;
-pub const WAIT_FAILED: DWORD = 0xFFFFFFFF;
#[cfg(target_env = "msvc")]
#[cfg(feature = "backtrace")]
diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs
index b6f63303dc..2826975f60 100644
--- a/src/libstd/sys/windows/thread.rs
+++ b/src/libstd/sys/windows/thread.rs
@@ -66,11 +66,7 @@ impl Thread {
}
pub fn join(self) {
- let rc = unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE) };
- if rc == c::WAIT_FAILED {
- panic!("failed to join on thread: {}",
- io::Error::last_os_error());
- }
+ unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE); }
}
pub fn yield_now() {
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 1b976b79b4..63c487d0e4 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -1303,11 +1303,6 @@ impl<T> JoinHandle<T> {
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
/// [`panic`]: ../../std/macro.panic.html
///
- /// # Panics
- ///
- /// This function may panic on some platforms if a thread attempts to join
- /// itself or otherwise may create a deadlock with joining threads.
- ///
/// # Examples
///
/// ```
--
2.16.4
From 710ece3e310bc486a4f87b4fc6e7ed8b560c0252 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Sat, 9 Jun 2018 14:08:45 +0000
Subject: [PATCH 4/9] Haiku: make it explicit that Haiku uses position
independent executables on x86_64
With the switch to gcc 7 the linker scripts don't always explicitly
add the `-pie` flag anymore. This creates build failures on x86_64.
Interestingly enough, adding this flag on i686 will lead to executables
that fail to run when ASLR is enabled, so let's keep it x86_64 only.
---
src/librustc_target/spec/x86_64_unknown_haiku.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/librustc_target/spec/x86_64_unknown_haiku.rs b/src/librustc_target/spec/x86_64_unknown_haiku.rs
index 1e78461861..c910fd8d40 100644
--- a/src/librustc_target/spec/x86_64_unknown_haiku.rs
+++ b/src/librustc_target/spec/x86_64_unknown_haiku.rs
@@ -16,6 +16,8 @@ pub fn target() -> TargetResult {
base.max_atomic_width = Some(64);
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.stack_probes = true;
+ // This option is required to build executables on Haiku x86_64
+ base.position_independent_executables = true;
Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
--
2.16.4
From d743f18f4b29f28f937bc2a168b4b282306e5e4b Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Fri, 22 Jun 2018 19:10:04 +0000
Subject: [PATCH 5/9] Haiku: move to libc 0.2.41, which contains proper
definitions for RTLD_LAZY and RTLD_GLOBAL
---
src/Cargo.lock | 88 +++++++++++++++++++++++++++++-----------------------------
src/liblibc | 2 +-
2 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/Cargo.lock b/src/Cargo.lock
index ea2d146ff6..a1caa4439d 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -95,7 +95,7 @@ name = "atty"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -107,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -118,7 +118,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -150,7 +150,7 @@ dependencies = [
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"petgraph 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -219,7 +219,7 @@ dependencies = [
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -392,7 +392,7 @@ name = "commoncrypto-sys"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -412,7 +412,7 @@ dependencies = [
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -431,7 +431,7 @@ dependencies = [
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -458,7 +458,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -466,7 +466,7 @@ name = "core-foundation-sys"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -535,7 +535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"curl-sys 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -549,7 +549,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -708,7 +708,7 @@ version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -718,7 +718,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -740,7 +740,7 @@ name = "flate2"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -771,7 +771,7 @@ name = "fs2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -814,7 +814,7 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -986,7 +986,7 @@ name = "jobserver"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1056,7 +1056,7 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.40"
+version = "0.2.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -1067,7 +1067,7 @@ dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"curl-sys 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1080,7 +1080,7 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1092,7 +1092,7 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1132,7 +1132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1199,7 +1199,7 @@ name = "memchr"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1213,7 +1213,7 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1278,7 +1278,7 @@ name = "num_cpus"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1294,7 +1294,7 @@ dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1309,7 +1309,7 @@ version = "0.9.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1361,7 +1361,7 @@ name = "parking_lot_core"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1553,7 +1553,7 @@ version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1563,7 +1563,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1583,7 +1583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2009,7 +2009,7 @@ dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"build_helper 0.1.0",
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_cratesio_shim 0.0.0",
]
@@ -2174,7 +2174,7 @@ dependencies = [
"env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
@@ -2282,7 +2282,7 @@ dependencies = [
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-ap-rustc_target 121.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2444,7 +2444,7 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2622,7 +2622,7 @@ name = "syntex_errors"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2644,7 +2644,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2659,7 +2659,7 @@ version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"filetime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"xattr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2678,7 +2678,7 @@ name = "tempfile"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2730,7 +2730,7 @@ name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2774,7 +2774,7 @@ name = "time"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3001,7 +3001,7 @@ name = "xattr"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -3106,7 +3106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
-"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b"
+"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206"
"checksum libgit2-sys 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1ecbd6428006c321c29b6c8a895f0d90152f1cf4fd8faab69fc436a3d9594f63"
"checksum libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0db4ec23611747ef772db1c4d650f8bd762f07b461727ec998f953c614024b75"
"checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16"
--
2.16.4
From d20be1ca798d39a01e82e9373dfa79c4da946e26 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Fri, 22 Jun 2018 19:18:59 +0000
Subject: [PATCH 7/9] Haiku: use a fixed version of backtrace for Haiku
---
src/Cargo.lock | 16 ++++++++--------
src/Cargo.toml | 1 +
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/Cargo.lock b/src/Cargo.lock
index a1caa4439d..bef3e0702a 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -103,9 +103,9 @@ dependencies = [
[[package]]
name = "backtrace"
version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+source = "git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6#663beca1e8a476209b478fc28c776d2e633c001e"
dependencies = [
- "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace-sys 0.1.16 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -115,7 +115,7 @@ dependencies = [
[[package]]
name = "backtrace-sys"
version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+source = "git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6#663beca1e8a476209b478fc28c776d2e633c001e"
dependencies = [
"cc 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -669,7 +669,7 @@ name = "error-chain"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.6 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)",
]
[[package]]
@@ -684,7 +684,7 @@ name = "failure"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.6 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)",
"failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1741,7 +1741,7 @@ name = "rustc"
version = "0.0.0"
dependencies = [
"arena 0.0.0",
- "backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "backtrace 0.3.6 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)",
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3025,8 +3025,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
"checksum assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72342c21057a3cb5f7c2d849bf7999a83795434dd36d74fa8c24680581bd1930"
"checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4"
-"checksum backtrace 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe525f66f42d207968308ee86bc2dd60aa5fab535b22e616323a173d097d8e"
-"checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661"
+"checksum backtrace 0.3.6 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)" = "<none>"
+"checksum backtrace-sys 0.1.16 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.6)" = "<none>"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
diff --git a/src/Cargo.toml b/src/Cargo.toml
index 35858ee286..e3fdaf106d 100644
--- a/src/Cargo.toml
+++ b/src/Cargo.toml
@@ -65,3 +65,4 @@ cargo = { path = "tools/cargo" }
# for crates.io
rustfmt-nightly = { path = "tools/rustfmt" }
clippy_lints = { path = "tools/clippy/clippy_lints" }
+backtrace = { git = "https://github.com/nielx/backtrace-rs", branch = "haiku-0.3.6" }
--
2.16.4
From ccb8daca4d4dbdc0f575e42d4bb13ee5f6f99527 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Fri, 22 Jun 2018 20:11:40 +0000
Subject: [PATCH 8/9] Haiku: hotfix for socket2 for missing constants in libc
---
src/Cargo.lock | 8 ++++----
src/Cargo.toml | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/Cargo.lock b/src/Cargo.lock
index bef3e0702a..25713ea807 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -539,7 +539,7 @@ dependencies = [
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "socket2 0.3.5 (git+https://github.com/nielx/socket2-rs?branch=haiku-0.3.5)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1221,7 +1221,7 @@ name = "miow"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "socket2 0.3.5 (git+https://github.com/nielx/socket2-rs?branch=haiku-0.3.5)",
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2441,7 +2441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "socket2"
version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+source = "git+https://github.com/nielx/socket2-rs?branch=haiku-0.3.5#78a6592b5732bfdfefc2fd6a04846083b1671636"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3201,7 +3201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
"checksum skeptic 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c8431f8fca168e2db4be547bd8329eac70d095dff1444fee4b0fa0fabc7df75a"
"checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9"
-"checksum socket2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff606e0486e88f5fc6cfeb3966e434fb409abbc7a3ab495238f70a1ca97f789d"
+"checksum socket2 0.3.5 (git+https://github.com/nielx/socket2-rs?branch=haiku-0.3.5)" = "<none>"
"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b"
"checksum string_cache 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39cb4173bcbd1319da31faa5468a7e3870683d7a237150b0b0aaafd546f6ad12"
"checksum string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479cde50c3539481f33906a387f2bd17c8e87cb848c35b6021d41fb81ff9b4d7"
diff --git a/src/Cargo.toml b/src/Cargo.toml
index e3fdaf106d..a1e6b280db 100644
--- a/src/Cargo.toml
+++ b/src/Cargo.toml
@@ -66,3 +66,4 @@ cargo = { path = "tools/cargo" }
rustfmt-nightly = { path = "tools/rustfmt" }
clippy_lints = { path = "tools/clippy/clippy_lints" }
backtrace = { git = "https://github.com/nielx/backtrace-rs", branch = "haiku-0.3.6" }
+socket2 = { git = "https://github.com/nielx/socket2-rs", branch = "haiku-0.3.5" }
--
2.16.4
From edd2d028bb1d8624cff2739397027ac8d9eb2e42 Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Mon, 2 Jul 2018 21:12:34 +0200
Subject: [PATCH 9/9] The stack size is also okay if the current limit matches
the maximum
NOTE: this is actually an incorrect patch, but it works on Haiku because
it gets the proper response. This patch will be improved in the mainline.
---
src/librustc_driver/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index a1052ca6c3..2edee1d011 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1489,7 +1489,7 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
let err = io::Error::last_os_error();
error!("in_rustc_thread: error calling getrlimit: {}", err);
true
- } else if rlim.rlim_max < STACK_SIZE as libc::rlim_t {
+ } else if rlim.rlim_max <= STACK_SIZE as libc::rlim_t {
true
} else {
std::rt::deinit_stack_guard();
--
2.16.4

View File

@@ -0,0 +1,26 @@
From 10966a274002632f19d0673a60c42c6e2d6d33be Mon Sep 17 00:00:00 2001
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Date: Sun, 17 Jun 2018 07:37:46 +0200
Subject: [PATCH] Haiku doesn't expose whether a FS is local or remote
---
lib/Support/Unix/Path.inc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index 2ecb97316c8..4fe5bda223c 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -380,6 +380,9 @@ static bool is_local_impl(struct STATVFS &Vfs) {
#elif defined(__CYGWIN__)
// Cygwin doesn't expose this information; would need to use Win32 API.
return false;
+#elif defined(__HAIKU__)
+ // Haiku doesn't expose this information
+ return false;
#elif defined(__sun)
// statvfs::f_basetype contains a null-terminated FSType name of the mounted target
StringRef fstype(Vfs.f_basetype);
--
2.16.4

View File

@@ -1,128 +0,0 @@
SUMMARY="Modern and safe systems programming language"
DESCRIPTION="Rust is a systems programming language that runs blazingly fast, prevents almost all crashes*, and eliminates data races."
HOMEPAGE="http://www.rust-lang.org/"
LICENSE="MIT"
COPYRIGHT="2015, The Rust Project Developers"
REVISION="1"
ARCHITECTURES="!x86_gcc2 !x86 x86_64"
SECONDARY_ARCHITECTURES="!x86"
SOURCE_URI="https://github.com/jessicah/rust/releases/download/1.22-dev-haiku/rustc-1.22.0-dev-x86_64-unknown-haiku.tar.xz"
SOURCE_URI_2="https://github.com/jessicah/rust/releases/download/1.22-dev-haiku/rust-std-1.22.0-dev-x86_64-unknown-haiku.tar.xz"
SOURCE_URI_3="https://github.com/jessicah/rust/releases/download/1.22-dev-haiku/cargo-0.23.0-dev-x86_64-unknown-haiku.tar.xz"
SOURCE_URI_4="https://github.com/jessicah/rust/releases/download/1.22-dev-haiku/rust-docs-1.22.0-dev-x86_64-unknown-haiku.tar.xz"
CHECKSUM_SHA256="6ba49f6616049886ac84be0a061f7a6847bff377403f335a1ff9204e72f3f174"
CHECKSUM_SHA256_2="a313c1b519647acabb9eb4b046d733f7936e6a9a0fe9adde96daf5e2d29acd42"
CHECKSUM_SHA256_3="a4a14b5316f3132fdbaee011cb76f54936492a08342fc9e37f1eba9e6eb66342"
CHECKSUM_SHA256_4="1973286081c9f5614ba254c719fec9f84ccb7c487fdf633c40c5c7a7437d2647"
SOURCE_DIR="rustc-1.22.0-dev-x86_64-unknown-haiku"
PROVIDES="
rust$secondaryArchSuffix = $portVersion compat >= 1.21
cargo$secondaryArchSuffix = $portVersion compat >= 1.21
cmd:rustc = $portVersion
cmd:rustdoc = $portVersion
cmd:rust_gdb = $portVersion
cmd:rust_lldb = $portVersion
cmd:cargo = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
rust_runtime$secondaryArchSuffix == $portVersion base
lib:libcrypto
lib:libcurl
lib:libgit2
lib:libllvm_4.0
lib:libssh2
lib:libssl
"
PROVIDES_runtime="
rust_runtime$secondaryArchSuffix = $portVersion
"
REQUIRES_runtime="
haiku$secondaryArchSuffix
lib:libllvm_4.0
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:grep
cmd:sed
cmd:tar
xz_utils$secondaryArchSuffix
"
GLOBAL_WRITABLE_FILES="settings/bash_completion.d/cargo auto-merge"
INSTALL()
{
cd $sourceDir
./install.sh --prefix=$prefix --sysconfdir=$sysconfDir --bindir=$binDir \
--libdir=$libDir --mandir=$manDir --docdir=$developDocDir
cd $sourceDir2/rust-std-1.22.0-dev-x86_64-unknown-haiku
./install.sh --prefix=$prefix --sysconfdir=$sysconfDir --bindir=$binDir \
--libdir=$libDir --mandir=$manDir --docdir=$developDocDir
cd $sourceDir3/cargo-0.23.0-dev-x86_64-unknown-haiku
./install.sh --prefix=$prefix --sysconfdir=$sysconfDir --bindir=$binDir \
--libdir=$libDir --mandir=$manDir --docdir=$developDocDir
cd $sourceDir4/rust-docs-1.22.0-dev-x86_64-unknown-haiku
./install.sh --prefix=$prefix --sysconfdir=$sysconfDir --bindir=$binDir \
--libdir=$libDir --mandir=$manDir --docdir=$developDocDir
# move the `rustlib` folder to the developLibDirs (as it is a framework of sorts)
# do create a link in $prefix/lib as that is where rustc expects things to live
mkdir -p $developLibDir
mv $libDir/rustlib $developLibDir
cd $libDir
ln -s ../$relativeDevelopLibDir/rustlib rustlib
# remove cruft left in share
rm -rf $prefix/share
# clean out unneccesary files created by the rust installer
rm $developLibDir/rustlib/components
rm $developLibDir/rustlib/install.log
rm $developLibDir/rustlib/manifest-*
rm $developLibDir/rustlib/rust-installer-version
rm $developLibDir/rustlib/uninstall.sh
# set up the runtime package
packageEntries runtime \
$libDir/libarena-*.so \
$libDir/libfmt_macros-*.so \
$libDir/libgraphviz-*.so \
$libDir/libproc_macro-*.so \
$libDir/librustc_allocator-*.so \
$libDir/librustc_back-*.so \
$libDir/librustc_borrowck-*.so \
$libDir/librustc_const_eval-*.so \
$libDir/librustc_const_math-*.so \
$libDir/librustc_data_structures-*.so \
$libDir/librustc_driver-*.so \
$libDir/librustc_errors-*.so \
$libDir/librustc_incremental-*.so \
$libDir/librustc_lint-*.so \
$libDir/librustc_llvm-*.so \
$libDir/librustc_metadata-*.so \
$libDir/librustc_mir-*.so \
$libDir/librustc_passes-*.so \
$libDir/librustc_platform_intrinsics-*.so \
$libDir/librustc_plugin-*.so \
$libDir/librustc_privacy-*.so \
$libDir/librustc_resolve-*.so \
$libDir/librustc_save_analysis-*.so \
$libDir/librustc_trans_utils-*.so \
$libDir/librustc_trans-*.so \
$libDir/librustc_typeck-*.so \
$libDir/librustc-*.so \
$libDir/libserialize-*.so \
$libDir/libstd-*.so \
$libDir/libsyntax_ext-*.so \
$libDir/libsyntax_pos-*.so \
$libDir/libsyntax-*.so \
$libDir/libterm-*.so \
$libDir/libtest-*.so
}

View File

@@ -0,0 +1,250 @@
SUMMARY="Modern and safe systems programming language"
DESCRIPTION="Rust is a systems programming language that runs blazingly fast, \
prevents almost all crashes*, and eliminates data races."
HOMEPAGE="https://www.rust-lang.org/"
COPYRIGHT="2018 The Rust Project Developers"
LICENSE="MIT"
REVISION="1"
cargoVersion="0.28.0"
rlsVersion="0.127.0"
rustfmtVersion="0.6.1"
srcGitRev2="7243155b1c3da0a980c868a87adebf00e0b33989"
srcGitRev3="118e078c5badd520d18b92813fd88789c8d341ab"
srcGitRev4="c5fb6dbe8154732b2af8367c75a9b079b2951154"
srcGitRev5="748a5e6742db4a21c4c630a58087f818828e8a0a"
srcGitRev7="134f419ee62714590b04712fe6072253bc2a7822"
srcGitRev8="f51127530d46b9acbf4747c859da185e771cfcf3"
srcGitRev9="d2ade31a52a417257742de72c5936a8a342a34b5"
srcGitRev10="2a2f6d96c8dc578d2474742f14c9bab0b36b0408"
srcGitRev11="dfd960b5f1a1751b22738fa34fd27b583f4618db"
srcGitRev12="49279d715bc9bc979313e7c1056ada821ddc3ee2"
srcGitRev13="f48fed70d4447445b586a35c4ae88683542ffc72"
srcGitRev14="eebda16e4b45f2eed4310cf7b9872cc752278163"
srcGitRev15="a19ca1cd91cf97777af8268a6136bd2e4648e189"
srcGitRev16="1742229ebb7843a65c05ee495d8de5366fcc5567"
SOURCE_URI="https://github.com/rust-lang/rust/archive/$portVersion.tar.gz"
SOURCE_URI_2="https://github.com/rust-lang/llvm/archive/$srcGitRev2.tar.gz"
SOURCE_URI_3="https://github.com/rust-lang/rust-installer/archive/$srcGitRev3.tar.gz"
SOURCE_URI_4="https://github.com/rust-lang/libc/archive/$srcGitRev4.tar.gz"
SOURCE_URI_5="https://github.com/rust-lang-nursery/nomicon/archive/$srcGitRev5.tar.gz"
SOURCE_URI_6="https://github.com/rust-lang/cargo/archive/$cargoVersion.tar.gz"
SOURCE_URI_7="https://github.com/rust-lang-nursery/reference/archive/$srcGitRev7.tar.gz"
SOURCE_URI_8="https://github.com/rust-lang/book/archive/$srcGitRev8.tar.gz"
SOURCE_URI_9="https://github.com/rust-lang-nursery/rls/archive/$srcGitRev9.tar.gz"
SOURCE_URI_10="https://github.com/rust-lang-nursery/compiler-builtins/archive/$srcGitRev10.tar.gz"
SOURCE_URI_11="https://github.com/rust-lang/compiler-rt/archive/$srcGitRev11.tar.gz"
SOURCE_URI_12="https://github.com/rust-lang-nursery/rustfmt/archive/$srcGitRev12.tar.gz"
SOURCE_URI_13="https://github.com/solson/miri/archive/$srcGitRev13.tar.gz"
SOURCE_URI_14="https://github.com/rust-lang/rust-by-example/archive/$srcGitRev14.tar.gz"
SOURCE_URI_15="https://github.com/rust-lang-nursery/stdsimd/archive/$srcGitRev15.tar.gz"
SOURCE_URI_16="https://github.com/rust-lang-nursery/rust-clippy/archive/$srcGitRev16.tar.gz"
SOURCE_FILENAME="rust-$portVersion.tar.gz"
SOURCE_FILENAME_2="rust-$portVersion-llvm-$srcGitRev2.tar.gz"
SOURCE_FILENAME_3="rust-$portVersion-rust-installer-$srcGitRev3.tar.gz"
SOURCE_FILENAME_4="rust-$portVersion-libc-$srcGitRev4.tar.gz"
SOURCE_FILENAME_5="rust-$portVersion-nomicon-$srcGitRev5.tar.gz"
SOURCE_FILENAME_6="rust-$portVersion-cargo-$cargoVersion.tar.gz"
SOURCE_FILENAME_7="rust-$portVersion-reference-$srcGitRev7.tar.gz"
SOURCE_FILENAME_8="rust-$portVersion-book-$srcGitRev8.tar.gz"
SOURCE_FILENAME_9="rust-$portVersion-rls-$rlsVersion.tar.gz"
SOURCE_FILENAME_10="rust-$portVersion-compiler-builtins-$srcGitRev10.tar.gz"
SOURCE_FILENAME_11="rust-$portVersion-compiler-rt-$srcGitRev11.tar.gz"
SOURCE_FILENAME_12="rust-$portVersion-rustfmt-$rustfmtVersion.tar.gz"
SOURCE_FILENAME_13="rust-$portVersion-miri-$srcGitRev13.tar.gz"
SOURCE_FILENAME_14="rust-$portVersion-rust-by-example-$srcGitRev14.tar.gz"
SOURCE_FILENAME_15="rust-$portVersion-stdsimd-$srcGitRev15.tar.gz"
SOURCE_FILENAME_16="rust-$portVersion-clippy-$srcGitRev16.tar.gz"
CHECKSUM_SHA256="0bbca54761be5302efc6e6fdb5f4dab4e0dec24458ca7c13538b7259885f9457"
CHECKSUM_SHA256_2="ba1578c156e8f10a9330f8d2b8514987c74a2babaea845ac4c4a1d2d5ef379ec"
CHECKSUM_SHA256_3="34fd6dd8f8e5943be3ab022cd7d0ca792ea2cfe6fb21e06d6054134fc6441892"
CHECKSUM_SHA256_4="aa083022606be28922dfd94606dc27da11f9f397ed732d93fd70fd6a8fa82594"
CHECKSUM_SHA256_5="abf8866307d51259e55fef461e7954d05cf3169001069dc9ed4ab5eb40a73abd"
CHECKSUM_SHA256_6="62f4269af6cd168c91a6b10ef845e6dc0f1c211605bd13d155a6a001ade026a1"
CHECKSUM_SHA256_7="9e54405f4a6c487cba04d2e25e7026b86581038a88741ce5757b38ddfab4cb07"
CHECKSUM_SHA256_8="a18b090a3a29313a9e68dbef0ca4a5e0ecb36d9eb0f244a1e6cbd33989546989"
CHECKSUM_SHA256_9="5ca89b25cf636b018cb1e9862cf2272e1295874c712db23178e36a3b2dded892"
CHECKSUM_SHA256_10="cebece5392d3990a4ed06af378f1e44daea0c30d1d348d1cefb7dae9a4f56bbb"
CHECKSUM_SHA256_11="7384b3592a4b05857fbf4e54ff5f0ac17bb8bd982b428f348ae2cc4afd9a552c"
CHECKSUM_SHA256_12="9708789d175ce1dd43e1623c1373629d26d583022e9e826d768d9270c4304f36"
CHECKSUM_SHA256_13="7ab3a7345cc98e96a223b92653374fe1cae2c81f90afb745e933f02eacbf7390"
CHECKSUM_SHA256_14="be12b7ba065470a046f7e2ba3f76abd3fd6028b24393eba292d024de8164b630"
CHECKSUM_SHA256_15="ddfb9831e8cb439545ce8180a958e57877a0cd9fc3f54305b38679f2b0dd2f68"
CHECKSUM_SHA256_16="e5b04a1dfeab2d89fc5ee4509711c381bcdca53586b73a999102e14ac8748c23"
PATCHES="rust-$portVersion.patchset"
PATCHES_2="rust-llvm-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
rust$secondaryArchSuffix = $portVersion
cmd:rustc = $portVersion
cmd:rustdoc = $portVersion
cmd:rust_gdb = $portVersion
cmd:rust_lldb = $portVersion
cmd:cargo$secondaryArchSuffix = $cargoVersion
cmd:cargo_fmt = $cargoVersion
cmd:rls = $rlsVersion
cmd:rustfmt = $rustfmtVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcurl$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix == $cargoVersion
cmd:cmake
cmd:cmp
cmd:file
cmd:find
cmd:git
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:python
cmd:rustc == $portVersion
cmd:sed
cmd:tar
cmd:which
cmd:xargs
"
BUILD()
{
# Set up the source tree with all the proper submodules
rm -rf src/llvm src/tools/rust-installer src/liblibc src/doc/nomicon \
src/tools/cargo src/doc/reference src/doc/book src/tools/rls \
src/libcompiler_builtins src/tools/rustfmt src/tools/miri \
src/doc/rust-by-example src/stdsimd src/tools/clippy
ln -s $sourceDir2/llvm-$srcGitRev2 src/llvm
ln -s $sourceDir3/rust-installer-$srcGitRev3 src/tools/rust-installer
ln -s $sourceDir4/libc-$srcGitRev4 src/liblibc
ln -s $sourceDir5/nomicon-$srcGitRev5 src/doc/nomicon
ln -s $sourceDir6/cargo-$cargoVersion src/tools/cargo
ln -s $sourceDir7/reference-$srcGitRev7 src/doc/reference
ln -s $sourceDir8/book-$srcGitRev8 src/doc/book
ln -s $sourceDir9/rls-$srcGitRev9 src/tools/rls
ln -s $sourceDir10/compiler-builtins-$srcGitRev10 src/libcompiler_builtins
rm -rf src/libcompiler_builtins/compiler-rt
ln -s $sourceDir11/compiler-rt-$srcGitRev11 src/libcompiler_builtins/compiler-rt
ln -s $sourceDir12/rustfmt-$srcGitRev12 src/tools/rustfmt
ln -s $sourceDir13/miri-$srcGitRev13 src/tools/miri
ln -s $sourceDir14/rust-by-example-$srcGitRev14 src/doc/rust-by-example
ln -s $sourceDir15/stdsimd-$srcGitRev15 src/stdsimd
ln -s $sourceDir16/rust-clippy-$srcGitRev16 src/tools/clippy
# write the build configuration
tr -d '\t' >config.toml <<- EOL
[llvm]
targets = "X86"
experimental-targets = ""
[build]
cargo = "/$relativeBinDir/cargo"
rustc = "/boot/system/bin/rustc"
submodules = false
extended = true
tools = ["cargo", "rls", "rustfmt", "analysis"]
[install]
prefix = "$prefix"
libdir = "$relativeLibDir"
mandir = "$relativeManDir"
docdir = "$relativeDevelopDocDir"
sysconfdir = "$relativeDataDir"
[rust]
channel = "stable"
use-jemalloc = false
rpath = false
deny-warnings = false
dist-src = false
[dist]
src-tarball = false
EOL
# Disable ASLR: compiling stage 1 rustc requires a lot of RAM (about 1.5
# GB). Haiku has a per-process limit of 2GB on 32 bit systems. ASLR makes
# the available space even smaller. Disabling it will give us the space to
# compile Rust
export DISABLE_ASLR=1
# now build rust and cargo
./x.py dist
}
INSTALL()
{
# we will manually invoke the install scripts
if [ $effectiveTargetArchitecture = x86 ]; then
architecture="i686-unknown-haiku"
fi
if [ $effectiveTargetArchitecture = x86_64 ]; then
architecture="x86_64-unknown-haiku"
fi
# let's install the packages one by one
cd $sourceDir/build/tmp/dist/
for module in "rust-docs-$srcGitRev-$architecture" \
"rust-std-$srcGitRev-$architecture" \
"rustc-$srcGitRev-$architecture" \
"rust-analysis-$srcGitRev-$architecture" \
"cargo-$cargoVersion-$architecture" \
"rls-$rlsVersion-$architecture" \
"rustfmt-$rustfmtVersion-$architecture"
do
./$module/install.sh \
--prefix=$prefix \
--docdir=$developDocDir \
--libdir=$libDir \
--mandir=$manDir \
--sysconfdir=$dataDir \
--disable-ldconfig
done
# move the cargo and binaries (in case of a secondary arch)
if [ -n "$secondaryArchSuffix" ]; then
mkdir -p $binDir
mv $prefix/bin/cargo $binDir/cargo
fi
# remove zsh data, it is not used on Haiku anyway
rm -rf $prefix/share
# move the `rustlib` folder to the developLibDirs (as it is a framework of sorts)
# do create a link in $prefix/lib as that is where rustc expects things to live
# Note; this actually seems to be a bug in the Rust build system. The path
# to rustlib is hardcoded in the rustc binary, but it does allow it to be
# set to libdir_relative (see config.rs in the bootstrap tool). This variable
# is only set when the configure script is used to generate the config, not
# with config.toml
mkdir -p $developLibDir
mv $libDir/rustlib $developLibDir
ln -r -s $developLibDir/rustlib $prefix/lib/rustlib
# clean out unneccesary files created by the rust installer
rm $developLibDir/rustlib/components
rm $developLibDir/rustlib/install.log
rm $developLibDir/rustlib/manifest-*
rm $developLibDir/rustlib/rust-installer-version
rm $developLibDir/rustlib/uninstall.sh
}
TEST()
{
./x.py test
}

View File

@@ -0,0 +1,98 @@
SUMMARY="Modern and safe systems programming language"
DESCRIPTION="Rust is a systems programming language that runs blazingly fast, \
prevents almost all crashes*, and eliminates data races."
HOMEPAGE="https://www.rust-lang.org/"
COPYRIGHT="2018 The Rust Project Developers"
LICENSE="MIT"
REVISION="1"
case "$effectiveTargetArchitecture" in
x86)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-i686-unknown-haiku.tar.xz"
CHECKSUM_SHA256="8b754ce40663987bb9152039d24c472be069bf7f5b7452ed5e89b4677d82ef73"
SOURCE_DIR="rust-$portVersion-i686-unknown-haiku"
;;
x86_64)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-x86_64-unknown-haiku.tar.xz"
CHECKSUM_SHA256="1e360ab4d7a64dc7cf26a8dbb6431de720107395a762915b9011982de9f8d937"
SOURCE_DIR="rust-$portVersion-x86_64-unknown-haiku"
;;
*)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rustc-$portVersion-src.tar.xz"
CHECKSUM_SHA256="ebbac0c1ddb1f9c0fbeaf7b225bdad8048acc33d84e97a80f597e1a420bcc586"
SOURCE_DIR="rustc-$portVersion-src"
;;
esac
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
DISABLE_SOURCE_PACKAGE=yes
cargoVersion="0.28.0"
rlsVersion="0.127.0"
rustfmtVersion="0.6.1"
PROVIDES="
rust_bin$secondaryArchSuffix = $portVersion
cmd:rustc = $portVersion
cmd:rustdoc = $portVersion
cmd:rust_gdb = $portVersion
cmd:rust_lldb = $portVersion
cmd:cargo$secondaryArchSuffix = $cargoVersion
cmd:cargo_fmt = $cargoVersion
cmd:rls = $rlsVersion
cmd:rustfmt = $rustfmtVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libssh2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
CONFLICTS="
rust$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
INSTALL()
{
./install.sh \
--prefix=$prefix \
--docdir=$developDocDir \
--libdir=$libDir \
--mandir=$manDir \
--sysconfdir=$dataDir \
--disable-ldconfig
# move the cargo and binaries (in case of a secondary arch)
if [ -n "$secondaryArchSuffix" ]; then
mkdir -p $binDir
mv $prefix/bin/cargo $binDir/cargo
fi
# remove zsh data, it is not used on Haiku anyway
rm -rf $prefix/share
# move the `rustlib` folder to the developLibDirs (as it is a framework of sorts)
# do create a link in $prefix/lib as that is where rustc expects things to live
# Note; this actually seems to be a bug in the Rust build system. The path
# to rustlib is hardcoded in the rustc binary, but it does allow it to be
# set to libdir_relative (see config.rs in the bootstrap tool). This variable
# is only set when the configure script is used to generate the config, not
# with config.toml
mkdir -p $developLibDir
mv $libDir/rustlib $developLibDir
ln -r -s $developLibDir/rustlib $prefix/lib/rustlib
# clean out unneccesary files created by the rust installer
rm $developLibDir/rustlib/components
rm $developLibDir/rustlib/install.log
rm $developLibDir/rustlib/manifest-*
rm $developLibDir/rustlib/rust-installer-version
rm $developLibDir/rustlib/uninstall.sh
}