diff options
author | Daniel Mueller <deso@posteo.net> | 2020-04-04 14:39:19 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-04-04 14:39:19 -0700 |
commit | d0d9683df8398696147e7ee1fcffb2e4e957008c (patch) | |
tree | 4baa76712a76f4d072ee3936c07956580b230820 /libc/ci | |
parent | 203e691f46d591a2cc8acdfd850fa9f5b0fb8a98 (diff) | |
download | nitrocli-d0d9683df8398696147e7ee1fcffb2e4e957008c.tar.gz nitrocli-d0d9683df8398696147e7ee1fcffb2e4e957008c.tar.bz2 |
Remove vendored dependencies
While it appears that by now we actually can get successful builds
without Cargo insisting on Internet access by virtue of using the
--frozen flag, maintaining vendored dependencies is somewhat of a pain
point. This state will also get worse with upcoming changes that replace
argparse in favor of structopt and pull in a slew of new dependencies by
doing so. Then there is also the repository structure aspect, which is
non-standard due to the way we vendor dependencies and a potential
source of confusion.
In order to fix these problems, this change removes all the vendored
dependencies we have.
Delete subrepo argparse/:argparse
Delete subrepo base32/:base32
Delete subrepo cc/:cc
Delete subrepo cfg-if/:cfg-if
Delete subrepo getrandom/:getrandom
Delete subrepo lazy-static/:lazy-static
Delete subrepo libc/:libc
Delete subrepo nitrokey-sys/:nitrokey-sys
Delete subrepo nitrokey/:nitrokey
Delete subrepo rand/:rand
Diffstat (limited to 'libc/ci')
57 files changed, 0 insertions, 2710 deletions
diff --git a/libc/ci/README.md b/libc/ci/README.md deleted file mode 100644 index 3123553..0000000 --- a/libc/ci/README.md +++ /dev/null @@ -1,236 +0,0 @@ -The goal of the libc crate is to have CI running everywhere to have the -strongest guarantees about the definitions that this library contains, and as a -result the CI is pretty complicated and also pretty large! Hopefully this can -serve as a guide through the sea of scripts in this directory and elsewhere in -this project. - -# Files - -First up, let's talk about the files in this directory: - -* `run-docker.sh` - a shell script run by most builders, it will execute - `run.sh` inside a Docker container configured for the target. - -* `run.sh` - the actual script which runs tests for a particular architecture. - -* `dox.sh` - build the documentation of the crate and publish it to gh-pages. - -* `landing-page-*.html` - used by `dox.sh` to generate a landing page for all - architectures' documentation. - -* `run-qemu.sh` - see discussion about QEMU below - -* `mips`, `rumprun` - instructions to build the docker image for each respective - CI target - -# CI Systems - -Currently this repository leverages a combination of Travis CI and AppVeyor for -running tests. The triples tested are: - -* AppVeyor - * `{i686,x86_64}-pc-windows-{msvc,gnu}` -* Travis - * `{i686,x86_64,mips,aarch64}-unknown-linux-gnu` - * `{x86_64,aarch64}-unknown-linux-musl` - * `arm-unknown-linux-gnueabihf` - * `arm-linux-androideabi` - * `{i686,x86_64}-apple-{darwin,ios}` - * `x86_64-rumprun-netbsd` - * `x86_64-unknown-freebsd` - * `x86_64-unknown-openbsd` - -The Windows triples are all pretty standard, they just set up their environment -then run tests, no need for downloading any extra target libs (we just download -the right installer). The Intel Linux/OSX builds are similar in that we just -download the right target libs and run tests. Note that the Intel Linux/OSX -builds are run on stable/beta/nightly, but are the only ones that do so. - -The remaining architectures look like: - -* Android runs in a [docker image][android-docker] with an emulator, the NDK, - and the SDK already set up. The entire build happens within the docker image. -* The MIPS, ARM, and AArch64 builds all use the QEMU userspace emulator to run - the generated binary to actually verify the tests pass. -* The MUSL build just has to download a MUSL compiler and target libraries and - then otherwise runs tests normally. -* iOS builds need an extra linker flag currently, but beyond that they're built - as standard as everything else. -* The rumprun target builds an entire kernel from the test suite and then runs - it inside QEMU using the serial console to test whether it succeeded or - failed. -* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system - and compile/run tests. More information on that below. - -[android-docker]: https://github.com/rust-lang/rust-buildbot/blob/master/slaves/android/Dockerfile - -## QEMU - -Lots of the architectures tested here use QEMU in the tests, so it's worth going -over all the crazy capabilities QEMU has and the various flavors in which we use -it! - -First up, QEMU has userspace emulation where it doesn't boot a full kernel, it -just runs a binary from another architecture (using the `qemu-<arch>` wrappers). -We provide it the runtime path for the dynamically loaded system libraries, -however. This strategy is used for all Linux architectures that aren't intel. -Note that one downside of this QEMU system is that threads are barely -implemented, so we're careful to not spawn many threads. - -For the rumprun target the only output is a kernel image, so we just use that -plus the `rumpbake` command to create a full kernel image which is then run from -within QEMU. - -Finally, the fun part, the BSDs. Quite a few hoops are jumped through to get CI -working for these platforms, but the gist of it looks like: - -* Cross compiling from Linux to any of the BSDs seems to be quite non-standard. - We may be able to get it working but it might be difficult at that point to - ensure that the libc definitions align with what you'd get on the BSD itself. - As a result, we try to do compiles within the BSD distro. -* On Travis we can't run a VM-in-a-VM, so we resort to userspace emulation - (QEMU). -* Unfortunately on Travis we also can't use KVM, so the emulation is super slow. - -With all that in mind, the way BSD is tested looks like: - -1. Download a pre-prepared image for the OS being tested. -2. Generate the tests for the OS being tested. This involves running the `ctest` - library over libc to generate a Rust file and a C file which will then be - compiled into the final test. -3. Generate a disk image which will later be mounted by the OS being tested. - This image is mostly just the libc directory, but some modifications are made - to compile the generated files from step 2. -4. The kernel is booted in QEMU, and it is configured to detect the libc-test - image being available, run the test script, and then shut down afterwards. -5. Look for whether the tests passed in the serial console output of the kernel. - -There's some pretty specific instructions for setting up each image (detailed -below), but the main gist of this is that we must avoid a vanilla `cargo run` -inside of the `libc-test` directory (which is what it's intended for) because -that would compile `syntex_syntax`, a large library, with userspace emulation. -This invariably times out on Travis, so we can't do that. - -Once all those hoops are jumped through, however, we can be happy that we're -testing almost everything! - -Below are some details of how to set up the initial OS images which are -downloaded. Each image must be enabled have input/output over the serial -console, log in automatically at the serial console, detect if a second drive in -QEMU is available, and if so mount it, run a script (it'll specifically be -`run-qemu.sh` in this folder which is copied into the generated image talked -about above), and then shut down. - -### QEMU Setup - FreeBSD - -1. [Download the latest stable amd64-bootonly release ISO](https://www.freebsd.org/where.html). - E.g. FreeBSD-11.1-RELEASE-amd64-bootonly.iso -2. Create the disk image: `qemu-img create -f qcow2 FreeBSD-11.1-RELEASE-amd64.qcow2 2G` -3. Boot the machine: `qemu-system-x86_64 -cdrom FreeBSD-11.1-RELEASE-amd64-bootonly.iso -drive if=virtio,file=FreeBSD-11.1-RELEASE-amd64.qcow2 -net nic,model=virtio -net user` -4. Run the installer, and install FreeBSD: - 1. Install - 1. Continue with default keymap - 1. Set Hostname: freebsd-ci - 1. Distribution Select: - 1. Uncheck lib32 - 1. Uncheck ports - 1. Network Configuration: vtnet0 - 1. Configure IPv4? Yes - 1. DHCP? Yes - 1. Configure IPv6? No - 1. Resolver Configuration: Ok - 1. Mirror Selection: Main Site - 1. Partitioning: Auto (UFS) - 1. Partition: Entire Disk - 1. Partition Scheme: MBR - 1. App Partition: Ok - 1. Partition Editor: Finish - 1. Confirmation: Commit - 1. Wait for sets to install - 1. Set the root password to nothing (press enter twice) - 1. Set time zone to UTC - 1. Set Date: Skip - 1. Set Time: Skip - 1. System Configuration: - 1. Disable sshd - 1. Disable dumpdev - 1. System Hardening - 1. Disable Sendmail service - 1. Add User Accounts: No - 1. Final Configuration: Exit - 1. Manual Configuration: Yes - 1. `echo 'console="comconsole"' >> /boot/loader.conf` - 1. `echo 'autoboot_delay="0"' >> /boot/loader.conf` - 1. `echo 'ext2fs_load="YES"' >> /boot/loader.conf` - 1. Look at `/etc/ttys`, see what getty argument is for `ttyu0` (E.g. `3wire`) - 1. Edit `/etc/gettytab` (with `vi` for example), look for `ttyu0` argument, - prepend `:al=root` to the line beneath to have the machine auto-login as - root. E.g. - - 3wire:\ - :np:nc:sp#0: - becomes: - - 3wire:\ - :al=root:np:nc:sp#0: - - 1. Edit `/root/.login` and put this in it: - - [ -e /dev/vtbd1 ] || exit 0 - mount -t ext2fs /dev/vtbd1 /mnt - sh /mnt/run.sh /mnt - poweroff - - 1. Exit the post install shell: `exit` - 1. Back in in the installer choose Reboot - 1. If all went well the machine should reboot and show a login prompt. - If you switch to the serial console by choosing View > serial0 in - the qemu menu, you should be logged in as root. - 1. Shutdown the machine: `shutdown -p now` - -Helpful links - -* https://en.wikibooks.org/wiki/QEMU/Images -* https://blog.nekoconeko.nl/blog/2015/06/04/creating-an-openstack-freebsd-image.html -* https://www.freebsd.org/doc/handbook/serialconsole-setup.html - - -### QEMU setup - OpenBSD - -1. Download CD installer -2. `qemu-img create -f qcow2 foo.qcow2 2G` -3. `qemu -cdrom foo.iso -drive if=virtio,file=foo.qcow2 -net nic,model=virtio -net user` -4. run installer -5. `echo 'set tty com0' >> /etc/boot.conf` -6. `echo 'boot' >> /etc/boot.conf` -7. Modify /etc/ttys, change the `tty00` at the end from 'unknown off' to - 'vt220 on secure' -8. Modify same line in /etc/ttys to have `"/root/foo.sh"` as the shell -9. Add this script to `/root/foo.sh` - -``` -#!/bin/sh -exec 1>/dev/tty00 -exec 2>&1 - -if mount -t ext2fs /dev/sd1c /mnt; then - sh /mnt/run.sh /mnt - shutdown -ph now -fi - -# limited shell... -exec /bin/sh < /dev/tty00 -``` - -10. `chmod +x /root/foo.sh` - -Helpful links: - -* https://en.wikibooks.org/wiki/QEMU/Images -* http://www.openbsd.org/faq/faq7.html#SerCon - -# Questions? - -Hopefully that's at least somewhat of an introduction to everything going on -here, and feel free to ping @alexcrichton with questions! - diff --git a/libc/ci/android-install-ndk.sh b/libc/ci/android-install-ndk.sh deleted file mode 100644 index 723e719..0000000 --- a/libc/ci/android-install-ndk.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env sh -# Copyright 2016 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -set -ex - -NDK=android-ndk-r19c -curl --retry 20 -O https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip -unzip -q ${NDK}-linux-x86_64.zip - -case "$1" in - arm) - arch=arm - api=24 - ;; - armv7) - arch=arm - api=24 - ;; - aarch64) - arch=arm64 - api=24 - ;; - i686) - arch=x86 - api=28 - ;; - x86_64) - arch=x86_64 - api=28 - ;; - *) - echo "invalid arch: $1" - exit 1 - ;; -esac; - -${NDK}/build/tools/make_standalone_toolchain.py \ - --install-dir "/android/ndk-${1}" \ - --arch "${arch}" \ - --api ${api} - -rm -rf ./${NDK}-linux-x86_64.zip ./${NDK} diff --git a/libc/ci/android-install-sdk.sh b/libc/ci/android-install-sdk.sh deleted file mode 100644 index 7f21040..0000000 --- a/libc/ci/android-install-sdk.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env sh -# Copyright 2016 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -set -ex - -# Prep the SDK and emulator -# -# Note that the update process requires that we accept a bunch of licenses, and -# we can't just pipe `yes` into it for some reason, so we take the same strategy -# located in https://github.com/appunite/docker by just wrapping it in a script -# which apparently magically accepts the licenses. - -SDK=4333796 -mkdir sdk -curl --retry 20 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip -O -unzip -q -d sdk sdk-tools-linux-${SDK}.zip - -case "$1" in - arm | armv7) - api=24 - image="system-images;android-${api};google_apis;armeabi-v7a" - ;; - aarch64) - api=24 - image="system-images;android-${api};google_apis;arm64-v8a" - ;; - i686) - api=28 - image="system-images;android-${api};default;x86" - ;; - x86_64) - api=28 - image="system-images;android-${api};default;x86_64" - ;; - *) - echo "invalid arch: $1" - exit 1 - ;; -esac; - -# Try to fix warning about missing file. -# See https://askubuntu.com/a/1078784 -mkdir -p /root/.android/ -echo '### User Sources for Android SDK Manager' >> /root/.android/repositories.cfg -echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg - -# Print all available packages -# yes | ./sdk/tools/bin/sdkmanager --list --verbose - -# --no_https avoids -# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found -# -# | grep -v = || true removes the progress bar output from the sdkmanager -# which produces an insane amount of output. -yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true -yes | ./sdk/tools/bin/sdkmanager --no_https \ - "emulator" \ - "platform-tools" \ - "platforms;android-${api}" \ - "${image}" | grep -v = || true - -echo "no" | - ./sdk/tools/bin/avdmanager create avd \ - --name "${1}" \ - --package "${image}" | grep -v = || true diff --git a/libc/ci/android-sysimage.sh b/libc/ci/android-sysimage.sh deleted file mode 100644 index 9eabd7c..0000000 --- a/libc/ci/android-sysimage.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -set -ex - -URL=https://dl.google.com/android/repository/sys-img/android - -main() { - local arch="${1}" - local name="${2}" - local dest=/system - local td - td="$(mktemp -d)" - - apt-get install --no-install-recommends e2tools - - pushd "${td}" - curl --retry 5 -O "${URL}/${name}" - unzip -q "${name}" - - local system - system="$(find . -name system.img)" - mkdir -p ${dest}/{bin,lib,lib64} - - # Extract android linker and libraries to /system - # This allows android executables to be run directly (or with qemu) - if [ "${arch}" = "x86_64" ] || [ "${arch}" = "arm64" ]; then - e2cp -p "${system}:/bin/linker64" "${dest}/bin/" - e2cp -p "${system}:/lib64/libdl.so" "${dest}/lib64/" - e2cp -p "${system}:/lib64/libc.so" "${dest}/lib64/" - e2cp -p "${system}:/lib64/libm.so" "${dest}/lib64/" - else - e2cp -p "${system}:/bin/linker" "${dest}/bin/" - e2cp -p "${system}:/lib/libdl.so" "${dest}/lib/" - e2cp -p "${system}:/lib/libc.so" "${dest}/lib/" - e2cp -p "${system}:/lib/libm.so" "${dest}/lib/" - fi - - # clean up - apt-get purge --auto-remove -y e2tools - - popd - - rm -rf "${td}" -} - -main "${@}" diff --git a/libc/ci/azure-install-rust.yml b/libc/ci/azure-install-rust.yml deleted file mode 100644 index 31b0714..0000000 --- a/libc/ci/azure-install-rust.yml +++ /dev/null @@ -1,82 +0,0 @@ -steps: - - bash: | - set -ex - toolchain=$TOOLCHAIN - if [ "$toolchain" = "" ]; then - toolchain=nightly - fi - if command -v rustup; then - # Uncomment when rustup on Azure is updated - #rustup set profile minimal - rustup update --force $toolchain - rustup default $toolchain - else - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain --profile=minimal - echo "##vso[task.prependpath]$HOME/.cargo/bin" - fi - displayName: Install rust (unix) - condition: ne( variables['Agent.OS'], 'Windows_NT' ) - - script: | - @echo on - if not defined TOOLCHAIN set TOOLCHAIN=nightly - :: Uncomment when rustup on Azure is updated - ::rustup set profile minimal - rustup update --no-self-update %TOOLCHAIN%-%TARGET% - rustup default %TOOLCHAIN%-%TARGET% - displayName: Install rust (windows) - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - set -ex - if [ -n "${TARGET}" ]; then - rustup target add $TARGET - fi - condition: ne( variables['Agent.OS'], 'Windows_NT' ) - displayName: Install target (unix) - - script: | - @echo on - if defined TARGET rustup target add %TARGET% - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Install target (windows) - - script: | - @echo on - if "%ARCH%" == "i686" choco install mingw --x86 --force - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Install MinGW32 (windows) - - bash: | - set -ex - gcc -print-search-dirs - find "C:\ProgramData\Chocolatey" -name "crt2*" - find "C:\ProgramData\Chocolatey" -name "dllcrt2*" - find "C:\ProgramData\Chocolatey" -name "libmsvcrt*" - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Find GCC libraries (windows) - - bash: | - set -ex - if [[ -n ${ARCH_BITS} ]]; then - for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do - cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw${ARCH_BITS}/${ARCH}-w64-mingw32/lib/$i" "`rustc --print sysroot`/lib/rustlib/${TARGET}/lib" - done - fi - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Fix MinGW (windows) - - bash: | - set -ex - rustc -Vv - cargo -V - rustup -Vv - rustup show - which rustc - which cargo - which rustup - displayName: Query rust and cargo versions - - script: | - @echo on - where gcc - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Query gcc path - - bash: | - set -ex - cargo generate-lockfile - cargo generate-lockfile --manifest-path libc-test/Cargo.toml - displayName: Generate lockfiles - diff --git a/libc/ci/azure-master.yml b/libc/ci/azure-master.yml deleted file mode 100644 index d7bcb7c..0000000 --- a/libc/ci/azure-master.yml +++ /dev/null @@ -1,22 +0,0 @@ -variables: - - group: secrets -resources: - repositories: - - repository: rustinfra - type: github - name: rust-lang/simpleinfra - endpoint: gnzlbg -trigger: ["master"] -pr: ["master"] - -jobs: - - job: StyleAndDocs - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - - script: LIBC_CI=1 sh ci/dox.sh - displayName: Generate documentation - - template: azure-configs/static-websites.yml@rustinfra - parameters: - deploy_dir: target/doc diff --git a/libc/ci/azure.yml b/libc/ci/azure.yml deleted file mode 100644 index da25a26..0000000 --- a/libc/ci/azure.yml +++ /dev/null @@ -1,228 +0,0 @@ -variables: - - group: secrets -resources: - repositories: - - repository: rustinfra - type: github - name: rust-lang/simpleinfra - endpoint: gnzlbg -trigger: ["auto-libc","try"] -pr: ["master"] - -jobs: - - job: DockerLinuxTier1 - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - - bash: LIBC_CI=1 sh ./ci/run-docker.sh $TARGET - displayName: Execute run-docker.sh - strategy: - matrix: - i686-unknown-linux-gnu: - TARGET: i686-unknown-linux-gnu - x86_64-unknown-linux-gnu: - TARGET: x86_64-unknown-linux-gnu - - - job: DockerLinuxTier2 - #dependsOn: DockerLinuxTier1 - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - - bash: LIBC_CI=1 sh ./ci/run-docker.sh $TARGET - displayName: Execute run-docker.sh - strategy: - matrix: - aarch64-unknown-linux-android: - TARGET: aarch64-linux-android - aarch64-unknown-linux-gnu: - TARGET: aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl: - TARGET: aarch64-unknown-linux-musl - arm-linux-androideabi: - TARGET: arm-linux-androideabi - arm-unknown-linux-gnueabihf: - TARGET: arm-unknown-linux-gnueabihf - arm-unknown-linux-musleabihf: - TARGET: arm-unknown-linux-musleabihf - # Disabled because currently broken, see: - # https://github.com/rust-lang/libc/issues/1591 - # asmjs-unknown-emscripten: - # TARGET: asmjs-unknown-emscripten - i686-linux-android: - TARGET: i686-linux-android - i686-unknown-linux-musl: - TARGET: i686-unknown-linux-musl - mips-unknown-linux-gnu: - TARGET: mips-unknown-linux-gnu - mips-unknown-linux-musl: - TARGET: mips-unknown-linux-musl - mips64-unknown-linux-gnuabi64: - TARGET: mips64-unknown-linux-gnuabi64 - mips64el-unknown-linux-gnuabi64: - TARGET: mips64el-unknown-linux-gnuabi64 - mipsel-unknown-linux-musl: - TARGET: mipsel-unknown-linux-musl - #powerpc-unknown-linux-gnu: - # TARGET: powerpc-unknown-linux-gnu - powerpc64-unknown-linux-gnu: - TARGET: powerpc64-unknown-linux-gnu - powerpc64le-unknown-linux-gnu: - TARGET: powerpc64le-unknown-linux-gnu - #s390x-unknown-linux-gnu: - # TARGET: s390x-unknown-linux-gnu - #wasm32-wasi - # TARGET: wasm32-wasi - sparc64-unknown-linux-gnu: - TARGET: sparc64-unknown-linux-gnu - # Disabled because currently broken, see: - # https://github.com/rust-lang/libc/issues/1591 - # wasm32-unknown-emscripten: - # TARGET: wasm32-unknown-emscripten - x86_64-linux-android: - TARGET: x86_64-linux-android - x86_64-unknown-linux-gnux32: - TARGET: x86_64-unknown-linux-gnux32 - x86_64-unknown-linux-musl: - TARGET: x86_64-unknown-linux-musl - - - job: DockerOSX64 - pool: - vmImage: macos-10.14 - steps: - - template: azure-install-rust.yml - - bash: LIBC_CI=1 sh ./ci/run.sh $TARGET - displayName: Execute run.sh - strategy: - matrix: - x86_64-apple-darwin: - TARGET: x86_64-apple-darwin - - - job: DockerOSX32 - pool: - vmImage: macos-10.13 - steps: - - template: azure-install-rust.yml - - bash: LIBC_CI=1 sh ./ci/run.sh $TARGET - displayName: Execute run.sh - strategy: - matrix: - i686-apple-darwin: - TARGET: i686-apple-darwin - - - job: Windows - pool: - vmImage: vs2017-win2016 - steps: - - template: azure-install-rust.yml - - bash: LIBC_CI=1 sh ./ci/run.sh $TARGET - displayName: Execute run.sh - strategy: - matrix: - x86_64-pc-windows-gnu: - TARGET: x86_64-pc-windows-gnu - ARCH_BITS: 64 - ARCH: x86_64 - x86_64-pc-windows-msvc: - TARGET: x86_64-pc-windows-msvc - # Disabled because broken: - # https://github.com/rust-lang/libc/issues/1592 - #i686-pc-windows-gnu: - # TARGET: i686-pc-windows-gnu - # ARCH_BITS: 32 - # ARCH: i686 - i686-pc-windows-msvc: - TARGET: i686-pc-windows-msvc - - - job: StyleAndDocs - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - - script: sh ci/style.sh - displayName: Check style - - script: LIBC_CI=1 sh ci/dox.sh - displayName: Generate documentation - - template: azure-configs/static-websites.yml@rustinfra - parameters: - deploy_dir: target/doc - - # FIXME: re-enable these after the next release - #- job: SemverLinux - # dependsOn: BuildChannelsLinux - # continueOnError: true - # pool: - # vmImage: ubuntu-16.04 - # steps: - # - template: azure-install-rust.yml - # - script: sh ci/semver.sh linux - # displayName: Check breaking changes - - #- job: SemverOSX - # dependsOn: BuildChannelsOSX - # continueOnError: true - # pool: - # vmImage: macos-10.14 - # steps: - # - template: azure-install-rust.yml - # - script: sh ci/semver.sh osx - # displayName: Check breaking changes - - - job: BuildChannelsLinux - dependsOn: StyleAndDocs - pool: - vmImage: ubuntu-16.04 - steps: - - template: azure-install-rust.yml - - script: LIBC_CI=1 sh ./ci/build.sh - displayName: Execute build.sh - strategy: - matrix: - stable: - TOOLCHAIN: stable - beta: - TOOLCHAIN: beta - nightly: - TOOLCHAIN: nightly - 1.13.0: - TOOLCHAIN: 1.13.0 - 1.19.0: - TOOLCHAIN: 1.19.0 - 1.24.0: - TOOLCHAIN: 1.24.0 - 1.25.0: - TOOLCHAIN: 1.25.0 - 1.30.0: - TOOLCHAIN: 1.30.0 - variables: - OS: linux - - - job: BuildChannelsOSX - dependsOn: StyleAndDocs - pool: - vmImage: macos-10.13 - steps: - - template: azure-install-rust.yml - - script: LIBC_CI=1 sh ./ci/build.sh - displayName: Execute build.sh - strategy: - matrix: - stable: - TOOLCHAIN: stable - beta: - TOOLCHAIN: beta - nightly: - TOOLCHAIN: nightly - 1.13.0: - TOOLCHAIN: 1.13.0 - 1.19.0: - TOOLCHAIN: 1.19.0 - 1.24.0: - TOOLCHAIN: 1.24.0 - 1.25.0: - TOOLCHAIN: 1.25.0 - 1.30.0: - TOOLCHAIN: 1.30.0 - variables: - OS: osx diff --git a/libc/ci/build.sh b/libc/ci/build.sh deleted file mode 100644 index 082f0dc..0000000 --- a/libc/ci/build.sh +++ /dev/null @@ -1,272 +0,0 @@ -#!/usr/bin/env sh - -# Checks that libc builds properly for all supported targets on a particular -# Rust version: -# The FILTER environment variable can be used to select which target(s) to build. -# For example: set FILTER to vxworks to select the targets that has vxworks in name - -set -ex - -: "${TOOLCHAIN?The TOOLCHAIN environment variable must be set.}" -: "${OS?The OS environment variable must be set.}" - -RUST=${TOOLCHAIN} - -echo "Testing Rust ${RUST} on ${OS}" - -if [ "${TOOLCHAIN}" = "nightly" ] ; then - cargo +nightly install cargo-xbuild - rustup component add rust-src -fi - -test_target() { - BUILD_CMD="${1}" - TARGET="${2}" - NO_STD="${3}" - - opt= - if [ "${TARGET}" = "x86_64-unknown-linux-gnux32" ]; then - # FIXME: x86_64-unknown-linux-gnux32 fail to compile without - # --release - # - # See https://github.com/rust-lang/rust/issues/45417 - opt="--release" - fi - # FIXME: https://github.com/rust-lang/rust/issues/61174 - if [ "${TARGET}" = "sparcv9-sun-solaris" ] || - [ "${TARGET}" = "x86_64-sun-solaris" ]; then - return 0 - fi - - # If there is a std component, fetch it: - if [ "${NO_STD}" != "1" ]; then - # FIXME: rustup often fails to download some artifacts due to network - # issues, so we retry this N times. - N=5 - n=0 - until [ $n -ge $N ] - do - if rustup target add "${TARGET}" --toolchain "${RUST}" ; then - break - fi - n=$((n+1)) - sleep 1 - done - fi - - # Test that libc builds without any default features (no libstd) - cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --no-default-features --target "${TARGET}" - - # Test that libc builds with default features (e.g. libstd) - # if the target supports libstd - if [ "$NO_STD" != "1" ]; then - cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --target "${TARGET}" - fi - - # Test that libc builds with the `extra_traits` feature - cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --no-default-features --target "${TARGET}" \ - --features extra_traits - - # Test the 'const-extern-fn' feature on nightly - if [ "${RUST}" = "nightly" ]; then - cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --no-default-features --target "${TARGET}" \ - --features const-extern-fn - fi - - - # Also test that it builds with `extra_traits` and default features: - if [ "$NO_STD" != "1" ]; then - cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --target "${TARGET}" \ - --features extra_traits - fi -} - -RUST_LINUX_TARGETS="\ -aarch64-linux-android \ -aarch64-unknown-linux-gnu \ -arm-linux-androideabi \ -arm-unknown-linux-gnueabi \ -arm-unknown-linux-gnueabihf \ -armv7-linux-androideabi \ -armv7-unknown-linux-gnueabihf \ -i586-unknown-linux-gnu \ -i686-linux-android \ -i686-unknown-freebsd \ -i686-unknown-linux-gnu \ -i686-unknown-linux-musl \ -mips-unknown-linux-gnu \ -mips-unknown-linux-musl \ -mips64-unknown-linux-gnuabi64 \ -mips64el-unknown-linux-gnuabi64 \ -mipsel-unknown-linux-gnu \ -mipsel-unknown-linux-musl \ -powerpc-unknown-linux-gnu \ -powerpc64-unknown-linux-gnu \ -powerpc64le-unknown-linux-gnu \ -s390x-unknown-linux-gnu \ -x86_64-unknown-freebsd \ -x86_64-unknown-linux-gnu \ -x86_64-unknown-linux-musl \ -x86_64-unknown-netbsd \ -" - -RUST_GT_1_13_LINUX_TARGETS="\ -arm-unknown-linux-musleabi \ -arm-unknown-linux-musleabihf \ -armv7-unknown-linux-musleabihf \ -sparc64-unknown-linux-gnu \ -wasm32-unknown-emscripten \ -x86_64-linux-android \ -x86_64-rumprun-netbsd \ -" -RUST_GT_1_19_LINUX_TARGETS="\ -aarch64-unknown-linux-musl \ -sparcv9-sun-solaris \ -wasm32-unknown-unknown \ -x86_64-sun-solaris \ -" -RUST_GT_1_24_LINUX_TARGETS="\ -i586-unknown-linux-musl \ -x86_64-unknown-cloudabi \ -" - -# FIXME: temporarirly disable the redox target -# https://github.com/rust-lang/libc/issues/1457 -# x86_64-unknown-redox -RUST_NIGHTLY_LINUX_TARGETS="\ -aarch64-fuchsia \ -armv5te-unknown-linux-gnueabi \ -armv5te-unknown-linux-musleabi \ -i686-pc-windows-gnu \ -wasm32-wasi \ -x86_64-fortanix-unknown-sgx \ -x86_64-fuchsia \ -x86_64-pc-windows-gnu \ -x86_64-unknown-linux-gnux32 \ -" - -RUST_OSX_TARGETS="\ -aarch64-apple-ios \ -armv7-apple-ios \ -armv7s-apple-ios \ -i386-apple-ios \ -i686-apple-darwin \ -x86_64-apple-darwin \ -x86_64-apple-ios \ -" - -# The targets are listed here alphabetically -TARGETS="" -case "${OS}" in - linux*) - TARGETS="${RUST_LINUX_TARGETS}" - - if [ "${RUST}" != "1.13.0" ]; then - TARGETS="${TARGETS} ${RUST_GT_1_13_LINUX_TARGETS}" - if [ "${RUST}" != "1.19.0" ]; then - TARGETS="${TARGETS} ${RUST_GT_1_19_LINUX_TARGETS}" - if [ "${RUST}" != "1.24.0" ]; then - TARGETS="${TARGETS} ${RUST_GT_1_24_LINUX_TARGETS}" - fi - fi - fi - - if [ "${RUST}" = "nightly" ]; then - TARGETS="${TARGETS} ${RUST_NIGHTLY_LINUX_TARGETS}" - fi - - ;; - osx*) - TARGETS="${RUST_OSX_TARGETS}" - ;; - *) - ;; -esac - -for TARGET in $TARGETS; do - if echo "$TARGET"|grep -q "$FILTER";then - test_target build "$TARGET" - fi -done - -# FIXME: https://github.com/rust-lang/rust/issues/58564 -# sparc-unknown-linux-gnu -# FIXME: https://github.com/rust-lang/rust/issues/62932 -# thumbv6m-none-eabi -RUST_LINUX_NO_CORE_TARGETS="\ -aarch64-pc-windows-msvc \ -aarch64-unknown-cloudabi \ -aarch64-unknown-freebsd \ -aarch64-unknown-hermit \ -aarch64-unknown-netbsd \ -aarch64-unknown-openbsd \ -armebv7r-none-eabi \ -armebv7r-none-eabihf \ -armv7-unknown-cloudabi-eabihf \ -armv7r-none-eabi \ -armv7r-none-eabihf \ -hexagon-unknown-linux-musl \ -i586-pc-windows-msvc \ -i686-pc-windows-msvc \ -i686-unknown-cloudabi \ -i686-unknown-haiku \ -i686-unknown-netbsd \ -i686-unknown-openbsd \ -mips-unknown-linux-uclibc \ -mipsel-unknown-linux-uclibc \ -mips64-unknown-linux-muslabi64 \ -mips64el-unknown-linux-muslabi64 \ -nvptx64-nvidia-cuda \ -powerpc-unknown-linux-gnuspe \ -powerpc-unknown-netbsd \ -powerpc64-unknown-freebsd \ -riscv64gc-unknown-linux-gnu \ -riscv32imac-unknown-none-elf \ -riscv32imc-unknown-none-elf \ -sparc64-unknown-netbsd \ - -thumbv7em-none-eabi \ -thumbv7em-none-eabihf \ -thumbv7m-none-eabi \ -thumbv7neon-linux-androideabi \ -thumbv7neon-unknown-linux-gnueabihf \ -thumbv8m.main-none-eabi \ -x86_64-pc-windows-msvc -x86_64-unknown-dragonfly \ -x86_64-unknown-haiku \ -x86_64-unknown-hermit \ -x86_64-unknown-l4re-uclibc \ -x86_64-unknown-openbsd \ -armv7-wrs-vxworks-eabihf \ -aarch64-wrs-vxworks \ -i686-wrs-vxworks \ -x86_64-wrs-vxworks \ -powerpc-wrs-vxworks \ -powerpc-wrs-vxworks-spe \ -powerpc64-wrs-vxworks \ -" - -if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then - for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do - if echo "$TARGET"|grep -q "$FILTER";then - test_target xbuild "$TARGET" 1 - fi - done - - # Nintendo switch - cargo clean - mkdir -p target - ( - cd target - wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb - sudo dpkg -i devkitpro-pacman.deb - sudo dkp-pacman -Sy - sudo dkp-pacman -Syu - sudo dkp-pacman -S -v --noconfirm switch-dev devkitA64 - ) - cp ci/switch.json switch.json - PATH="$PATH:/opt/devkitpro/devkitA64/bin" - PATH="$PATH:/opt/devkitpro/tools/bin" - cargo xbuild --target switch.json -fi - diff --git a/libc/ci/docker/aarch64-linux-android/Dockerfile b/libc/ci/docker/aarch64-linux-android/Dockerfile deleted file mode 100644 index 6751dd9..0000000 --- a/libc/ci/docker/aarch64-linux-android/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -FROM ubuntu:19.04 - -RUN dpkg --add-architecture i386 && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - file \ - curl \ - ca-certificates \ - python \ - unzip \ - expect \ - openjdk-8-jre \ - libstdc++6:i386 \ - libpulse0 \ - gcc \ - libc6-dev - -WORKDIR /android/ -COPY android* /android/ - -ENV ANDROID_ARCH=aarch64 -ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools - -RUN sh /android/android-install-ndk.sh $ANDROID_ARCH -RUN sh /android/android-install-sdk.sh $ANDROID_ARCH -RUN mv /root/.android /tmp -RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* - -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \ - CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \ - HOME=/tmp - -ADD runtest-android.rs /tmp/runtest.rs -ENTRYPOINT [ \ - "bash", \ - "-c", \ - # set SHELL so android can detect a 64bits system, see - # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \ - rustc /tmp/runtest.rs -o /tmp/runtest && \ - exec \"$@\"", \ - "--" \ -] diff --git a/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile deleted file mode 100644 index 716a445..0000000 --- a/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ubuntu:19.04 -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev ca-certificates \ - gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user -ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile deleted file mode 100644 index e9634bf..0000000 --- a/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates \ - gcc-aarch64-linux-gnu qemu-user - -COPY install-musl.sh / -RUN sh /install-musl.sh aarch64 - -# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd? -ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \ - CC_aarch64_unknown_linux_musl=musl-gcc \ - RUSTFLAGS='-Clink-args=-lgcc' \ - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \ - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-aarch64 -L /musl-aarch64" diff --git a/libc/ci/docker/arm-linux-androideabi/Dockerfile b/libc/ci/docker/arm-linux-androideabi/Dockerfile deleted file mode 100644 index 544d167..0000000 --- a/libc/ci/docker/arm-linux-androideabi/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -FROM ubuntu:19.04 - -RUN dpkg --add-architecture i386 && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - file \ - curl \ - ca-certificates \ - python \ - unzip \ - expect \ - openjdk-8-jre \ - libstdc++6:i386 \ - libpulse0 \ - gcc \ - libc6-dev - -WORKDIR /android/ -COPY android* /android/ - -ENV ANDROID_ARCH=arm -ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools - -RUN sh /android/android-install-ndk.sh $ANDROID_ARCH -RUN sh /android/android-install-sdk.sh $ANDROID_ARCH -RUN mv /root/.android /tmp -RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* - -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ - CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \ - HOME=/tmp - -ADD runtest-android.rs /tmp/runtest.rs -ENTRYPOINT [ \ - "bash", \ - "-c", \ - # set SHELL so android can detect a 64bits system, see - # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \ - rustc /tmp/runtest.rs -o /tmp/runtest && \ - exec \"$@\"", \ - "--" \ -] diff --git a/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile deleted file mode 100644 index bcdbb22..0000000 --- a/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ubuntu:19.04 -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev ca-certificates \ - gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user -ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile deleted file mode 100644 index 639b141..0000000 --- a/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates \ - gcc-arm-linux-gnueabihf qemu-user - -COPY install-musl.sh / -RUN sh /install-musl.sh arm - -ENV PATH=$PATH:/musl-arm/bin:/rust/bin \ - CC_arm_unknown_linux_musleabihf=musl-gcc \ - CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \ - CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm" diff --git a/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile b/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile deleted file mode 100644 index 64f73aa..0000000 --- a/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - gcc \ - git \ - libc6-dev \ - libxml2 \ - python \ - xz-utils - -COPY emscripten.sh / -RUN bash /emscripten.sh - -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node - -COPY emscripten-entry.sh / -ENTRYPOINT ["/emscripten-entry.sh"] diff --git a/libc/ci/docker/i686-linux-android/Dockerfile b/libc/ci/docker/i686-linux-android/Dockerfile deleted file mode 100644 index 5403220..0000000 --- a/libc/ci/docker/i686-linux-android/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -FROM ubuntu:19.04 - -RUN dpkg --add-architecture i386 && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - file \ - curl \ - ca-certificates \ - python \ - unzip \ - expect \ - openjdk-8-jre \ - libstdc++6:i386 \ - libpulse0 \ - gcc \ - libc6-dev - -WORKDIR /android/ -COPY android* /android/ - -ENV ANDROID_ARCH=i686 -ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools - -RUN sh /android/android-install-ndk.sh $ANDROID_ARCH -RUN sh /android/android-install-sdk.sh $ANDROID_ARCH -RUN mv /root/.android /tmp -RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* - -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \ - CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \ - HOME=/tmp - -ADD runtest-android.rs /tmp/runtest.rs -ENTRYPOINT [ \ - "bash", \ - "-c", \ - # set SHELL so android can detect a 64bits system, see - # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \ - rustc /tmp/runtest.rs -o /tmp/runtest && \ - exec \"$@\"", \ - "--" \ -] diff --git a/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile b/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile deleted file mode 100644 index 5563a7b..0000000 --- a/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:19.04 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc-multilib libc6-dev ca-certificates -ENV PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/i686-unknown-linux-musl/Dockerfile b/libc/ci/docker/i686-unknown-linux-musl/Dockerfile deleted file mode 100644 index ac76a32..0000000 --- a/libc/ci/docker/i686-unknown-linux-musl/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM ubuntu:19.04 - -RUN dpkg --add-architecture i386 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc-multilib make libc6-dev git curl ca-certificates libc6:i386 - -COPY install-musl.sh / -RUN sh /install-musl.sh i686 - -ENV PATH=$PATH:/musl-i686/bin:/rust/bin \ - CC_i686_unknown_linux_musl=musl-gcc diff --git a/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile b/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile deleted file mode 100644 index c8623a5..0000000 --- a/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-mips-linux-gnu libc6-dev-mips-cross \ - qemu-system-mips linux-headers-generic - -ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \ - CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="qemu-mips -L /usr/mips-linux-gnu" \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile b/libc/ci/docker/mips-unknown-linux-musl/Dockerfile deleted file mode 100644 index a1ec7ff..0000000 --- a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \ - xz-utils patch - -RUN mkdir /toolchain - -# Linux kernel version: 4.14.151 -# See build_dir/target-mips_24kc_musl/linux-ar71xx_generic/linux-4.14.151 -# Musl version: 1.1.24 -# See staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/info.mk -RUN curl --retry 5 -L https://downloads.openwrt.org/releases/19.07.0-rc1/targets/ar71xx/generic/openwrt-sdk-19.07.0-rc1-ar71xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz | \ - tar xJf - -C /toolchain --strip-components=1 - -# See https://lkml.org/lkml/2014/3/14/269 -COPY sysinfo_guard.patch /toolchain -RUN patch /toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include/linux/kernel.h </toolchain/sysinfo_guard.patch - -ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/bin \ - STAGING_DIR=/toolchain/staging_dir \ - CC_mips_unknown_linux_musl=mips-openwrt-linux-musl-gcc \ - CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-musl-gcc \ - CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mips -L /toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl" diff --git a/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile deleted file mode 100644 index d4b972d..0000000 --- a/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \ - qemu-system-mips64 linux-headers-generic - -ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \ - CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -L /usr/mips64-linux-gnuabi64" \ - CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile b/libc/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile deleted file mode 100644 index 8f63ade..0000000 --- a/libc/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates \ - gcc-mips64-linux-gnuabi64 qemu-user - -COPY install-musl.sh / -RUN sh /install-musl.sh mips64 - -# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd? -ENV PATH=$PATH:/musl-mips64/bin:/rust/bin \ - CC_mips64_unknown_linux_muslabi64=musl-gcc \ - RUSTFLAGS='-Clink-args=-lgcc' \ - CARGO_TARGET_MIPS64_UNKNOWN_LINUX_MUSLABI64_LINKER=musl-gcc \ - CARGO_TARGET_MIPS64_UNKNOWN_LINUX_MUSLABI64_RUNNER="qemu-mips64 -L /musl-mips64" diff --git a/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile deleted file mode 100644 index d0303da..0000000 --- a/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \ - qemu-system-mips64el linux-headers-generic - -ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \ - CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \ - CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile b/libc/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile deleted file mode 100644 index c42c2ba..0000000 --- a/libc/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates \ - gcc-mips64el-linux-gnuabi64 qemu-user - -COPY install-musl.sh / -RUN sh /install-musl.sh mips64el - -# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd? -ENV PATH=$PATH:/musl-mips64el/bin:/rust/bin \ - CC_mips64el_unknown_linux_muslabi64=musl-gcc \ - RUSTFLAGS='-Clink-args=-lgcc' \ - CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_LINKER=musl-gcc \ - CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_RUNNER="qemu-mips64el -L /musl-mips64el" diff --git a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile deleted file mode 100644 index 87399ec..0000000 --- a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \ - xz-utils patch - -RUN mkdir /toolchain - -# Linux kernel version: 4.14.151 -# See build_dir/target-mipsel_mips32_musl/linux-brcm47xx_generic/linux-4.14.151 -# Musl version: 1.1.24 -# See staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/info.mk -RUN curl --retry 5 -L https://downloads.openwrt.org/releases/19.07.0-rc1/targets/brcm47xx/generic/openwrt-sdk-19.07.0-rc1-brcm47xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz | \ - tar xJf - -C /toolchain --strip-components=1 - -# See https://lkml.org/lkml/2014/3/14/269 -COPY sysinfo_guard.patch /toolchain -RUN patch /toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/include/linux/kernel.h </toolchain/sysinfo_guard.patch - -ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/bin \ - STAGING_DIR=/toolchain/staging_dir \ - CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-musl-gcc \ - CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-musl-gcc \ - CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mipsel -L /toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl" diff --git a/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile deleted file mode 100644 index 9fa05af..0000000 --- a/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \ - qemu-system-ppc - -ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \ - CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -L /usr/powerpc-linux-gnu" \ - CC=powerpc-linux-gnu-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile deleted file mode 100644 index ab40789..0000000 --- a/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \ - qemu-system-ppc - -ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \ - CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -L /usr/powerpc64-linux-gnu" \ - CC=powerpc64-linux-gnu-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile deleted file mode 100644 index 4dcd632..0000000 --- a/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc libc6-dev qemu-user ca-certificates \ - gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \ - qemu-system-ppc - -ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \ - CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" \ - CC=powerpc64le-linux-gnu-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile deleted file mode 100644 index 75c11c1..0000000 --- a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl ca-certificates \ - gcc libc6-dev \ - gcc-s390x-linux-gnu libc6-dev-s390x-cross \ - qemu-system-s390x \ - cpio - -COPY linux-s390x.sh / -RUN bash /linux-s390x.sh - -COPY test-runner-linux / - -ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \ - CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \ - CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile deleted file mode 100644 index d1f4503..0000000 --- a/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl ca-certificates \ - gcc libc6-dev \ - gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \ - qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \ - p7zip-full cpio linux-libc-dev-sparc64-cross - -COPY linux-sparc64.sh / -RUN bash /linux-sparc64.sh - -COPY test-runner-linux / - -ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \ - CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \ - CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \ - PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile b/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile deleted file mode 100644 index 4de9e74..0000000 --- a/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - g++ \ - make \ - file \ - curl \ - gcc \ - git \ - libc6-dev \ - libxml2 \ - python \ - cmake \ - sudo \ - gdb \ - xz-utils - -COPY emscripten.sh / -RUN bash /emscripten.sh - -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node-wrapper.sh - -COPY emscripten-entry.sh / -COPY docker/wasm32-unknown-emscripten/node-wrapper.sh /usr/local/bin/node-wrapper.sh -ENTRYPOINT ["/emscripten-entry.sh"] diff --git a/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh b/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh deleted file mode 100755 index 3122e2e..0000000 --- a/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -me=$1 -shift -dir=$(dirname $me) -file=$(basename $me) - -if echo $file | grep -q wasm; then - exit 0 # FIXME(rust-lang/cargo#4750) -fi - -cd $dir -exec node $file "$@" diff --git a/libc/ci/docker/wasm32-wasi/Dockerfile b/libc/ci/docker/wasm32-wasi/Dockerfile deleted file mode 100644 index eb3b5ff..0000000 --- a/libc/ci/docker/wasm32-wasi/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -# In the first container we want to assemble the `wasi-sysroot` by compiling it -# from source. This requires a clang 8.0+ compiler with enough wasm support and -# then we're just running a standard `make` inside of what we clone. -FROM ubuntu:18.04 as wasi-sysroot - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - clang \ - cmake \ - curl \ - g++ \ - git \ - libc6-dev \ - libclang-dev \ - make \ - ssh \ - xz-utils - -# Fetch clang 8.0+ which is used to compile the wasi target and link our -# programs together. -RUN curl http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf - -RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc - -# Note that we're using `git reset --hard` to pin to a specific commit for -# verification for now. The sysroot is currently in somewhat of a state of flux -# and is expected to have breaking changes, so this is an attempt to mitigate -# those breaking changes on `libc`'s own CI -RUN git clone https://github.com/CraneStation/wasi-sysroot && \ - cd wasi-sysroot && \ - git reset --hard eee6ee7566e26f2535eb6088c8494a112ff423b9 -RUN make -C wasi-sysroot install -j $(nproc) WASM_CC=/wasmcc/bin/clang INSTALL_DIR=/wasi-sysroot - -# This is a small wrapper script which executes the actual clang binary in -# `/wasmcc` and then is sure to pass the right `--sysroot` argument which we -# just built above. -COPY docker/wasm32-wasi/clang.sh /wasi-sysroot/bin/clang - -# In the second container we're going to build the `wasmtime` binary which is -# used to execute wasi executables. This is a standard Rust project so we're -# just checking out a known revision (which pairs with the sysroot one we -# downlaoded above) and then we're building it with Cargo -FROM ubuntu:18.04 as wasmtime - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - clang \ - cmake \ - curl \ - g++ \ - git \ - libclang-dev \ - make \ - ssh - -RUN curl -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH=/root/.cargo/bin:$PATH - -RUN apt-get install -y --no-install-recommends python -RUN git clone --recursive https://github.com/CraneStation/wasmtime wasmtime && \ - cd wasmtime && \ - git reset --hard a2647878977726935c3d04c05cabad9607ec7606 -RUN cargo build --release --manifest-path wasmtime/Cargo.toml - -# And finally in the last image we're going to assemble everything together. -# We'll install things needed at runtime for now and then copy over the -# sysroot/wasmtime artifacts into their final location. -FROM ubuntu:18.04 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - gcc \ - libc6-dev \ - libxml2 \ - ca-certificates - -# Copy over clang we downloaded to link executables ... -COPY --from=wasi-sysroot /wasmcc /wasmcc/ -# ... and the sysroot we built to link executables against ... -COPY --from=wasi-sysroot /wasi-sysroot/ /wasi-sysroot/ -# ... and finally wasmtime to actually execute binaries -COPY --from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/ - -# Of note here is our clang wrapper which just executes a normal clang -# executable with the right sysroot, and then we're sure to turn off the -# crt-static feature to ensure that the CRT that we're specifying with `clang` -# is used. -ENV CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime \ - CARGO_TARGET_WASM32_WASI_LINKER=/wasi-sysroot/bin/clang \ - CC_wasm32_wasi=/wasi-sysroot/bin/clang \ - PATH=$PATH:/rust/bin \ - RUSTFLAGS=-Ctarget-feature=-crt-static diff --git a/libc/ci/docker/wasm32-wasi/clang.sh b/libc/ci/docker/wasm32-wasi/clang.sh deleted file mode 100755 index 6f29812..0000000 --- a/libc/ci/docker/wasm32-wasi/clang.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -exec /wasmcc/bin/clang --target=wasm32-wasi --sysroot /wasi-sysroot "$@" diff --git a/libc/ci/docker/x86_64-linux-android/Dockerfile b/libc/ci/docker/x86_64-linux-android/Dockerfile deleted file mode 100644 index b0984c0..0000000 --- a/libc/ci/docker/x86_64-linux-android/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - gcc \ - libc-dev \ - python \ - unzip - -WORKDIR /android/ -ENV ANDROID_ARCH=x86_64 -COPY android-install-ndk.sh /android/ -RUN sh /android/android-install-ndk.sh $ANDROID_ARCH - -# We do not run x86_64-linux-android tests on an android emulator. -# See ci/android-sysimage.sh for informations about how tests are run. -COPY android-sysimage.sh /android/ -RUN bash /android/android-sysimage.sh x86_64 x86_64-24_r07.zip - -ENV PATH=$PATH:/rust/bin:/android/ndk-$ANDROID_ARCH/bin \ - CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc \ - CC_x86_64_linux_android=x86_64-linux-android-gcc \ - CXX_x86_64_linux_android=x86_64-linux-android-g++ \ - HOME=/tmp diff --git a/libc/ci/docker/x86_64-rumprun-netbsd/Dockerfile b/libc/ci/docker/x86_64-rumprun-netbsd/Dockerfile deleted file mode 100644 index a486d05..0000000 --- a/libc/ci/docker/x86_64-rumprun-netbsd/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM mato/rumprun-toolchain-hw-x86_64 -USER root -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - qemu -ENV PATH=$PATH:/rust/bin \ - CARGO_TARGET_X86_64_RUMPRUN_NETBSD_RUNNER=/tmp/runtest - -ADD docker/x86_64-rumprun-netbsd/runtest.rs /tmp/ -ENTRYPOINT ["sh", "-c", "rustc /tmp/runtest.rs -o /tmp/runtest && exec \"$@\"", "--"] diff --git a/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs b/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs deleted file mode 100644 index 7e96fbf..0000000 --- a/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs +++ /dev/null @@ -1,55 +0,0 @@ -use std::env; -use std::process::{Command, Stdio}; -use std::sync::mpsc; -use std::thread; -use std::time::Duration; -use std::io::{BufRead, BufReader, Read}; - -fn main() { - assert_eq!(env::args().len(), 2); - - let status = Command::new("rumprun-bake") - .arg("hw_virtio") - .arg("/tmp/libc-test.img") - .arg(env::args().nth(1).unwrap()) - .status() - .expect("failed to run rumprun-bake"); - assert!(status.success()); - - let mut child = Command::new("qemu-system-x86_64") - .arg("-nographic") - .arg("-vga").arg("none") - .arg("-m").arg("64") - .arg("-kernel").arg("/tmp/libc-test.img") - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .expect("failed to spawn qemu"); - - let mut stdout = child.stdout.take().unwrap(); - let mut stderr = child.stderr.take().unwrap(); - let (tx, rx) = mpsc::channel(); - let tx2 = tx.clone(); - let t1 = thread::spawn(move || find_ok(&mut stdout, tx)); - let t2 = thread::spawn(move || find_ok(&mut stderr, tx2)); - - let res = rx.recv_timeout(Duration::new(5, 0)); - child.kill().unwrap(); - t1.join().unwrap(); - t2.join().unwrap(); - - if res.is_err() { - panic!("didn't find success"); - } -} - -fn find_ok(input: &mut Read, tx: mpsc::Sender<()>) { - for line in BufReader::new(input).lines() { - let line = line.unwrap(); - println!("{}", line); - if (line.starts_with("PASSED ") && line.contains(" tests")) || - line.starts_with("test result: ok"){ - tx.send(()).unwrap(); - } - } -} diff --git a/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile deleted file mode 100644 index bfa2b17..0000000 --- a/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ubuntu:19.04 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc libc6-dev ca-certificates linux-headers-generic - -RUN apt search linux-headers -RUN ls /usr/src - -ENV PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile deleted file mode 100644 index 5563a7b..0000000 --- a/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:19.04 -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc-multilib libc6-dev ca-certificates -ENV PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile deleted file mode 100644 index 06a081b..0000000 --- a/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:19.04 - -RUN apt-get update -RUN apt-get install -y --no-install-recommends \ - gcc make libc6-dev git curl ca-certificates - -COPY install-musl.sh / -RUN sh /install-musl.sh x86_64 - -ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin diff --git a/libc/ci/dox.sh b/libc/ci/dox.sh deleted file mode 100644 index 271b54b..0000000 --- a/libc/ci/dox.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env sh - -# Builds documentation for all target triples that we have a registered URL for -# in liblibc. This scrapes the list of triples to document from `src/lib.rs` -# which has a bunch of `html_root_url` directives we pick up. - -set -ex - -TARGET_DOC_DIR=target/doc -README=README.md -PLATFORM_SUPPORT=platform-support.md - -rm -rf $TARGET_DOC_DIR -mkdir -p $TARGET_DOC_DIR - -if ! rustc --version | grep -E "nightly" ; then - echo "Building the documentation requires a nightly Rust toolchain" - exit 1 -fi - -rustup component add rust-src -cargo +nightly install cargo-xbuild - -# List all targets that do currently build successfully: -# shellcheck disable=SC1003 -grep '[\d|\w|-]* \\' ci/build.sh > targets -sed -i.bak 's/ \\//g' targets -grep '^[_a-zA-Z0-9-]*$' targets | sort > tmp && mv tmp targets - -# Create a markdown list of supported platforms in $PLATFORM_SUPPORT -rm $PLATFORM_SUPPORT || true - -printf '### Platform-specific documentation\n' >> $PLATFORM_SUPPORT - -while read -r target; do - echo "documenting ${target}" - - case "${target}" in - *apple*) - # FIXME: - # We can't build docs of apple targets from Linux yet. - continue - ;; - *) - ;; - esac - - rustup target add "${target}" || true - - # Enable extra configuration flags: - export RUSTDOCFLAGS="--cfg freebsd11" - - # If cargo doc fails, then try xargo: - if ! cargo doc --target "${target}" \ - --no-default-features --features extra_traits ; then - cargo xdoc --target "${target}" \ - --no-default-features --features extra_traits - fi - - cp -r "target/${target}/doc" "${TARGET_DOC_DIR}/${target}" - - echo "* [${target}](${target}/libc/index.html)" >> $PLATFORM_SUPPORT -done < targets - -# Replace <div class="platform_support"></div> with the contents of $PLATFORM_SUPPORT -cp $README $TARGET_DOC_DIR -line=$(grep -n '<div class="platform_docs"></div>' $README | cut -d ":" -f 1) - -set +x -{ head -n "$((line-1))" $README; cat $PLATFORM_SUPPORT; tail -n "+$((line+1))" $README; } > $TARGET_DOC_DIR/$README -set -x - -# Copy the licenses -cp LICENSE-* $TARGET_DOC_DIR/ diff --git a/libc/ci/emscripten-entry.sh b/libc/ci/emscripten-entry.sh deleted file mode 100755 index 0016f56..0000000 --- a/libc/ci/emscripten-entry.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -set -ex - -# shellcheck disable=SC1091 -source /emsdk-portable/emsdk_env.sh &> /dev/null - -# emsdk-portable provides a node binary, but we need version 8 to run wasm -export PATH="/node-v12.3.1-linux-x64/bin:$PATH" - -exec "$@" diff --git a/libc/ci/emscripten.sh b/libc/ci/emscripten.sh deleted file mode 100644 index acec4ca..0000000 --- a/libc/ci/emscripten.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 The Rust Project Developers. See the COPYRIGHT -# file at the top-level directory of this distribution and at -# http://rust-lang.org/COPYRIGHT. -# -# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -# option. This file may not be copied, modified, or distributed -# except according to those terms. - -set -ex - -hide_output() { - set +x - on_err=" -echo ERROR: An error was encountered with the build. -cat /tmp/build.log -exit 1 -" - trap '$on_err' ERR - bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & - PING_LOOP_PID=$! - "${@}" &> /tmp/build.log - trap - ERR - kill $PING_LOOP_PID - rm -f /tmp/build.log - set -x -} - -git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable -cd /emsdk-portable -# TODO: switch to an upstream install once -# https://github.com/rust-lang/rust/pull/63649 lands -hide_output ./emsdk install 1.38.42 -./emsdk activate 1.38.42 - -# Compile and cache libc -# shellcheck disable=SC1091 -source ./emsdk_env.sh -echo "main(){}" > a.c -HOME=/emsdk-portable/ emcc a.c -rm -f a.* - -# Make emsdk usable by any user -cp /root/.emscripten /emsdk-portable -chmod a+rxw -R /emsdk-portable - -# node 8 is required to run wasm -cd / -curl --retry 5 -L https://nodejs.org/dist/v12.3.1/node-v12.3.1-linux-x64.tar.xz | \ - tar -xJ diff --git a/libc/ci/install-musl.sh b/libc/ci/install-musl.sh deleted file mode 100644 index 88cb4f0..0000000 --- a/libc/ci/install-musl.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env sh -# -# Install musl and musl-sanitized linux kernel headers -# to musl-{$1} directory - -set -ex - -MUSL_VERSION=1.1.24 -MUSL="musl-${MUSL_VERSION}" - -# Download, configure, build, and install musl: -curl --retry 5 https://www.musl-libc.org/releases/${MUSL}.tar.gz | tar xzf - - -cd $MUSL -case ${1} in - aarch64) - musl_arch=aarch64 - kernel_arch=arm64 - CC=aarch64-linux-gnu-gcc \ - ./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes - make install -j4 - ;; - arm) - musl_arch=arm - kernel_arch=arm - CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv6 -marm -mfpu=vfp" \ - ./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes - make install -j4 - ;; - i686) - # cross-compile musl for i686 using the system compiler on an x86_64 - # system. - musl_arch=i686 - kernel_arch=i386 - # Specifically pass -m32 in CFLAGS and override CC when running - # ./configure, since otherwise the script will fail to find a compiler. - CC=gcc CFLAGS="-m32" \ - ./configure --prefix="/musl-${musl_arch}" --disable-shared --target=i686 - # unset CROSS_COMPILE when running make; otherwise the makefile will - # call the non-existent binary 'i686-ar'. - make CROSS_COMPILE= install -j4 - ;; - x86_64) - musl_arch=x86_64 - kernel_arch=x86_64 - ./configure --prefix="/musl-${musl_arch}" - make install -j4 - ;; - mips64) - musl_arch=mips64 - kernel_arch=mips - CC=mips64-linux-gnuabi64-gcc CFLAGS="-march=mips64r2 -mabi=64" \ - ./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes - make install -j4 - ;; - mips64el) - musl_arch=mips64el - kernel_arch=mips - CC=mips64el-linux-gnuabi64-gcc CFLAGS="-march=mips64r2 -mabi=64" \ - ./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes - make install -j4 - ;; - *) - echo "Unknown target arch: \"${1}\"" - exit 1 - ;; -esac - - -# shellcheck disable=SC2103 -cd .. -rm -rf $MUSL - -# Download, configure, build, and install musl-sanitized kernel headers: -KERNEL_HEADER_VER="4.4.2-2" -curl --retry 5 -L \ - "https://github.com/sabotage-linux/kernel-headers/archive/v${KERNEL_HEADER_VER}.tar.gz" | \ - tar xzf - -( - cd kernel-headers-${KERNEL_HEADER_VER} - make ARCH="${kernel_arch}" prefix="/musl-${musl_arch}" install -j4 -) -rm -rf kernel-headers-${KERNEL_HEADER_VER} diff --git a/libc/ci/ios/deploy_and_run_on_ios_simulator.rs b/libc/ci/ios/deploy_and_run_on_ios_simulator.rs deleted file mode 100644 index 2075be6..0000000 --- a/libc/ci/ios/deploy_and_run_on_ios_simulator.rs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// This is a script to deploy and execute a binary on an iOS simulator. -// The primary use of this is to be able to run unit tests on the simulator and -// retrieve the results. -// -// To do this through Cargo instead, use Dinghy -// (https://github.com/snipsco/dinghy): cargo dinghy install, then cargo dinghy -// test. - -use std::env; -use std::fs::{self, File}; -use std::io::Write; -use std::path::Path; -use std::process; -use std::process::Command; - -macro_rules! t { - ($e:expr) => (match $e { - Ok(e) => e, - Err(e) => panic!("{} failed with: {}", stringify!($e), e), - }) -} - -// Step one: Wrap as an app -fn package_as_simulator_app(crate_name: &str, test_binary_path: &Path) { - println!("Packaging simulator app"); - drop(fs::remove_dir_all("ios_simulator_app")); - t!(fs::create_dir("ios_simulator_app")); - t!(fs::copy(test_binary_path, - Path::new("ios_simulator_app").join(crate_name))); - - let mut f = t!(File::create("ios_simulator_app/Info.plist")); - t!(f.write_all(format!(r#" - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE plist PUBLIC - "-//Apple//DTD PLIST 1.0//EN" - "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> - <plist version="1.0"> - <dict> - <key>CFBundleExecutable</key> - <string>{}</string> - <key>CFBundleIdentifier</key> - <string>com.rust.unittests</string> - </dict> - </plist> - "#, crate_name).as_bytes())); -} - -// Step two: Start the iOS simulator -fn start_simulator() { - println!("Looking for iOS simulator"); - let output = t!(Command::new("xcrun").arg("simctl").arg("list").output()); - assert!(output.status.success()); - let mut simulator_exists = false; - let mut simulator_booted = false; - let mut found_rust_sim = false; - let stdout = t!(String::from_utf8(output.stdout)); - for line in stdout.lines() { - if line.contains("rust_ios") { - if found_rust_sim { - panic!("Duplicate rust_ios simulators found. Please \ - double-check xcrun simctl list."); - } - simulator_exists = true; - simulator_booted = line.contains("(Booted)"); - found_rust_sim = true; - } - } - - if simulator_exists == false { - println!("Creating iOS simulator"); - Command::new("xcrun") - .arg("simctl") - .arg("create") - .arg("rust_ios") - .arg("com.apple.CoreSimulator.SimDeviceType.iPhone-SE") - .arg("com.apple.CoreSimulator.SimRuntime.iOS-10-2") - .check_status(); - } else if simulator_booted == true { - println!("Shutting down already-booted simulator"); - Command::new("xcrun") - .arg("simctl") - .arg("shutdown") - .arg("rust_ios") - .check_status(); - } - - println!("Starting iOS simulator"); - // We can't uninstall the app (if present) as that will hang if the - // simulator isn't completely booted; just erase the simulator instead. - Command::new("xcrun").arg("simctl").arg("erase").arg("rust_ios").check_status(); - Command::new("xcrun").arg("simctl").arg("boot").arg("rust_ios").check_status(); -} - -// Step three: Install the app -fn install_app_to_simulator() { - println!("Installing app to simulator"); - Command::new("xcrun") - .arg("simctl") - .arg("install") - .arg("booted") - .arg("ios_simulator_app/") - .check_status(); -} - -// Step four: Run the app -fn run_app_on_simulator() { - println!("Running app"); - let output = t!(Command::new("xcrun") - .arg("simctl") - .arg("launch") - .arg("--console") - .arg("booted") - .arg("com.rust.unittests") - .output()); - - println!("status: {}", output.status); - println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout)); - println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr)); - - let stdout = String::from_utf8_lossy(&output.stdout); - let passed = stdout.lines() - .find(|l| - (l.contains("PASSED") && - l.contains("tests")) || - l.contains("test result: ok") - ) - .unwrap_or(false); - - println!("Shutting down simulator"); - Command::new("xcrun") - .arg("simctl") - .arg("shutdown") - .arg("rust_ios") - .check_status(); - if !passed { - panic!("tests didn't pass"); - } -} - -trait CheckStatus { - fn check_status(&mut self); -} - -impl CheckStatus for Command { - fn check_status(&mut self) { - println!("\trunning: {:?}", self); - assert!(t!(self.status()).success()); - } -} - -fn main() { - let args: Vec<String> = env::args().collect(); - if args.len() != 2 { - println!("Usage: {} <executable>", args[0]); - process::exit(-1); - } - - let test_binary_path = Path::new(&args[1]); - let crate_name = test_binary_path.file_name().unwrap(); - - package_as_simulator_app(crate_name.to_str().unwrap(), test_binary_path); - start_simulator(); - install_app_to_simulator(); - run_app_on_simulator(); -} diff --git a/libc/ci/linux-s390x.sh b/libc/ci/linux-s390x.sh deleted file mode 100644 index 00a7f88..0000000 --- a/libc/ci/linux-s390x.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -set -ex - -mkdir -m 777 /qemu -cd /qemu - -curl --retry 5 -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img -curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20190410/images/generic/kernel.debian -curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20190410/images/generic/initrd.debian - -mv kernel.debian kernel -mv initrd.debian initrd.gz - -mkdir init -cd init -gunzip -c ../initrd.gz | cpio -id -rm ../initrd.gz -cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/ -chmod a+w . diff --git a/libc/ci/linux-sparc64.sh b/libc/ci/linux-sparc64.sh deleted file mode 100644 index 5580a0e..0000000 --- a/libc/ci/linux-sparc64.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env sh - -set -ex - -mkdir -m 777 /qemu -cd /qemu - -curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/10.0/sparc64/iso-cd/debian-10.0-sparc64-NETINST-1.iso -7z e debian-10.0-sparc64-NETINST-1.iso boot/initrd.gz -7z e debian-10.0-sparc64-NETINST-1.iso boot/sparc64 -mv sparc64 kernel -rm debian-10.0-sparc64-NETINST-1.iso - -mkdir init -cd init -gunzip -c ../initrd.gz | cpio -id -rm ../initrd.gz -cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/ -chmod a+w . diff --git a/libc/ci/run-docker.sh b/libc/ci/run-docker.sh deleted file mode 100755 index 3c0736a..0000000 --- a/libc/ci/run-docker.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env sh - -# Small script to run tests for a target (or all targets) inside all the -# respective docker images. - -set -ex - -echo "${HOME}" -pwd - -run() { - echo "Building docker container for target ${1}" - - # use -f so we can use ci/ as build context - docker build -t libc -f "ci/docker/${1}/Dockerfile" ci/ - mkdir -p target - if [ -w /dev/kvm ]; then - kvm="--volume /dev/kvm:/dev/kvm" - else - kvm="" - fi - - docker run \ - --rm \ - --user "$(id -u)":"$(id -g)" \ - --env LIBC_CI \ - --env CARGO_HOME=/cargo \ - --env CARGO_TARGET_DIR=/checkout/target \ - --volume "$(dirname "$(dirname "$(command -v cargo)")")":/cargo \ - --volume "$(rustc --print sysroot)":/rust:ro \ - --volume "$(pwd)":/checkout:ro \ - --volume "$(pwd)"/target:/checkout/target \ - $kvm \ - --init \ - --workdir /checkout \ - libc \ - sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh ${1}" -} - -if [ -z "${1}" ]; then - for d in ci/docker/*; do - run "${d}" - done -else - run "${1}" -fi diff --git a/libc/ci/run-qemu.sh b/libc/ci/run-qemu.sh deleted file mode 100644 index 6fba629..0000000 --- a/libc/ci/run-qemu.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env sh - -# Initial script which is run inside of all qemu images. The first argument to -# this script (as arranged by the qemu image itself) is the path to where the -# libc crate is mounted. -# -# For qemu images we currently need to install Rust manually as this wasn't done -# by the initial run-travis.sh script -# -# FIXME: feels like run-travis.sh should be responsible for downloading the -# compiler. - -set -ex - -ROOT="${1}" -cp -r "${ROOT}/libc" /tmp/libc -cd /tmp/libc - -TARGET="$(cat "${ROOT}/TARGET")" -export CARGO_TARGET_DIR=/tmp - -case $TARGET in - *-openbsd) - pkg_add cargo gcc%4.9 rust - export CC=egcc - ;; - - *) - echo "Unknown target: ${TARGET}" - exit 1 - ;; -esac - -exec sh ci/run.sh "${TARGET}" diff --git a/libc/ci/run.sh b/libc/ci/run.sh deleted file mode 100755 index b435122..0000000 --- a/libc/ci/run.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env sh - -# Builds and runs tests for a particular target passed as an argument to this -# script. - -set -ex - -MIRRORS_URL="https://ci-mirrors.rust-lang.org/libc" - -TARGET="${1}" - -# If we're going to run tests inside of a qemu image, then we don't need any of -# the scripts below. Instead, download the image, prepare a filesystem which has -# the current state of this repository, and then run the image. -# -# It's assume that all images, when run with two disks, will run the `run.sh` -# script from the second which we place inside. -if [ "$QEMU" != "" ]; then - tmpdir=/tmp/qemu-img-creation - mkdir -p "${tmpdir}" - - if [ -z "${QEMU#*.gz}" ]; then - # image is .gz : download and uncompress it - qemufile="$(echo "${QEMU%.gz}" | sed 's/\//__/g')" - if [ ! -f "${tmpdir}/${qemufile}" ]; then - curl --retry 5 "${MIRRORS_URL}/${QEMU}" | \ - gunzip -d > "${tmpdir}/${qemufile}" - fi - elif [ -z "${QEMU#*.xz}" ]; then - # image is .xz : download and uncompress it - qemufile="$(echo "${QEMU%.xz}" | sed 's/\//__/g')" - if [ ! -f "${tmpdir}/${qemufile}" ]; then - curl --retry 5 "${MIRRORS_URL}/${QEMU}" | \ - unxz > "${tmpdir}/${qemufile}" - fi - else - # plain qcow2 image: just download it - qemufile="$(echo "${QEMU}" | sed 's/\//__/g')" - if [ ! -f "${tmpdir}/${qemufile}" ]; then - curl --retry 5 "${MIRRORS_URL}/${QEMU}" | \ - > "${tmpdir}/${qemufile}" - fi - fi - - # Create a mount a fresh new filesystem image that we'll later pass to QEMU. - # This will have a `run.sh` script will which use the artifacts inside to run - # on the host. - rm -f "${tmpdir}/libc-test.img" - mkdir "${tmpdir}/mount" - - # Do the standard rigamarole of cross-compiling an executable and then the - # script to run just executes the binary. - cargo build \ - --manifest-path libc-test/Cargo.toml \ - --target "${TARGET}" \ - --test main - rm "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-*.d - cp "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-* "${tmpdir}"/mount/libc-test - # shellcheck disable=SC2016 - echo 'exec $1/libc-test' > "${tmpdir}/mount/run.sh" - - du -sh "${tmpdir}/mount" - genext2fs \ - --root "${tmpdir}/mount" \ - --size-in-blocks 100000 \ - "${tmpdir}/libc-test.img" - - # Pass -snapshot to prevent tampering with the disk images, this helps when - # running this script in development. The two drives are then passed next, - # first is the OS and second is the one we just made. Next the network is - # configured to work (I'm not entirely sure how), and then finally we turn off - # graphics and redirect the serial console output to out.log. - qemu-system-x86_64 \ - -m 1024 \ - -snapshot \ - -drive if=virtio,file="${tmpdir}/${qemufile}" \ - -drive if=virtio,file="${tmpdir}/libc-test.img" \ - -net nic,model=virtio \ - -net user \ - -nographic \ - -vga none 2>&1 | tee "${CARGO_TARGET_DIR}/out.log" - exec egrep "^(PASSED)|(test result: ok)" "${CARGO_TARGET_DIR}/out.log" -fi - -# FIXME: x86_64-unknown-linux-gnux32 fail to compile without --release -# See https://github.com/rust-lang/rust/issues/45417 -opt= -if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then - opt="--release" -fi - -cargo test -vv $opt --no-default-features --manifest-path libc-test/Cargo.toml \ - --target "${TARGET}" - -cargo test -vv $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}" - -cargo test -vv $opt --features extra_traits --manifest-path libc-test/Cargo.toml \ - --target "${TARGET}" diff --git a/libc/ci/runtest-android.rs b/libc/ci/runtest-android.rs deleted file mode 100644 index b8030c4..0000000 --- a/libc/ci/runtest-android.rs +++ /dev/null @@ -1,47 +0,0 @@ -use std::env; -use std::process::Command; -use std::path::{Path, PathBuf}; - -fn main() { - let args = env::args_os() - .skip(1) - .filter(|arg| arg != "--quiet") - .collect::<Vec<_>>(); - assert_eq!(args.len(), 1); - let test = PathBuf::from(&args[0]); - let dst = Path::new("/data/local/tmp").join(test.file_name().unwrap()); - - let status = Command::new("adb") - .arg("wait-for-device") - .status() - .expect("failed to run: adb wait-for-device"); - assert!(status.success()); - - let status = Command::new("adb") - .arg("push") - .arg(&test) - .arg(&dst) - .status() - .expect("failed to run: adb pushr"); - assert!(status.success()); - - let output = Command::new("adb") - .arg("shell") - .arg(&dst) - .output() - .expect("failed to run: adb shell"); - assert!(status.success()); - - println!("status: {}\nstdout ---\n{}\nstderr ---\n{}", - output.status, - String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr)); - - let stdout = String::from_utf8_lossy(&output.stdout); - stdout.lines().find(|l| - (l.starts_with("PASSED ") && l.contains(" tests")) || - l.starts_with("test result: ok") - ).unwrap_or_else(|| { - panic!("failed to find successful test run"); - }); -} diff --git a/libc/ci/semver.sh b/libc/ci/semver.sh deleted file mode 100644 index 7e6ea66..0000000 --- a/libc/ci/semver.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env sh - -# Checks that libc does not contain breaking changes for the following targets. - -set -ex - -OS=${1} - -echo "Testing Semver on ${OS}" - -if ! rustc --version | grep -E "nightly" ; then - echo "Building semverver requires a nightly Rust toolchain" - exit 1 -fi - -cargo +nightly install semverver - -TARGETS= -case "${OS}" in - *linux*) - TARGETS="\ -aarch64-fuchsia \ -aarch64-linux-android \ -aarch64-unknown-linux-gnu \ -aarch64-unknown-linux-musl \ -armv7-linux-androideabi \ -armv7-unknown-linux-gnueabihf \ -i586-unknown-linux-gnu \ -i586-unknown-linux-musl \ -i686-linux-android \ -i686-unknown-freebsd \ -i686-unknown-linux-gnu \ -i686-unknown-linux-musl \ -i686-pc-windows-gnu \ -x86_64-unknown-freebsd \ -x86_64-unknown-linux-gnu \ -x86_64-unknown-linux-musl \ -x86_64-unknown-netbsd \ -x86_64-unknown-cloudabi \ -x86_64-sun-solaris \ -x86_64-fuchsia \ -x86_64-pc-windows-gnu \ -x86_64-unknown-linux-gnux32 \ -x86_64-unknown-redox \ -x86_64-fortanix-unknown-sgx \ -wasm32-unknown-unknown \ -" - ;; - *osx*) - TARGETS="\ -aarch64-apple-ios \ -armv7-apple-ios \ -armv7s-apple-ios \ -i386-apple-ios \ -i686-apple-darwin \ -x86_64-apple-darwin \ -x86_64-apple-ios \ -" - ;; -esac - -for TARGET in $TARGETS; do - # FIXME: rustup often fails to download some artifacts due to network - # issues, so we retry this N times. - N=5 - n=0 - until [ $n -ge $N ] - do - if rustup target add "${TARGET}" ; then - break - fi - n=$((n+1)) - sleep 1 - done - - cargo +nightly semver --api-guidelines --target="${TARGET}" -done diff --git a/libc/ci/style.rs b/libc/ci/style.rs deleted file mode 100644 index dcb3536..0000000 --- a/libc/ci/style.rs +++ /dev/null @@ -1,208 +0,0 @@ -//! Simple script to verify the coding style of this library -//! -//! ## How to run -//! -//! The first argument to this script is the directory to run on, so running -//! this script should be as simple as: -//! -//! ```notrust -//! rustc ci/style.rs -//! ./style src -//! ``` -//! -//! ## Guidelines -//! -//! The current style is: -//! -//! * No trailing whitespace -//! * No tabs -//! * 80-character lines -//! * Specific module layout: -//! 1. use directives -//! 2. typedefs -//! 3. structs -//! 4. constants -//! 5. f! { ... } functions -//! 6. extern functions -//! 7. modules + pub use -//! -//! Things not verified: -//! -//! * alignment -//! * 4-space tabs -//! * leading colons on paths - -use std::env; -use std::fs; -use std::io::prelude::*; -use std::path::Path; - -macro_rules! t { - ($e:expr) => (match $e { - Ok(e) => e, - Err(e) => panic!("{} failed with {}", stringify!($e), e), - }) -} - -fn main() { - let arg = env::args().skip(1).next().unwrap_or(".".to_string()); - - let mut errors = Errors { errs: false }; - walk(Path::new(&arg), &mut errors); - - if errors.errs { - panic!("found some lint errors"); - } else { - println!("good style!"); - } -} - -fn walk(path: &Path, err: &mut Errors) { - for entry in t!(path.read_dir()).map(|e| t!(e)) { - let path = entry.path(); - if t!(entry.file_type()).is_dir() { - walk(&path, err); - continue - } - - let name = entry.file_name().into_string().unwrap(); - match &name[..] { - n if !n.ends_with(".rs") => continue, - - "dox.rs" | - "lib.rs" | - "ctypes.rs" | - "libc.rs" | - "macros.rs" => continue, - - _ => {} - } - - let mut contents = String::new(); - t!(t!(fs::File::open(&path)).read_to_string(&mut contents)); - - check_style(&contents, &path, err); - } -} - -struct Errors { - errs: bool, -} - -#[derive(Clone, Copy, PartialEq)] -enum State { - Start, - Imports, - Typedefs, - Structs, - Constants, - FunctionDefinitions, - Functions, - Modules, -} - -fn check_style(file: &str, path: &Path, err: &mut Errors) { - let mut state = State::Start; - let mut s_macros = 0; - let mut f_macros = 0; - let mut prev_blank = false; - - for (i, line) in file.lines().enumerate() { - if line == "" { - if prev_blank { - err.error(path, i, "double blank line"); - } - prev_blank = true; - } else { - prev_blank = false; - } - if line != line.trim_end() { - err.error(path, i, "trailing whitespace"); - } - if line.contains("\t") { - err.error(path, i, "tab character"); - } - if line.len() > 80 { - err.error(path, i, "line longer than 80 chars"); - } - if line.contains("#[cfg(") && !line.contains(" if ") - && !(line.contains("target_endian") || - line.contains("target_arch")) - { - if state != State::Structs { - err.error(path, i, "use cfg_if! and submodules \ - instead of #[cfg]"); - } - } - - let line = line.trim_start(); - let is_pub = line.starts_with("pub "); - let line = if is_pub {&line[4..]} else {line}; - - let line_state = if line.starts_with("use ") { - if line.contains("c_void") { - continue; - } - if is_pub { - State::Modules - } else { - State::Imports - } - } else if line.starts_with("const ") { - State::Constants - } else if line.starts_with("type ") { - State::Typedefs - } else if line.starts_with("s! {") { - s_macros += 1; - State::Structs - } else if line.starts_with("f! {") { - f_macros += 1; - State::FunctionDefinitions - } else if line.starts_with("extern ") { - State::Functions - } else if line.starts_with("mod ") { - State::Modules - } else { - continue - }; - - if state as usize > line_state as usize { - err.error(path, i, &format!("{} found after {} when \ - it belongs before", - line_state.desc(), state.desc())); - } - - if f_macros == 2 { - f_macros += 1; - err.error(path, i, "multiple f! macros in one module"); - } - if s_macros == 2 { - s_macros += 1; - err.error(path, i, "multiple s! macros in one module"); - } - - state = line_state; - } -} - -impl State { - fn desc(&self) -> &str { - match *self { - State::Start => "start", - State::Imports => "import", - State::Typedefs => "typedef", - State::Structs => "struct", - State::Constants => "constant", - State::FunctionDefinitions => "function definition", - State::Functions => "extern function", - State::Modules => "module", - } - } -} - -impl Errors { - fn error(&mut self, path: &Path, line: usize, msg: &str) { - self.errs = true; - println!("{}:{} - {}", path.display(), line + 1, msg); - } -} diff --git a/libc/ci/style.sh b/libc/ci/style.sh deleted file mode 100644 index a6a0017..0000000 --- a/libc/ci/style.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env sh - -set -ex - -rustc ci/style.rs && ./style src - -if rustup component add rustfmt-preview ; then - which rustfmt - rustfmt -V - cargo fmt --all -- --check -fi - -if shellcheck --version ; then - shellcheck -e SC2103 ci/*.sh -else - echo "shellcheck not found" - exit 1 -fi - diff --git a/libc/ci/switch.json b/libc/ci/switch.json deleted file mode 100644 index bc18948..0000000 --- a/libc/ci/switch.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "family": "unix", - "env": "newlib", - "target-env": "newlib", - "target-family": "unix", - "target-c-int-width": "32", - "target-endian": "little", - "target-pointer-width": "64", - "os": "horizon", - "arch": "aarch64", - "panic-strategy": "unwind", - "abi-blacklist": [ - "stdcall", - "fastcall", - "vectorcall", - "thiscall", - "win64", - "sysv64" - ], - "dynamic-linking" : false, - "features": "+a53,+strict-align", - "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", - "executables": true, - "position-independent-executables" : true, - "linker-flavor": "gcc", - "llvm-target": "aarch64-unknown-none", - "has-elf-tls" : false, - "linker-is-gnu" : true, - "disable-redzone" : true, - "relocation-model" : "pic", - "max-atomic-width": 128, - "exe-suffix": ".elf", - "staticlib-suffix" : ".a", - "trap-unreachable" : true, - "emit-debug-gdb-scripts" : true, - "requires-uwtable" : true -}
\ No newline at end of file diff --git a/libc/ci/sysinfo_guard.patch b/libc/ci/sysinfo_guard.patch deleted file mode 100644 index 69fb795..0000000 --- a/libc/ci/sysinfo_guard.patch +++ /dev/null @@ -1,10 +0,0 @@ -@@ -2,7 +2,9 @@ - #ifndef _LINUX_KERNEL_H - #define _LINUX_KERNEL_H - -+#ifdef __GLIBC__ - #include <linux/sysinfo.h> -+#endif - - /* - * 'kernel.h' contains some often-used function prototypes etc diff --git a/libc/ci/test-runner-linux b/libc/ci/test-runner-linux deleted file mode 100755 index cad31ec..0000000 --- a/libc/ci/test-runner-linux +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -set -e - -arch=$1 -prog=$2 - -cd /qemu/init -echo "#!/bin/sh\n/prog --color=never" > run_prog.sh -chmod +x run_prog.sh -cp -f $2 prog -find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz -cd .. - -timeout 30s qemu-system-$arch \ - -m 1024 \ - -nographic \ - -kernel kernel \ - -initrd initrd.gz \ - -append init=/run_prog.sh > output || true - -# remove kernel messages -tr -d '\r' < output | egrep -v '^\[' - -egrep "(PASSED)|(test result: ok)" output > /dev/null |