Skip to content

Commit b5f8003

Browse files
committed
Fix compiler-builtins publish
compiler-builtins currently wouldn't publish correctly because of a relative path to `libm` that doesn't get included in the package. Fix this by simlinking `libm` to within the `compiler-builtins` directory. Also symlink LICENSE.txt which lets us drop the `include` array in Cargo.toml. LICENSE.txt and compiler-rt were not being included anyway, since Cargo silently drops items that are not within the crate directory.
1 parent 33dedd2 commit b5f8003

File tree

5 files changed

+7
-16
lines changed

5 files changed

+7
-16
lines changed

compiler-builtins/Cargo.toml

-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ homepage = "https://github.com/rust-lang/compiler-builtins"
99
documentation = "https://docs.rs/compiler_builtins"
1010
edition = "2021"
1111
description = "Compiler intrinsics used by the Rust compiler."
12-
include = [
13-
"../LICENSE.txt",
14-
"../compiler-rt/*",
15-
"/Cargo.toml",
16-
"/build.rs",
17-
"/configure.rs",
18-
"/src/*",
19-
"README.md",
20-
"libm/src/math/*",
21-
]
2212
links = 'compiler-rt'
2313

2414
[lib]

compiler-builtins/LICENSE.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE.txt

compiler-builtins/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub mod math;
4545
pub mod mem;
4646

4747
// `libm` expects its `support` module to be available in the crate root.
48-
use math::libm::support;
48+
use math::libm_math::support;
4949

5050
#[cfg(target_arch = "arm")]
5151
pub mod arm;

compiler-builtins/src/math/libm_math

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../libm/src/math

compiler-builtins/src/math.rs renamed to compiler-builtins/src/math/mod.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
#[allow(dead_code)]
33
#[allow(unused_imports)]
44
#[allow(clippy::all)]
5-
#[path = "../../libm/src/math/mod.rs"]
6-
pub(crate) mod libm;
5+
pub(crate) mod libm_math;
76

87
macro_rules! libm_intrinsics {
98
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
109
intrinsics! {
1110
$(
1211
pub extern "C" fn $fun($($iid: $ity),+) -> $oty {
13-
$crate::math::libm::$fun($($iid),+)
12+
$crate::math::libm_math::$fun($($iid),+)
1413
}
1514
)+
1615
}
@@ -185,13 +184,13 @@ pub mod partial_availability {
185184
// allow for windows (and other targets)
186185
intrinsics! {
187186
pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
188-
let r = super::libm::lgamma_r(x);
187+
let r = super::libm_math::lgamma_r(x);
189188
*s = r.1;
190189
r.0
191190
}
192191

193192
pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 {
194-
let r = super::libm::lgammaf_r(x);
193+
let r = super::libm_math::lgammaf_r(x);
195194
*s = r.1;
196195
r.0
197196
}

0 commit comments

Comments
 (0)