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

Suddenly require Rust and Cargo installed? #8160

Closed
oc-ben-ellis opened this issue Jul 6, 2023 · 12 comments · Fixed by #8161
Closed

Suddenly require Rust and Cargo installed? #8160

oc-ben-ellis opened this issue Jul 6, 2023 · 12 comments · Fixed by #8161
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@oc-ben-ellis
Copy link

  • Poetry version: 1.5.1

  • Python version: 3.11.4

  • OS version and name: WSL2.0 on Windows 11 running Ubuntu

  • pyproject.toml: Not relevant.

  • [*] I am on the latest stable Poetry version, installed using a recommended method.

  • [*] I have searched the issues of this repo and believe that this is not a duplicate.

  • [*] I have consulted the FAQ and blog for any relevant entries or release notes.

  • [*] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Recently we've been getting the below error in our CI environments. It appears there is now a requirement for rust and cargo to be installed in order to run poetry on alpine linux?

To reproduce,

docker run -it --rm alpine:latest /bin/sh -c "apk add python3 py3-pip && pip install poetry"

We get this error,

Collecting rpds-py>=0.7.1 (from jsonschema<5.0.0,>=4.10.0->poetry)
  Downloading rpds_py-0.8.4.tar.gz (15 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/

      Checking for Rust toolchain....
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Workaround is to install rust and cargo,

docker run -it --rm alpine:latest /bin/sh -c "apk add rust cargo python3 py3-pip && pip install poetry"

Installs succesfully.

@oc-ben-ellis oc-ben-ellis added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 6, 2023
@oc-ben-ellis
Copy link
Author

I suspect the issue isn't with poetry itself as I've been using the same version without issue for the last few weeks. I suspect some dependency has been release and upgraded?

@error0x001
Copy link

plus one, the same error

@oc-ben-ellis
Copy link
Author

I should probably mention I noticed that rpds-py has a release earlier this morning BUT this was AFTER we were experiencing problems so I don't think it's that particular dependency causing issues but whatever is using it.

@oc-ben-ellis
Copy link
Author

https://github.com/python-jsonschema/jsonschema/releases/tag/v4.18.0

This is the offender I think. I'll raise an issue there also.

@Secrus
Copy link
Member

Secrus commented Jul 6, 2023

The dependency chain here is: jsonschema -> referencing -> rpds-py. rpds-py doesn't provide wheels for musllinux, which seems to be the core issue.

@Freakazoid182
Copy link

jsonschema added rpds-py 3 hours ago as a new dependency (4.18.0)

@oc-ben-ellis
Copy link
Author

oc-ben-ellis commented Jul 6, 2023

This comment from jsonschema guys,

There's a (indeed intentional) dependency on rust for building from source, and no current MUSL wheels yet. The latter is tracked at crate-py/rpds#6 and just requires some understanding of what to tweak in maturin which hasn't been figured out yet. Help certainly welcome.

@Secrus
Copy link
Member

Secrus commented Jul 6, 2023

Yeah, I have created #8161, we will stay on <4.18 until the issue with MUSL is resolved.

@Secrus
Copy link
Member

Secrus commented Jul 6, 2023

Well, it seems the issue was resolved, Alpine is usable again.

@radoering
Copy link
Member

So we don't need #8161 anymore?

@Secrus
Copy link
Member

Secrus commented Jul 6, 2023

@radoering we do, since we won't be able to install on FreeBSD without having Rust toolchain there. Overall, I would say that for our needs, jsonschema <4.18 should be fine.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@Freakazoid182 @Secrus @radoering @error0x001 @oc-ben-ellis and others