-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails with unrecognized command-line option '-arch'
when cross-compiling
#93
Comments
The
And
|
Upgrading from CMake 3.22.3 to the newly released 3.23.0 (both installed via brew), doesn't help. |
I don't suppose anyone has ideas of what to try next? :-) |
edmorley
added a commit
to heroku/libcnb.rs
that referenced
this issue
Jul 12, 2023
The `flate2` crate supports multiple backends for performing decompression: https://github.com/rust-lang/flate2-rs#backends The default `miniz_oxide` flate2 backend has poor performance in debug builds/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is the `zlib` backend. (This is the backend that the Python CNB already uses.) GUS-W-13745779.
edmorley
added a commit
to heroku/libcnb.rs
that referenced
this issue
Jul 12, 2023
The `flate2` crate supports multiple backends for performing decompression: https://github.com/rust-lang/flate2-rs#backends The default `miniz_oxide` flate2 backend has poor performance in debug builds/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is the `zlib` backend. (This is the backend that the Python CNB already uses.) GUS-W-13745779.
edmorley
added a commit
to heroku/buildpacks-ruby
that referenced
this issue
Mar 1, 2024
The default `miniz_oxide` flate2 backend has poor performance in debug/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is `zlib`. This makes the `flate2` usage in this repo consistent with `libherokubuildpack`, Python CNB, PHP CNB etc.
edmorley
added a commit
to heroku/buildpacks-ruby
that referenced
this issue
Mar 1, 2024
* Bump the rust-dependencies group with 5 updates Bumps the rust-dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [tempfile](https://github.com/Stebalien/tempfile) | `3.9.0` | `3.10.1` | | [thiserror](https://github.com/dtolnay/thiserror) | `1.0.55` | `1.0.57` | | [ureq](https://github.com/algesten/ureq) | `2.9.1` | `2.9.6` | | [clap](https://github.com/clap-rs/clap) | `4.4.18` | `4.5.1` | | [toml](https://github.com/toml-rs/toml) | `0.8.9` | `0.8.10` | Updates `tempfile` from 3.9.0 to 3.10.1 - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](Stebalien/tempfile@v3.9.0...v3.10.1) Updates `thiserror` from 1.0.55 to 1.0.57 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](dtolnay/thiserror@1.0.55...1.0.57) Updates `ureq` from 2.9.1 to 2.9.6 - [Changelog](https://github.com/algesten/ureq/blob/main/CHANGELOG.md) - [Commits](algesten/ureq@2.9.1...2.9.6) Updates `clap` from 4.4.18 to 4.5.1 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.4.18...clap_complete-v4.5.1) Updates `toml` from 0.8.9 to 0.8.10 - [Commits](toml-rs/toml@toml-v0.8.9...toml-v0.8.10) --- updated-dependencies: - dependency-name: tempfile dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: ureq dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * Refresh lockfile * Sort deps in Cargo.toml alphabetically * Make libcnb-test version specifier consistent * Remove unnecessary lint suppression Since the import is now used in the library itself. * Disable unused Cargo features * Switch to the `zlib` flate2 backend The default `miniz_oxide` flate2 backend has poor performance in debug/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is `zlib`. This makes the `flate2` usage in this repo consistent with `libherokubuildpack`, Python CNB, PHP CNB etc. * Add TODO about regex vs fancy-regex --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
edmorley
added a commit
to heroku/buildpacks-jvm
that referenced
this issue
Mar 1, 2024
The default `miniz_oxide` flate2 backend has poor performance in debug/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is `zlib`. This makes the `flate2` usage in this repo consistent with `libherokubuildpack`, Python CNB, PHP CNB etc.
edmorley
added a commit
to heroku/buildpacks-jvm
that referenced
this issue
Mar 1, 2024
* Bump the rust-dependencies group with 6 updates Bumps the rust-dependencies group with 6 updates: | Package | From | To | | --- | --- | --- | | [serde](https://github.com/serde-rs/serde) | `1.0.196` | `1.0.197` | | [tempfile](https://github.com/Stebalien/tempfile) | `3.9.0` | `3.10.1` | | [ureq](https://github.com/algesten/ureq) | `2.9.1` | `2.9.6` | | [thiserror](https://github.com/dtolnay/thiserror) | `1.0.56` | `1.0.57` | | [toml](https://github.com/toml-rs/toml) | `0.8.9` | `0.8.10` | | [semver](https://github.com/dtolnay/semver) | `1.0.21` | `1.0.22` | Updates `serde` from 1.0.196 to 1.0.197 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.196...v1.0.197) Updates `tempfile` from 3.9.0 to 3.10.1 - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](Stebalien/tempfile@v3.9.0...v3.10.1) Updates `ureq` from 2.9.1 to 2.9.6 - [Changelog](https://github.com/algesten/ureq/blob/main/CHANGELOG.md) - [Commits](algesten/ureq@2.9.1...2.9.6) Updates `thiserror` from 1.0.56 to 1.0.57 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](dtolnay/thiserror@1.0.56...1.0.57) Updates `toml` from 0.8.9 to 0.8.10 - [Commits](toml-rs/toml@toml-v0.8.9...toml-v0.8.10) Updates `semver` from 1.0.21 to 1.0.22 - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](dtolnay/semver@1.0.21...1.0.22) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: tempfile dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies - dependency-name: ureq dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rust-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * Refresh lockfile * Disable unused default Cargo features * Switch to the `zlib` flate2 backend The default `miniz_oxide` flate2 backend has poor performance in debug/under QEMU: rust-lang/flate2-rs#297 Ideally we'd use the fastest `zlib-ng` backend, however it fails to cross-compile: rust-lang/libz-sys#93 As such we have to use the next best alternate backend, which is `zlib`. This makes the `flate2` usage in this repo consistent with `libherokubuildpack`, Python CNB, PHP CNB etc. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi :-)
Has anyone seen anything like this before when cross-compiling on an M1 Mac?
This cross-compile configuration works successfully for a variety of other crates, however this is the first crate I'm using that uses CMake, so I'm not sure if it's a
libz-sys
specific problem, or with cross-compiling with CMake and this toolchain in general.Steps to reproduce
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl
(to install this cross-compile toolchain)brew install cmake
(sincelibz-sys
requires it)rustup target add x86_64-unknown-linux-musl
cargo new testcase-libz-sys-cross-compile && cd_
cargo build --target x86_64-unknown-linux-musl
Expected
The build completes successfully (like it does on this machine, when not cross-compiling).
Actual
The build fails with:
Environment
libz-sys
: 1.1.5cmake
: 0.1.48pkg-config
: 0.3.24The text was updated successfully, but these errors were encountered: