From a100716c990b336e468f822dad6ae6e9c96d785c Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Wed, 28 Oct 2020 14:50:02 -0500 Subject: [PATCH 1/4] Disable clock_getres on redox --- src/time.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/time.rs b/src/time.rs index 54989c2e28..e6c3f8ded5 100644 --- a/src/time.rs +++ b/src/time.rs @@ -37,6 +37,7 @@ impl ClockId { } /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] pub fn res(self) -> Result { clock_getres(self) } @@ -204,6 +205,7 @@ impl std::fmt::Display for ClockId { /// Get the resolution of the specified clock, (see /// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] pub fn clock_getres(clock_id: ClockId) -> Result { let mut c_time: MaybeUninit = MaybeUninit::uninit(); let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) }; From f8ae90b037545516550272089f6ae7922a6e1a23 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Tue, 10 Nov 2020 23:48:05 -0600 Subject: [PATCH 2/4] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56abe869c8..d1c1ed6249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) ### Fixed +- Fixed compilation on Redox + (#[1327](https://github.com/nix-rust/nix/pull/1327)) ### Changed ### Removed From 91962d2dcb70e9dc22e60869622719dd9e93cfa6 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Sun, 15 Nov 2020 10:51:16 -0600 Subject: [PATCH 3/4] Fix cross-compilation for redox --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fcef85e9c6..128dba3b48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ matrix: - curl --proto '=https' --tlsv1.2 -sSf --output rustup.sh https://sh.rustup.rs - sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0 --target x86_64-unknown-redox - . $HOME/.cargo/env - - cargo build --all-targets + - cargo build --target x86_64-unknown-redox --all-targets before_install: set -e From 21c1f41403c08740cec2e3194616a087db1c4fbf Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Wed, 2 Dec 2020 20:36:36 -0600 Subject: [PATCH 4/4] Use nightly for redox --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 128dba3b48..79606c5a1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,8 @@ matrix: name: redox script: - curl --proto '=https' --tlsv1.2 -sSf --output rustup.sh https://sh.rustup.rs - - sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0 --target x86_64-unknown-redox + # if stuff breaks, change nightly to the date in the toolchain_* directory at https://static.redox-os.org + - sh rustup.sh -y --profile=minimal --default-toolchain nightly-2020-08-04 --target x86_64-unknown-redox - . $HOME/.cargo/env - cargo build --target x86_64-unknown-redox --all-targets