Skip to content

Commit

Permalink
Fix wrong platform tag when building in armv7 docker container on aar…
Browse files Browse the repository at this point in the history
…ch64 host
  • Loading branch information
messense committed Nov 27, 2022
1 parent 8bc4925 commit 64f339a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 64f339a

Please sign in to comment.