27 Commits

Author SHA1 Message Date
Trevor Gross
fcc7824b88 ci: Update to the latest ubuntu:25.04 Docker images
This includes a qemu update from 8.2.2 to 9.2.1 which should hopefully
fix some bugs we have encountered.

PowerPC64LE is skipped for now because the new version seems to cause a
number of new SIGILLs.
2025-07-24 01:42:53 -05:00
Trevor Gross
46bbc3dd88 ci: Clean up workflow file and docker script 2025-04-20 05:33:19 -04:00
Trevor Gross
8902f740da ci: Skip testing libm in PRs if it did not change
Many contributions to compiler-builtins don't have any need to touch
libm, and could get by with the few minutes of CI for compiler-builtins
rather than the ~30 minutes for libm. We already have some scripts that
handle changed file detection, so expand its use to skip libm CI if it
doesn't need to run.
2025-04-20 04:24:24 -04:00
Trevor Gross
a829d916b5 ci: Add /cargo/bin to the path in Docker
This makes it possible to use nextest within the container.
2025-04-20 04:11:53 -04:00
Trevor Gross
a48de6950c Move builtins-test-intrinsics out of the workspace
This crate doesn't need to be a default member since it requires the
opposite settings from everything else. Exclude it from the workspace
and run it only when explicitly requested.

This also makes `cargo t --no-default-features` work without additional
qualifiers. `--no-default-features` still needs to be passed to ensure
`#![compiler_builtins]` does not get set.

compiler-builtins needs doctests disabled in order for everything to
work correctly, since this causes an error running rustdoc that is
unrelated to features (our `compiler_builtins` is getting into the crate
graph before that from the sysroot, but `#![compiler_builtins]` is not
set).

We can also remove `test = false` and `doctest = false` in
`builtins-test` since these no longer cause issues. This is unlikely to
be used but it is better to not quietly skip if anything ever gets added
by accident.
2025-04-19 22:30:58 -04:00
Trevor Gross
b0d6024f20 ci: Update ci/run-docker.sh to match libm
Prepare for having the repositories combined by ensuring EMULATED,
RUST_BACKTRACE, and CI are set or forwarded as applicable. Also
re-indent the file to four spaces and do some reorganization.
2025-04-19 01:04:33 -04:00
Trevor Gross
683485cda2 Switch repository layout to use a virtual manifest
The current setup has the `Cargo.toml` for `compiler-builtins` at the
repository root, which means all support crates and other files are
located within the package root. This works for now but is not the
cleanest setup since files that should or shouldn't be included in the
package need to be configured in `Cargo.toml`. If we eventually merge
`libm` development into this repository, it would be nice to make this
separation more straightforward.

Begin cleaning things up by moving the crate source to a new
`compiler-builtins` directory and adding a virtual manifest. For now the
`libm` submodule is also moved, but in the future it can likely move
back to the top level (ideally `compiler-builtins/src` would contain a
symlink to `libm/src/math`, but unfortunately it seems like Cargo does
not like something about the submodule + symlink combination).
2025-03-19 00:49:34 -05:00
Trevor Gross
85cd4c0660 Fix some warnings from shellcheck 2024-09-28 21:24:44 -04:00
Trevor Gross
fdec3b6514 Fix unset variables in the build script
These were preventing building via Docker locally.
2024-06-22 16:15:46 +02:00
Trevor Gross
f2092967cb Update the Ubuntu docker image to the latest version 2024-06-22 05:58:25 -04:00
Trevor Gross
98ddf3c66d Enable cache for Docker images 2024-05-24 23:18:59 +02:00
Trevor Gross
ccfe0e3808 Deny warnings in CI
There are currently a lot of warnings printed in CI, mostly dead code.
Update CI to deny warnings.
2024-05-11 09:56:55 +02:00
Trevor Gross
1b679e5cee Apply some more fixes suggested by Shellcheck 2024-04-19 11:49:23 -04:00
Trevor Gross
a55604fd8c Add a way to run tests on non-linux machines
Allow using the `rust-lang/rust:nightly` docker image to run tests in
cases where the host rust and cargo cannot be used, such as non-linux
hosts.
2024-04-19 11:49:23 -04:00
Amanieu d'Antras
c51299d63a Fix run-docker.sh so it can be run locally 2022-02-06 09:20:19 +00:00
Alex Crichton
22030968eb More fixes for CI 2019-06-05 16:19:26 -07:00
Alex Crichton
b84b7143e8 Remove compiler-rt submodule from this repository
This commit removes the `compiler-rt` submodule from this repository.
The goal here is to align the `compiler-rt` used for compiling C
intrinsics with the upstream rust-lang/rust's usage of `llvm-project`.
Currently we have both an `llvm-project` repository as well as
`compiler-rt`, but they can naturally get out of sync and it's just one
more submodule to manage.

The thinking here is that the feature `c` for this crate, when
activated, will require the user to configure where the source code for
`compiler-rt` is present. This places the onus on the builder of
`compiler-builtins` to check-out and arrange for the appropriate
`compiler-rt` source code to be placed somewhere. For rust-lang/rust
this is already done with the `llvm-project` submodule, and we can
arrange for it to happen on this crate's CI anyway.

For users of this crate this is a bit of a bummer, but `c` is disabled
by default anyway and it seems unlikely that `c` is explicitly opted in
to all that much. (given the purpose of this crate)

This should allow us to archive the `compiler-rt` repository and simply
use `llvm-project` in the rust-lang/rust repository.
2019-05-16 07:50:20 -07:00
Alex Crichton
6ddcff1475 Fix __divsi3 and __udivsi3 on thumbv6m targets
This commit fixes a bug accidentally introduced in #285 where some
lingering references remained to `#[cfg(thumbv6m)]` but this, since the
historical revert, was renamed to `#[cfg(thumb_1)]`. This caused on the
thumbv6m platform for the intrinsics to be accidentally omitted because
the build script didn't actually compile them but the Rust code thought
the C code was in use.

After correcting the `#[cfg]` statements the CI configuration for the
`thumb*` family of targets was all updated. The support for xargo
testing was removed from `run.sh` since it had long since bitrotted, and
the script was updated to simply build the intrinsics example to attempt
to link for each of these targets. This in turn exposed the bug locally
and allowed to confirm a fix once the `#[cfg]` statements were
corrected.

cc rust-lang/rust#60782
2019-05-14 12:26:09 -07:00
Alex Crichton
98f4618c9a Revert "Use the Rust implementation of udivsi3 on ARM"
This reverts commit 681aaa914dea7cae8252c33023604ce6c91808bd.
2019-05-02 12:49:19 -07:00
Alex Crichton
742b0330c5 Try to handle thumb targets and xargo 2019-04-02 11:54:20 -07:00
Alex Crichton
7567d9ceb4 Don't pass -it to docker 2019-04-02 09:35:47 -07:00
Alex Crichton
cede5bc161 Expand Azure Pipelines configuration 2019-04-02 08:37:06 -07:00
Jorge Aparicio
20926bc1fd give Xargo a $HOME 2016-09-30 20:21:15 -05:00
Jorge Aparicio
d44e127053 use docker run --user instead of manually creating a user 2016-09-30 18:37:41 -05:00
Jorge Aparicio
92204dce54 cache Cargo artifacts
notable changes in the docker-based testing infrastructure

- the docker containers can now modify $CARGO_HOME, to re-use the outer
  Cargo registry, and the target directory to re-use build artifacts.

- the docker containers are removed when their execution finishes
  because it's no longer necessary to re-start them to inspect them
  because all the interesting output is in the outer target directory
2016-09-30 17:39:36 -05:00
Jorge Aparicio
a57a63fe08 adapt to new testing infrastructure 2016-09-29 18:50:04 -05:00
Alex Crichton
e7c804a9b0 Expand and refactor teting infrastructure
This commit moves over most of the testing infrastructure to in-tree docker
images that are all dispatched to from Travis (no other test configuration).
This allows versioning modifications to the test infrastructure as well as the
code itself. Additionally separate docker images allows for easy modification of
one without worrying about tampering of others as well as easy addition of new
targets by simply adding a new `Dockerfile`.

Additionally this commit bundles the master version of the `compiler-rt` source
repository from `llvm-mirror/compiler-rt` to test against. The compiler-rt
library itself is compiled as a `cdylib` which is then dynamically located at
runtime and we look for symbols in. There's a few hoops here, but they currently
get the job done.

All tests now execute against both gcc_s and compiler-rt, and this
testing strategy is now all hidden behind a macro as well (refactoring
all existing tests along the way).
2016-09-28 22:09:55 -07:00