Commit Graph

70 Commits

Author SHA1 Message Date
Trevor Gross
9a81b2a6a0 Start runnning tests for aarch64-pc-windows-msvc
This target is currently build-only. Switch to the windows-11-arm
runner, which allows us to start running tests.
2025-08-07 15:49:49 -05:00
Trevor Gross
3cbd088ee4 ci: Set pipefail before running ci-util
Currently, a failure in `ci-util.py` does not cause the job to fail
because the pipe eats the failure status . Set pipefail to fix this.

Fixes: ff2cc0e38e3e ("ci: Don't print output twice in `ci-util`")
2025-07-30 09:57:45 -05:00
Trevor Gross
eafafc44ab ci: Don't print output twice in ci-util
Use `tee` rather than printing to both stdout and stderr.
2025-07-30 08:59:57 +00:00
Trevor Gross
97c35d3aed ci: Simplify tests for verbatim paths
Rather than setting an environment variable in the workflow job based on
whether or not the environment is non-MinGW Windows, we can just check
this in the ci script.

This was originally added in b0f19660f0 ("Add tests for UNC paths on
windows builds") and its followup commits.
2025-07-29 19:07:55 +00:00
Trevor Gross
54a4f867f8 cleanup: Trim trailing whitespace 2025-07-29 18:56:46 +00:00
Jakub Beránek
54f6ab73b1 Switch to using a GH app for authenticating sync PRs
So there will no longer be the need to close and reopen sync PRs in
order for CI to run.
2025-07-29 08:20:22 +00:00
Trevor Gross
08bca4d6a2 ci: Add native PowerPC64LE and s390x jobs
We now have access to native runners, so make use of them for these
architectures. The existing ppc64le Docker job is kept for now.
2025-07-23 04:50:41 -05:00
Trevor Gross
ed50029b92 ci: Switch to nightly rustfmt
We are getting warnings in CI about unsupported features. There isn't
any reason to use stable rustfmt so switch the channel here.
2025-07-21 12:18:45 -05:00
Jakub Beránek
7a1593c597 Add CI workflow for automatically performing subtree sync pulls
This CI workflow will run the https://github.com/rust-lang/josh-sync
tool on Mondays and Thursdays. It will try to do a pull (sync stdarch
changes from rust-lang/rust into this repository). When it runs, three
things can happen:
- There are no rustc changes to be pulled, the bot does nothing.
- There are some new changes to be pulled. In that case, the bot will
either open or update an existing PR titled "Rustc pull update" on this
repository with the changes. After the PR is merged, we should ideally
do the opposite sync (push) manually.
- The pull fails (usually because of a merge conflict), or the bot
determines that a pull PR has been opened for more than a week without
being merged. In that case, it will post a ping to
https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/compiler-builtins.20subtree.20sync.20automation/with/528482375.
2025-07-12 20:30:19 +00:00
Trevor Gross
016bc61312 Test building custom targets and resolve an issue probing rustc
The `rustc` probe done in our build scripts needs to pass `--target` to
get the correct configuration, which usually comes from the `TARGET`
environment variable. However, for targets specified via a `target.json`
file, `TARGET` gets set to the file name without an extension or path.
`rustc` will check a search path to attempt to locate the file, but this
is likely to fail since the directory where Cargo invokes build scripts
(and hence where those scripts invoke `rustc`) might not have any
relation to the JSON spec file.

Resolve this for now by leaving `f16` and `f128` disabled if the `rustc`
command fails. Result of the discussion at CARGO-14208 may eventually
provide a better solution.

A CI test is also added since custom JSON files are an edge case that
could fail in other ways. I verified this fails without the fix here.
The JSON file is the output for `thumbv7em-none-eabi`, just renamed so
`rustc` doesn't identify it.
2025-07-04 21:09:56 -05:00
Trevor Gross
e1e3cc24a2 Replace the musl submodule with a download script
The submodule was causing issues in rust-lang/rust, so eliminiate it
here. `build-musl` is also removed from `libm-test`'s default features
so the crate doesn't need to be built by default.
2025-06-04 17:20:43 +00:00
Trevor Gross
4d325e8b2c ci: Allow for multiple icount benchmarks in the same run
We don't actually need this for now, but eventually it would be nice to
run icount benchmarks on multiple targets. Start tagging artifact names
with the architecture, and allow passing `--tag` to `ci-util.py` in
order to retrieve the correct one.
2025-05-29 21:58:21 +00:00
Trevor Gross
9f84e9904f Increase the benchmark rustc version to 2025-05-28
We may soon want to use some new nightly features in `compiler-builtins`
and `libm`, specifically `cfg_target_has_reliable_f16_f128` which was
added in the past few weeks. This will mean we need a newer toolchain
for benchmarks to continue building.

Bump to the current latest nightly so we are not blocked on this down
the line.
2025-05-29 19:56:59 +00:00
Trevor Gross
3464b4b231 ci: Allow concurrency outside of pull requests
When multiple merges to `master` happen before a CI run completes, the
in-progress job is getting canceled. Fix this by using the commit sha
for the group key if a pull request number is not available, rather than
`github.ref` (which is always `refs/head/master` after merge). This
should prevent jobs running on previous commits from getting cancelled,
while still ensuring there is only ever one active run per pull request.
2025-05-29 19:01:03 +00:00
Trevor Gross
8db9bd6a59 Remove the now-unneeded llvm-tools-preview
Since a working `nm` is no longer needed as part of CI, the rustup
component can be removed.
2025-05-29 15:38:10 +00:00
Trevor Gross
13b94cf89f ci: Fix extensive tests
Move this to a script and ensure only `libm-test` gets built to avoid
default feature issues with `compiler-builtins`.
2025-04-21 22:50:42 -04:00
Trevor Gross
46bbc3dd88 ci: Clean up workflow file and docker script 2025-04-20 05:33:19 -04:00
Trevor Gross
ee431374eb ci: Add a timeout for all jobs 2025-04-20 04:39:06 -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
9c96f245b8 ci: Enable testing of libm crates
Update `run.sh` to start testing `libm`. Currently this is somewhat
inefficient because `builtins-test` gets run more than once on some
targets; this can be cleaned up later.
2025-04-20 03:22:27 -04:00
Trevor Gross
d0e0134dc5 ci: Add extensive tests from rust-lang/libm 2025-04-20 02:33:17 -04:00
Trevor Gross
9919218493 ci: Add a libm MSRV check
Add the job from rust-lang/libm
2025-04-20 02:23:28 -04:00
Trevor Gross
0d0d317242 Enable icount benchmarks in CI 2025-04-20 00:58:50 -04:00
Trevor Gross
ca5c4ed8d7 Fix the release-plz job 2025-04-19 17:31:43 -04:00
Trevor Gross
01c5888246 ci: Make CI configuration more similar to libm
Apply a handful of changes to reduce the diff between the two:

* Cancel running jobs on new pushes
* Enable log color and backtraces
* Add timeouts
* Specify CI runner versions
* Add an armv7 job
* Replace the name NO_STD with BUILD_ONLY
* Update the extension to the canonical .yaml
* Set AR_ and CC_ environments in docker
* Install requirements to build MPFR
2025-04-18 23:49:29 -04:00
Ralf Jung
5cf993880a copy_misaligned_words: avoid out-of-bounds accesses (#799)
* copy_misaligned_words: avoid out-of-bounds accesses
* add test to make Miri able to detect OOB in memmove
* run Miri on CI
2025-03-22 05:36:40 +00: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
Ralf Jung
014f530f76 nightlies without clippy are not a thing any more 2025-03-18 16:37:52 -05:00
Trevor Gross
f8b03df54e Add a script for downloading compiler-rt
Rather than needing to copy the version and URL from the CI workflow,
put this into a script that can be directly run locally.
2025-03-18 06:23:30 -05:00
Trevor Gross
e4c1eb803d Revert "ci: Pin the nightly toolchain for aarch64-unknown-linux-gnu"
The fix to this issue was synced in [1] so we should no longer need to
keep aarch64 pinned.

This reverts commit b2bcfc838e2a4b72fa62b333e3eb91f250aa4539.

[1]: https://github.com/rust-lang/rust/pull/137661
2025-03-04 22:15:03 -05:00
Trevor Gross
60ea5815b2 Update LLVM downloads to 20.1-2025-02-13
This matches the version used by rust-lang/rust.
2025-02-26 02:47:49 -05:00
Trevor Gross
54e7ff15c0 Revert "ci: Pin the nightly toolchain for i686-pc-windows-gnu"
Since [1], the issue should be resolved so the workaround can be
dropped.

This reverts commit 88e83b96ad09f3cf9e2d1b4543a7d43f9c5a77c0.

[1]: https://github.com/rust-lang/compiler-builtins/pull/759
2025-02-23 03:40:11 -05:00
Trevor Gross
bade6290c8 ci: Pin the nightly toolchain for aarch64-unknown-linux-gnu
Pin aarch64-unknown-linux-gnu to nightly-2025-02-07 until [1] is
resolved.

[1]: https://github.com/llvm/llvm-project/issues/127804
2025-02-19 15:38:45 -05:00
Trevor Gross
4517c7ea90 ci: Pin the nightly toolchain for i686-pc-windows-gnu
Pin i686-pc-windows-gnu to nightly-2025-02-07 until [1] is resolved.

[1]: https://github.com/rust-lang/rust/issues/136795
2025-02-19 15:38:45 -05:00
Trevor Gross
37da10edde ci: Update actions/cache to v4
Github has deprecated v2 so this needs to be bumped.
2025-02-19 15:38:45 -05:00
WANG Rui
ec673535f7 ci: add support for loongarch64-unknown-linux-gnu 2024-11-01 05:48:47 -05:00
Trevor Gross
76580a96a7 Upgrade CI LLVM version to 19.1
19.1 is the latest stable release from 2024-09-17. This will match what
is currently being used in rust-lang/rust.
2024-10-03 11:49:45 -04:00
Trevor Gross
0c97b10dc0 Add riscv64gc to CI
There is a proposal to promote `riscv64gc-unknown-linux-gnu` to tier 1
[1]. We do not currently test RISC-V in CI; add it here.

[1]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Imminent.20RFC.20PR.3A.20riscv64gc-unknown-linux-gnu.20to.20Tier-1
2024-10-02 16:35:28 -04:00
beetrees
09a1f57604 Use macos-13 in CI for x86_64-apple-darwin 2024-08-24 11:52:41 +01:00
beetrees
d6588dff8f Use macos-latest in CI for aarch64-apple-darwin 2024-08-24 11:24:45 +01:00
Trevor Gross
364dd5fd5b Add release-plz for automatic releases.
This is what `cc-rs` is using and should create a release PR whenever a
change to `master` is made. If the branch is merged, it should publish
the new version.

Includes configuration to disable semver checks and not keep a changelog
since this is an implementation detail.
2024-07-26 23:45:35 -04:00
Trevor Gross
84e87eb15b Add caching for downloading compiler-rt 2024-05-24 23:18:59 +02:00
Trevor Gross
98ddf3c66d Enable cache for Docker images 2024-05-24 23:18:59 +02:00
Trevor Gross
d0fdc0044a Enable cache for Cargo components of the build 2024-05-24 23:18:59 +02:00
Henry Wang
0722bc4275 Don't run verbatim test on windows-gnu 2024-05-21 01:09:47 +02:00
theKidOfArcrania
fd290b1339 Properly escape /C and fix naming 2024-05-21 01:09:47 +02:00
theKidOfArcrania
e246ba5a46 Use cmd.exe 2024-05-21 01:09:47 +02:00
theKidOfArcrania
24cb0c2bcc Fix CI 2024-05-21 01:09:47 +02:00
theKidOfArcrania
3fdef93258 Add tests for UNC paths on windows builds 2024-05-21 01:09:47 +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