Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Switch repository layout to use a virtual manifest #533

Merged
merged 2 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
steps:
- uses: actions/checkout@master
- run: |
msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' Cargo.toml)"
msrv="$(perl -ne 'print if s/rust-version\s*=\s*"(.*)"/\1/g' libm/Cargo.toml)"
echo "MSRV: $msrv"
echo "MSRV=$msrv" >> "$GITHUB_ENV"
- name: Install Rust
Expand Down
56 changes: 3 additions & 53 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,72 +1,22 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
categories = ["no-std"]
description = "libm in pure Rust"
documentation = "https://docs.rs/libm"
keywords = ["libm", "math"]
license = "MIT"
name = "libm"
readme = "README.md"
repository = "https://github.com/rust-lang/libm"
version = "0.2.11"
edition = "2021"
exclude = ["/ci/", "/.github/workflows/"]
rust-version = "1.63"

[features]
default = ["arch"]

# Enable architecture-specific features such as SIMD or assembly routines.
arch = []

# This tells the compiler to assume that a Nightly toolchain is being used and
# that it should activate any useful Nightly things accordingly.
unstable = ["unstable-intrinsics", "unstable-float"]

# Enable calls to functions in `core::intrinsics`
unstable-intrinsics = []

# Make some internal things public for testing.
unstable-public-internals = []

# Enable the nightly-only `f16` and `f128`.
unstable-float = []

# Used to prevent using any intrinsics or arch-specific code.
#
# HACK: this is a negative feature which is generally a bad idea in Cargo, but
# we need it to be able to forbid other features when this crate is used in
# Rust dependencies. Setting this overrides all features that may enable
# hard float operations.
force-soft-floats = []

[workspace]
resolver = "2"
members = [
"libm",
"crates/libm-macros",
"crates/libm-test",
"crates/musl-math-sys",
"crates/util",
]
default-members = [
".",
"libm",
"crates/libm-macros",
"crates/libm-test",
"crates/libm-test"
]
exclude = [
# Requires `panic = abort` so can't be a member of the workspace
"crates/compiler-builtins-smoke-test",
]

[dev-dependencies]
no-panic = "0.1.35"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
# compiler-builtins sets this feature, but we use it in `libm`
'cfg(feature, values("compiler-builtins"))',
] }

# The default release profile is unchanged.

# Release mode with debug assertions
Expand Down
8 changes: 4 additions & 4 deletions ci/ci-util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
COMMAND:
generate-matrix
Calculate a matrix of which functions had source change, print that as
a JSON object.
a JSON object.

locate-baseline [--download] [--extract]
Locate the most recent benchmark baseline available in CI and, if flags
Expand Down Expand Up @@ -63,9 +63,9 @@
# Don't run exhaustive tests if these files change, even if they contaiin a function
# definition.
IGNORE_FILES = [
"src/math/support/",
"src/libm_helper.rs",
"src/math/arch/intrinsics.rs",
"libm/src/math/support/",
"libm/src/libm_helper.rs",
"libm/src/math/arch/intrinsics.rs",
]

TYPES = ["f16", "f32", "f64", "f128"]
Expand Down
4 changes: 2 additions & 2 deletions crates/compiler-builtins-smoke-test/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[path = "../../configure.rs"]
#[path = "../../libm/configure.rs"]
mod configure;

fn main() {
println!("cargo:rerun-if-changed=../../configure.rs");
println!("cargo:rerun-if-changed=../../libm/configure.rs");
let cfg = configure::Config::from_env();
configure::emit_libm_config(&cfg);
}
2 changes: 1 addition & 1 deletion crates/compiler-builtins-smoke-test/src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use core::ffi::c_int;
#[allow(dead_code)]
#[allow(clippy::all)] // We don't get `libm`'s list of `allow`s, so just ignore Clippy.
#[allow(unused_imports)]
#[path = "../../../src/math/mod.rs"]
#[path = "../../../libm/src/math/mod.rs"]
pub mod libm;

/// Mark functions `#[no_mangle]` and with the C ABI.
Expand Down
2 changes: 1 addition & 1 deletion crates/libm-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ anyhow = "1.0.97"
gmp-mpfr-sys = { version = "1.6.4", optional = true, default-features = false }
iai-callgrind = { version = "0.14.0", optional = true }
indicatif = { version = "0.17.11", default-features = false }
libm = { path = "../..", features = ["unstable-public-internals"] }
libm = { path = "../../libm", features = ["unstable-public-internals"] }
libm-macros = { path = "../libm-macros" }
musl-math-sys = { path = "../musl-math-sys", optional = true }
paste = "1.0.15"
Expand Down
4 changes: 2 additions & 2 deletions crates/libm-test/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[path = "../../configure.rs"]
#[path = "../../libm/configure.rs"]
mod configure;
use configure::Config;

fn main() {
println!("cargo:rerun-if-changed=../../configure.rs");
println!("cargo:rerun-if-changed=../../libm/configure.rs");
let cfg = Config::from_env();
configure::emit_test_config(&cfg);
}
2 changes: 1 addition & 1 deletion crates/musl-math-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
[dependencies]

[dev-dependencies]
libm = { path = "../../" }
libm = { path = "../../libm" }

[build-dependencies]
cc = "1.2.16"
2 changes: 1 addition & 1 deletion crates/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-mpfr = ["libm-test/build-mpfr", "dep:rug"]
unstable-float = ["libm/unstable-float", "libm-test/unstable-float", "rug?/nightly-float"]

[dependencies]
libm = { path = "../..", default-features = false }
libm = { path = "../../libm", default-features = false }
libm-macros = { path = "../libm-macros" }
libm-test = { path = "../libm-test", default-features = false }
musl-math-sys = { path = "../musl-math-sys", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/util/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#![allow(unexpected_cfgs)]

#[path = "../../configure.rs"]
#[path = "../../libm/configure.rs"]
mod configure;

fn main() {
println!("cargo:rerun-if-changed=../../configure.rs");
println!("cargo:rerun-if-changed=../../libm/configure.rs");
let cfg = configure::Config::from_env();
configure::emit_libm_config(&cfg);
}
Loading