aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-08-12 10:49:49 +0100
committerJonas Schievink <[email protected]>2020-08-12 11:23:25 +0100
commit67b2b3d0ce59fe082b442de30627c3386048eaca (patch)
tree55f1ba6759838b18f16efb24616efa37f6140a51
parentb93408d0b2609b82f869b1953122df4a46bb0014 (diff)
Fix build on musl and test it in CI
-rw-r--r--.github/workflows/ci.yaml18
-rw-r--r--Cargo.lock4
-rw-r--r--crates/ra_prof/src/memory_usage.rs2
3 files changed, 16 insertions, 8 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 2acd44012..f977c88be 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -88,11 +88,14 @@ jobs:
88 if: matrix.os == 'windows-latest' 88 if: matrix.os == 'windows-latest'
89 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe 89 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
90 90
91 # Weird target to catch non-portable code 91 # Weird targets to catch non-portable code
92 rust-power: 92 rust-cross:
93 name: Rust Power 93 name: Rust Cross
94 runs-on: ubuntu-latest 94 runs-on: ubuntu-latest
95 95
96 env:
97 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
98
96 steps: 99 steps:
97 - name: Checkout repository 100 - name: Checkout repository
98 uses: actions/checkout@v2 101 uses: actions/checkout@v2
@@ -103,7 +106,9 @@ jobs:
103 toolchain: stable 106 toolchain: stable
104 profile: minimal 107 profile: minimal
105 override: true 108 override: true
106 target: 'powerpc-unknown-linux-gnu' 109
110 - name: Install Rust targets
111 run: rustup target add ${{ env.targets }}
107 112
108 - name: Cache cargo directories 113 - name: Cache cargo directories
109 uses: actions/cache@v2 114 uses: actions/cache@v2
@@ -114,7 +119,10 @@ jobs:
114 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} 119 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
115 120
116 - name: Check 121 - name: Check
117 run: cargo check --target=powerpc-unknown-linux-gnu --all-targets 122 run: |
123 for target in ${{ env.targets }}; do
124 cargo check --target=$target --all-targets
125 done
118 126
119 typescript: 127 typescript:
120 name: TypeScript 128 name: TypeScript
diff --git a/Cargo.lock b/Cargo.lock
index a094ec4f7..265889162 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -852,9 +852,9 @@ dependencies = [
852 852
853[[package]] 853[[package]]
854name = "perf-event-open-sys" 854name = "perf-event-open-sys"
855version = "0.3.1" 855version = "0.3.2"
856source = "registry+https://github.com/rust-lang/crates.io-index" 856source = "registry+https://github.com/rust-lang/crates.io-index"
857checksum = "95db63e37862bc1b842135d2234ef9418f222cc660c6752f45e7cf9ddfb97f96" 857checksum = "83e7183862f36d10263d0a1ccaef50fef734ade948bf026afd1bd97355c78273"
858dependencies = [ 858dependencies = [
859 "libc", 859 "libc",
860] 860]
diff --git a/crates/ra_prof/src/memory_usage.rs b/crates/ra_prof/src/memory_usage.rs
index c2ecbd33c..83390212a 100644
--- a/crates/ra_prof/src/memory_usage.rs
+++ b/crates/ra_prof/src/memory_usage.rs
@@ -24,7 +24,7 @@ impl std::ops::Sub for MemoryUsage {
24impl MemoryUsage { 24impl MemoryUsage {
25 pub fn current() -> MemoryUsage { 25 pub fn current() -> MemoryUsage {
26 cfg_if! { 26 cfg_if! {
27 if #[cfg(target_os = "linux")] { 27 if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
28 // Note: This is incredibly slow. 28 // Note: This is incredibly slow.
29 let alloc = unsafe { libc::mallinfo() }.uordblks as isize; 29 let alloc = unsafe { libc::mallinfo() }.uordblks as isize;
30 MemoryUsage { allocated: Bytes(alloc) } 30 MemoryUsage { allocated: Bytes(alloc) }