213 Commits

Author SHA1 Message Date
Jakub Beránek
2f20628da2 Remove josh-sync crate 2025-07-08 08:56:34 +02:00
Trevor Gross
7222fa6f34 Work around out-of-tree testing with a shim crate
Out-of-tree testing is broken with the most recent update from
rust-lang/rust because it makes `compiler-builtins` depend on `core` by
path, which isn't usually available. In order to enable testing outside
of rust-lang/rust, add a new crate `builtins-shim` that uses the same
source as `compiler-builtins` but drops the `core` dependency. This has
replaced `compiler-builtins` as the workspace member and entrypoint for
tests.
2025-06-14 06:56:18 +00:00
Trevor Gross
3353a891e3 Add tooling for josh syncs
Create a crate that handles pulling from and pushing to rust-lang/rust.
This can be invoked with the following:

    $ cargo run -p josh-sync -- rustc-pull
    $ RUSTC_GIT=/path/to/rust/checkout cargo run -p josh-sync -- rustc-push <username>
2025-06-04 18:06:15 +00:00
Trevor Gross
a63f4826cf Replace the nm symbol check with a Rust implementation
This should be less error-prone and adaptable than the `nm` version, and
have better cross-platform support without needing LLVM `nm` installed.
2025-05-29 15:38:10 +00:00
Trevor Gross
d30dde73b3 fix: Switch to resolver v2
The published crates fail to build with an edition less than 2024
because they are packaged with `resolver = "3"`, which is a 2024-only
option. Revert back to resolver v2 to drop this requirement.

Fixes: https://github.com/rust-lang/compiler-builtins/issues/883
2025-04-22 04:00:49 -04:00
Trevor Gross
4e8eea696d Add panic-handler to the workspace
This crate does not interact with features so there isn't any reason it
can't become part of the workspace.
2025-04-20 05:33:19 -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
141c7b06c4 Add remaining libm crates to the workspace
These are still not yet covered in CI since we always name explicit
packages there, but all crates are now part of the workspace.
2025-04-19 23:20:13 -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
66fa4fd265 Add libm and libm-macros to the workspace
These should build and test correctly. `libm-test` and others that
depend on it are excluded since the necessary CI is not yet set up.
2025-04-19 19:05:49 -04:00
Trevor Gross
92b1e8454d Rename testcrate to builtins-test
The repo will soon have `libm` as a top-level crate, so make it clear
that this is only the test crate for `compiler-builtins`.
2025-04-18 21:14:41 -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
a179959e0b Move examples/intrinsics.rs to its own crate
Currently there is an interesting situation with the way features get
enabled; `testcrate` enables `mangled-names`, but the `intrinsics.rs`
example requires this feature be disabled (otherwise the test fails with
missing symbols, as expected). This is also the reason that `testcrate`
is not a default workspace member, meaning `cargo test` doesn't actually
run `testcrate`'s tests; making it a default member would mean that
`compiler-builtins/mangled-names` gets enabled when
`examples/intrinsics.rs` gets built, due to the way features get
unified.

Simplify the situation by making moving the example to its own crate as
`builtins-test-intrinsics`. This also means `testcrate` can become a
default member so it is included in `cargo check` or `cargo test` when
run at the workspace root.

`testcrate` and `builtins-test-intrinsics` still can't be built at the
same time since there isn't a straightforward way to have Cargo build
`compiler-builtins` twice with different features. This is a side effect
of us using non-additive features, but there isn't really a better
option since enabling both mangled and unmangled names would render
`builtins-test-intrinsics` useless.
2025-03-18 05:35:19 -05:00
Trevor Gross
1112886edc Use the v2 resolver in the workspace 2025-03-06 04:04:39 -05:00
github-actions[bot]
795fa2f40a chore: release v0.1.151 2025-03-05 01:32:53 -05:00
github-actions[bot]
4b664fd2ef chore: release v0.1.150 2025-03-01 14:54:11 -05:00
github-actions[bot]
45c4a1d1b5 chore: release v0.1.149 2025-02-25 14:02:15 -05:00
github-actions[bot]
95a5ad5225 chore: release v0.1.148 2025-02-24 02:43:13 -05:00
github-actions[bot]
f851256581 chore: release v0.1.147 2025-02-19 19:16:19 -05:00
github-actions[bot]
84cb50e5b5 chore: release v0.1.146 2025-02-06 17:46:20 -06:00
github-actions[bot]
dbd3032d42
chore: release v0.1.145 2025-02-04 10:46:49 +00:00
github-actions[bot]
49595ea04e
chore: release v0.1.144 2025-01-15 21:19:09 +00:00
github-actions[bot]
05d429523d
chore: release v0.1.143 2025-01-15 03:53:29 +00:00
github-actions[bot]
d0a79fd542
chore: release v0.1.142 2025-01-07 23:21:35 +00:00
github-actions[bot]
1b0adb233c
chore: release v0.1.141 2025-01-07 01:57:53 +00:00
github-actions[bot]
a078f5a0c5 chore: release v0.1.140 2024-12-26 00:16:33 -05:00
github-actions[bot]
c33f521bb5
chore: release v0.1.139 2024-11-03 23:08:41 +00:00
github-actions[bot]
4c7450d10c
chore: release v0.1.138 2024-11-01 11:00:27 +00:00
github-actions[bot]
94e6ed373a chore: release v0.1.137 2024-10-31 19:13:38 -05:00
github-actions[bot]
f9914e98b3
chore: release v0.1.136 2024-10-26 23:29:14 +00:00
Trevor Gross
6399bed36c Update licensing to MIT AND Apache-2.0 WITH LLVM-exception
Currently, Cargo.toml specifies Apache-2.0 OR MIT, but LICENSE.txt
describes MIT OR NCSA. compiler-builtins is derived from LLVM's
compiler-rt. LICENSE.txt correctly reflects the state of compiler-rt
prior to relicensing on 2019-01-19, during which time software was
available for use under either MIT or the University of Illinois NCSA
license. After relicensing, however, compiler-rt is available for use
only under Apache-2.0 with the LLVM exception; this is not reflected
anywhere in the repository.

Update the SPDX license identifier to `MIT AND Apache-2.0 WITH
LLVM-exception AND (MIT OR Apache-2.0)`. Each AND portion covers
something specific:

* Apache-2.0 WITH LLVM-exception: this covers work that is derived from
  the LLVM repository since after the LLVM relicensing.
* MIT: This covers work that is derived from LLVM before the LLVM
  relicensing (under MIT OR NCSA), as well as the vendored `libm`
  components.
* MIT AND Apache-2.0: This ensures that any contributions to this
  repository, in addition to meeting the above required licenses, is
  also released for use under the Rust-standard Apache-2.0 with no LLVM
  exception.

See also the parallel license update in rust-lang/libm [1].

Fixes: https://github.com/rust-lang/compiler-builtins/issues/307
Closes: https://github.com/rust-lang/compiler-builtins/pull/511
Link: https://rust-lang.zulipchat.com/#narrow/channel/335408-foundation/topic/Request.20for.20legal.20team.20input.20on.20crate.20licensing
Link: https://github.com/rust-lang/libm/pull/317 [1]
2024-10-26 17:35:26 -05:00
github-actions[bot]
ce89a70ae4
chore: release v0.1.135 2024-10-23 09:57:03 +00:00
github-actions[bot]
3e922da156
chore: release v0.1.134 2024-10-17 23:55:25 +00:00
github-actions[bot]
fedfc6aaab
chore: release 2024-10-06 02:08:00 +00:00
github-actions[bot]
3edc27ef56
chore: release 2024-10-04 17:17:03 +00:00
github-actions[bot]
859e22b4ae
chore: release 2024-10-03 15:37:33 +00:00
github-actions[bot]
8a13ab7dfc
chore: release 2024-09-28 15:13:17 +00:00
github-actions[bot]
c48926906a
chore: release 2024-09-27 11:08:02 +00:00
Trevor Gross
1649f72ea6
Revert "Bump cc dependency" 2024-09-27 07:00:19 -04:00
github-actions[bot]
1e5bf9e166
chore: release 2024-09-25 14:37:03 +00:00
Artyom Tetyukhin
70d74bb7a4
Bump cc dependency 2024-09-25 18:21:36 +04:00
github-actions[bot]
d6d29197e4
chore: release 2024-09-24 16:40:44 +00:00
github-actions[bot]
22ef22e30b
chore: release 2024-09-11 17:09:04 +00:00
github-actions[bot]
0711291229
chore: release 2024-09-05 16:14:31 +00:00
github-actions[bot]
39920c73dd
chore: release 2024-09-01 03:20:30 +00:00
github-actions[bot]
5b227e4772
chore: release 2024-08-28 16:15:09 +00:00
github-actions[bot]
18109c2d2d
chore: release 2024-08-25 04:08:06 +00:00
github-actions[bot]
25be87d8a8
chore: release 2024-08-22 08:01:13 +00:00
github-actions[bot]
7033f32bac
chore: release 2024-08-22 06:03:55 +00:00
Kleis Auke Wolthuizen
18cbc52ee6 Add configure.rs to the include list 2024-08-12 19:45:28 +02:00