Skip to content

Commit e1da819

Browse files
Copilotmessense
andauthored
Fix s390x-musl sysroot nested directory structure (#213)
* Initial plan * Fix s390x-musl std library by passing environment variables to build-std.sh Co-authored-by: messense <1556054+messense@users.noreply.github.com> * Test s390x after docker image build * Fix s390x-musl by using correct MUSL_TARGET path Co-authored-by: messense <1556054+messense@users.noreply.github.com> * Fix sysroot nested directory structure in build-sysroot tool Co-authored-by: messense <1556054+messense@users.noreply.github.com> * Revert Dockerfile and build-std.sh, keep only Build.yml and build-sysroot changes Co-authored-by: messense <1556054+messense@users.noreply.github.com> * Refactor Build.yml for s390x and test conditions Removed MUSL_TARGET for s390x and updated test condition. * Update deps in tests * update ci --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: messense <1556054+messense@users.noreply.github.com> Co-authored-by: messense <messense@icloud.com>
1 parent 96ec14a commit e1da819

File tree

4 files changed

+902
-464
lines changed

4 files changed

+902
-464
lines changed

.github/workflows/Build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,18 @@ jobs:
209209
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/rust-musl-cross:buildcache-${{ matrix.env.IMAGE_TAG }}-${{ matrix.os.arch }}
210210
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/rust-musl-cross:buildcache-${{ matrix.env.IMAGE_TAG }}-${{ matrix.os.arch }},mode=max
211211
- name: Test Docker cargo build
212-
if: ${{ matrix.os.arch == 'amd64' && !startsWith(matrix.env.TARGET, 'armv5te') && !startsWith(matrix.env.TARGET, 's390x') && !startsWith(matrix.env.TARGET, 'riscv64') }}
212+
if: ${{ matrix.os.arch != 'armv7' && !startsWith(matrix.env.TARGET, 'armv5te') && !startsWith(matrix.env.TARGET, 's390x') && !startsWith(matrix.env.TARGET, 'riscv64') }}
213213
run: |
214214
docker run --rm \
215215
-v "$(pwd)/tests":/home/rust/src \
216216
ghcr.io/${{ github.repository_owner }}/rust-musl-cross:$IMAGE_TAG-${{ matrix.os.arch }} bash -c "cargo build"
217+
- name: Test Docker cargo build (s390x)
218+
if: ${{ matrix.os.arch != 'armv7' && startsWith(matrix.env.TARGET, 's390x') }}
219+
run: |
220+
docker run --rm \
221+
-v "$(pwd)/tests":/home/rust/src \
222+
-e CFLAGS="-march=z10 -mzarch" \
223+
ghcr.io/${{ github.repository_owner }}/rust-musl-cross:$IMAGE_TAG-${{ matrix.os.arch }} bash -c "cargo build"
217224
- name: Build and push multiarch image
218225
if: ${{ github.event_name != 'pull_request' }}
219226
env:

build-sysroot/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ fn main() -> Result<()> {
4848
.join("rust")
4949
.join("library");
5050

51-
let sysroot_dir = PathBuf::from(&sysroot_base)
52-
.join("lib")
53-
.join("rustlib")
54-
.join(&target);
51+
let sysroot_dir = PathBuf::from(&sysroot_base);
5552

5653
println!("Building sysroot for target: {}", target);
5754
println!("Source directory: {}", src_dir.display());

0 commit comments

Comments
 (0)