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

Building with maturin in manylinux fails because of missing PYO3_CROSS_LIB_DIR #1264

Closed
marco-c opened this issue Nov 5, 2020 · 7 comments · Fixed by #1267
Closed

Building with maturin in manylinux fails because of missing PYO3_CROSS_LIB_DIR #1264

marco-c opened this issue Nov 5, 2020 · 7 comments · Fixed by #1267

Comments

@marco-c
Copy link

marco-c commented Nov 5, 2020

The command which is failing is at https://github.com/mozilla/pyo3-parsepatch/blob/e531232ee6760a9fe7f2bca24905fae626c51495/Dockerfile#L41 (maturin build --target x86_64-unknown-linux-musl --manylinux off).

error: failed to run custom build command for `pyo3 v0.12.3`

Caused by:
  process didn't exit successfully: `/rs_pp/target/debug/build/pyo3-a884c8252d1eb1d1/build-script-build` (exit code: 1)
  --- stderr
  Error: "Must provide PYO3_CROSS_LIB_DIR environment variable when cross-compiling"
warning: build failed, waiting for other jobs to finish...
error: build failed
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --target x86_64-unknown-linux-musl --`

It used to work with pyo3 0.9.2.

@kngwyu
Copy link
Member

kngwyu commented Nov 7, 2020

Unfortunately, we actually need this variable and the previous behavior is a kind of bug.
See https://pyo3.rs/v0.12.3/building_and_distribution.html#cross-compiling for more.

@davidhewitt
Copy link
Member

I'm not sure whether we do? This is probably a case like 32-bit windows where it's possible to be building for a target different than the host toolchain. We can potentially check and allow this in build.rs.

@marco-c
Copy link
Author

marco-c commented Nov 8, 2020

I'm not sure whether we do? This is probably a case like 32-bit windows where it's possible to be building for a target different than the host toolchain. We can potentially check and allow this in build.rs.

That's what I was thinking as well.

@marco-c
Copy link
Author

marco-c commented Nov 12, 2020

@davidhewitt could you make a new release which contains this fix?

@davidhewitt
Copy link
Member

We already have breaking changes on the pyo3 master so we can't do this without calling it 0.13 - @kngwyu what do you think? I'd ideally like to give us more time to test and clean up the ABI3 changes before we release, though TBH it seems to have been fine overall.

@marco-c are you willing to pin to a git commit for now? e.g.

[dependencies]
pyo3 = { git = "https://github.com/Pyo3/pyo3.git", rev = "470716e" }

@marco-c
Copy link
Author

marco-c commented Nov 12, 2020

Yeah, I can do that for now. I just need to remember to update to stable again (I'm used to rely on Dependabot, IDK what it does when you pin to a specific commit).

marco-c added a commit to mozilla/pyo3-parsepatch that referenced this issue Nov 12, 2020
This revision of pyo3 contains a fix for PyO3/pyo3#1264.
@kngwyu
Copy link
Member

kngwyu commented Nov 12, 2020

At least we need to have some consensus on #1263. But I don't think we are far from the release.

marco-c added a commit to mozilla/pyo3-parsepatch that referenced this issue Nov 12, 2020
This revision of pyo3 contains a fix for PyO3/pyo3#1264.
marco-c added a commit to mozilla/pyo3-parsepatch that referenced this issue Nov 12, 2020
* Bump pyo3 from 0.9.2 to 0.12.3

Fixes #30

* Pin to pyo3 470716e

This revision of pyo3 contains a fix for PyO3/pyo3#1264.

* Add a comment in Cargo.toml pointing to the pyo3 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants