fix(ci): attempt to fix m1 compilation problem on GH Actions

This reverts commit e33fc6993c.
This commit is contained in:
Federico Terzi 2021-10-02 19:36:21 +02:00
parent e33fc6993c
commit 0afa3f4208
2 changed files with 20 additions and 5 deletions

View File

@ -53,10 +53,10 @@ jobs:
- name: Install cargo-make - name: Install cargo-make
run: | run: |
cargo install --force cargo-make cargo install --force cargo-make
- name: Setup tmate session # - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 # uses: mxschmitt/action-tmate@v3
with: # with:
limit-access-to-actor: true # limit-access-to-actor: true
- name: Build - name: Build
run: | run: |
SDKROOT=$(xcrun -sdk macosx11.3 --show-sdk-path) \ SDKROOT=$(xcrun -sdk macosx11.3 --show-sdk-path) \

View File

@ -170,6 +170,21 @@ fn build_native() {
arch => panic!("unsupported arch {}", arch), arch => panic!("unsupported arch {}", arch),
}; };
// Because of a configuration problem on the GitHub CI pipeline, we need
// to set the target architecture manually.
// See: https://github.com/actions/virtual-environments/issues/3288#issuecomment-830207746
let xcode_sdk_path = Command::new("xcrun").args(&["--sdk", "macosx", "--show-sdk-path"]).output().expect("unable to obtain XCode sdk path");
let xcode_sdk_path = String::from_utf8_lossy(&xcode_sdk_path.stdout);
let xcode_sdk_path = xcode_sdk_path.trim();
if xcode_sdk_path.is_empty() {
panic!("could not query XCode sdk path");
}
println!("Using SDK path: {}", xcode_sdk_path);
let configure_cxx_flags = format!("-isysroot {} -isystem {} -DSTDC_HEADERS=1 -DHAVE_FCNTL_H -arch {}", xcode_sdk_path, xcode_sdk_path, target_arch);
let mut handle = Command::new(out_wx_dir.join("configure")) let mut handle = Command::new(out_wx_dir.join("configure"))
.current_dir( .current_dir(
build_dir.to_string_lossy().to_string() build_dir.to_string_lossy().to_string()
@ -177,8 +192,8 @@ fn build_native() {
.args(&[ .args(&[
"--disable-shared", "--disable-shared",
"--without-libtiff", "--without-libtiff",
&format!("--enable-macosx_arch={}", target_arch),
]) ])
.env("CXXFLAGS", &configure_cxx_flags)
.spawn() .spawn()
.expect("failed to execute configure"); .expect("failed to execute configure");
if !handle.wait().expect("unable to wait for configure command").success() { if !handle.wait().expect("unable to wait for configure command").success() {