Skip to content
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

Fix wrong platform tag when building in armv7 docker container on aarch64 host #1303

Merged
merged 1 commit into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Bump MSRV to 1.62.0 in [#1297](https://github.com/PyO3/maturin/pull/1297)
* Fix build error when required features of bin target isn't enabled in [#1299](https://github.com/PyO3/maturin/pull/1299)
* Fix wrong platform tag when building in i386 docker container in [#1301](https://github.com/PyO3/maturin/pull/1301)
* Fix wrong platform tag when building in i386 docker container on x86_64 host in [#1301](https://github.com/PyO3/maturin/pull/1301)
* Fix wrong platform tag when building in armv7 docker container on aarch64 host in [#1303](https://github.com/PyO3/maturin/pull/1303)

## [0.14.2] - 2022-11-24

Expand Down
6 changes: 4 additions & 2 deletions src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,10 @@ impl Target {
let machine = PlatformInfo::new().map(|info| info.machine().into_owned());
let arch = match machine {
Ok(machine) => {
if machine == "x86_64" && self.arch != Arch::X86_64 {
// When running in Docker sometimes uname returns x86_64 but the container is actually x86,
let linux32 = (machine == "x86_64" && self.arch != Arch::X86_64)
|| (machine == "aarch64" && self.arch != Arch::Aarch64);
if linux32 {
// When running in Docker sometimes uname returns 64-bit architecture while the container is actually 32-bit,
// In this case we trust the architecture of rustc target
self.arch.to_string()
} else {
Expand Down