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

Maturin's toml parser errors out on dotted keys in Cargo.toml when building sdists #541

Closed
bearcage opened this issue May 17, 2021 · 2 comments · Fixed by #577
Closed

Maturin's toml parser errors out on dotted keys in Cargo.toml when building sdists #541

bearcage opened this issue May 17, 2021 · 2 comments · Fixed by #577
Labels
bug Something isn't working

Comments

@bearcage
Copy link

It looks like something in the sdist build process for Maturin doesn't understand dotted keys in toml files.

Apologies, but I'm on-call this week so I won't be able to dig through Maturin to see what/where for a little while, hence making a bug report issue instead of a fix PR.


Issue Template Q&A

Please provide the following information:

  • Your python version (python -V): N/A (abi3, PYO3_NO_PYTHON)
  • Your pip version (pip -V): N/A (same as above)
    • If this isn't the latest pip version, have you checked using the latest pip version? N/A
  • The version of the bindings you're using, if any (e.g. pyo3, rust-cpython or cffi): Default
  • Does cargo build work? Yes.
  • If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)? Repro'd on macos and linux.

Please list the exact steps required to reproduce your error with all command output and if possible with a repository:

  • Create a new repository with two library crates in it:
demo/
  lib1/
    Cargo.toml
    src/
      lib.rs
  lib2/
    Cargo.toml
    src/
      lib.rs
  • Make the lib1 crate refer to the other by path using dotted keys, like so:
[dependencies]
lib2.path = "../lib2"
  • Maturin will fail with an error like the following (library name changed in this copypaste to match example above / redact internal repo names from my dayjob):
12:02:12  🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.6
12:02:12  🐍 Not using a specific python interpreter (With abi3, an interpreter is only required on windows)
12:02:13  💥 maturin failed
12:02:13    Caused by: Failed to build source distribution
12:02:13    Caused by: Failed to add local dependency lib2 at /build/lib2 to the source distribution
12:02:13    Caused by: Failed to parse Cargo.toml at /build/lib1/Cargo.toml
12:02:13    Caused by: TOML parse error at line 23, column 5
12:02:13     |
12:02:13  23 | lib2.path      = "../lib2"
@bearcage
Copy link
Author

It looks like this limitation comes from the upstream toml_edit:

@messense messense added blocked Something is blocking this bug Something isn't working labels Jun 23, 2021
@messense
Copy link
Member

messense commented Jun 23, 2021

@konstin I don't think we really need a format preserving toml editing tool to do sdist, maybe we should just switch to the toml crate instead.

@messense messense removed the blocked Something is blocking this label Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants