mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Fix build on musl and test it in CI
This commit is contained in:
parent
b93408d0b2
commit
67b2b3d0ce
18
.github/workflows/ci.yaml
vendored
18
.github/workflows/ci.yaml
vendored
@ -88,11 +88,14 @@ jobs:
|
|||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
|
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
|
||||||
|
|
||||||
# Weird target to catch non-portable code
|
# Weird targets to catch non-portable code
|
||||||
rust-power:
|
rust-cross:
|
||||||
name: Rust Power
|
name: Rust Cross
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -103,7 +106,9 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
target: 'powerpc-unknown-linux-gnu'
|
|
||||||
|
- name: Install Rust targets
|
||||||
|
run: rustup target add ${{ env.targets }}
|
||||||
|
|
||||||
- name: Cache cargo directories
|
- name: Cache cargo directories
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@ -114,7 +119,10 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
run: cargo check --target=powerpc-unknown-linux-gnu --all-targets
|
run: |
|
||||||
|
for target in ${{ env.targets }}; do
|
||||||
|
cargo check --target=$target --all-targets
|
||||||
|
done
|
||||||
|
|
||||||
typescript:
|
typescript:
|
||||||
name: TypeScript
|
name: TypeScript
|
||||||
|
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -852,9 +852,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "perf-event-open-sys"
|
name = "perf-event-open-sys"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95db63e37862bc1b842135d2234ef9418f222cc660c6752f45e7cf9ddfb97f96"
|
checksum = "83e7183862f36d10263d0a1ccaef50fef734ade948bf026afd1bd97355c78273"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
@ -24,7 +24,7 @@ impl std::ops::Sub for MemoryUsage {
|
|||||||
impl MemoryUsage {
|
impl MemoryUsage {
|
||||||
pub fn current() -> MemoryUsage {
|
pub fn current() -> MemoryUsage {
|
||||||
cfg_if! {
|
cfg_if! {
|
||||||
if #[cfg(target_os = "linux")] {
|
if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
|
||||||
// Note: This is incredibly slow.
|
// Note: This is incredibly slow.
|
||||||
let alloc = unsafe { libc::mallinfo() }.uordblks as isize;
|
let alloc = unsafe { libc::mallinfo() }.uordblks as isize;
|
||||||
MemoryUsage { allocated: Bytes(alloc) }
|
MemoryUsage { allocated: Bytes(alloc) }
|
||||||
|
Loading…
Reference in New Issue
Block a user