Skip to content

Commit

Permalink
Merge #1285
Browse files Browse the repository at this point in the history
1285: Add fuchsia support r=asomers a=amanda-tait

This change adds support for the Fuchsia operating system to the nix
crate. Fuchsia developers have a use case for nix, particularly its safe
interfaces to the recvmsg(2) and sendmsg(2). Adding support requires:
* incrementing the libc dependency to 0.2.74
* conditionally not compiling nix functionality which depends on libc functionality
  that does not exist for Fuchsia

Co-authored-by: Tamir Duberstein <[email protected]>
Co-authored-by: Amanda Tait <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2020
2 parents 062bec3 + 3879ea6 commit 769d664
Show file tree
Hide file tree
Showing 17 changed files with 259 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:
# Install Rust
setup_script:
- fetch https://sh.rustup.rs -o rustup.sh
- sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0
- sh rustup.sh -y --profile=minimal --default-toolchain 1.40.0
- $HOME/.cargo/bin/rustup target add i686-unknown-freebsd
amd64_test_script:
- . $HOME/.cargo/env
Expand Down
65 changes: 40 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,69 +18,69 @@ matrix:
# week. Additionally they're moved to the front of the line to get them in
# the Travis OS X build queue first.
- env: TARGET="aarch64-apple-ios;armv7-apple-ios;armv7s-apple-ios;i386-apple-ios;x86_64-apple-ios" DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
os: osx

# Mac builds
# These are also moved to be first because they wait in a long queue with
# Travis
- env: TARGET=i686-apple-darwin
rust: 1.36.0
rust: 1.40.0
os: osx
- env: TARGET=x86_64-apple-darwin
rust: 1.36.0
rust: 1.40.0
os: osx

# Android
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=arm-linux-androideabi DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=i686-linux-android DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0

# Linux
- env: TARGET=aarch64-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=arm-unknown-linux-gnueabi
rust: 1.36.0
rust: 1.40.0
- env: TARGET=arm-unknown-linux-musleabi DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=armv7-unknown-linux-gnueabihf
rust: 1.36.0
rust: 1.40.0
- env: TARGET=i686-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=i686-unknown-linux-musl
rust: 1.36.0
rust: 1.40.0
- env: TARGET=mips-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=mips64-unknown-linux-gnuabi64
rust: 1.36.0
rust: 1.40.0
- env: TARGET=mips64el-unknown-linux-gnuabi64
rust: 1.36.0
rust: 1.40.0
- env: TARGET=mipsel-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=powerpc-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=powerpc64le-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0
- env: TARGET=x86_64-unknown-linux-gnu
rust: 1.36.0
rust: 1.40.0
- env: TARGET=x86_64-unknown-linux-musl
rust: 1.36.0
rust: 1.40.0

# *BSD
# FreeBSD i686 and x86_64 use Cirrus instead of Travis
# - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
rust: 1.36.0
rust: 1.40.0

# Make sure stable is always working too
- env: TARGET=x86_64-unknown-linux-gnu
Expand All @@ -102,10 +102,25 @@ 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
- sh rustup.sh -y --profile=minimal --default-toolchain 1.40.0 --target x86_64-unknown-redox
- . $HOME/.cargo/env
- cargo build --all-targets

- language: generic
name: fuchsia
script:
- curl --proto '=https' --tlsv1.2 -sSf --output rustup.sh https://sh.rustup.rs
- sh rustup.sh -y --profile=minimal --default-toolchain 1.40.0 --target x86_64-fuchsia
- . $HOME/.cargo/env
- cargo build --target x86_64-fuchsia
# cargo test wants to build a binary, but it isn't possible to link
# Rust binaries without the presence of a Fuchsia sysroot. When it is
# possible, we should make sure tests compile and link, too. Following
# that, we should run the tests when possible.
# - cargo test --target x86_64-fuchsia --no-run
# All we can do for now is make sure the tests type-check:
- cargo check --target x86_64-fuchsia --all-targets

before_install: set -e

install:
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased] - ReleaseDate
### Added
- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306))

- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285))
### Changed
- Minimum supported Rust version is now 1.40.0.
([#1285](https://github.com/nix-rust/nix/pull/1285))
### Fixed
### Changed
### Removed
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ targets = [
"x86_64-unknown-openbsd",
"x86_64-unknown-netbsd",
"x86_64-unknown-dragonfly",
"x86_64-fuchsia",
"x86_64-unknown-redox"
]

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ Tier 2:
* x86_64-unknown-netbsd

Tier 3:
* x86_64-fuchsia
* x86_64-unknown-redox

## Usage

`nix` requires Rust 1.36.0 or newer.
`nix` requires Rust 1.40.0 or newer.

To use `nix`, add this to your `Cargo.toml`:

Expand Down
Loading

0 comments on commit 769d664

Please sign in to comment.