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

cargo install maturin fails on M1 Mac #1196

Closed
2 tasks
nishaq503 opened this issue Oct 13, 2022 · 5 comments
Closed
2 tasks

cargo install maturin fails on M1 Mac #1196

nishaq503 opened this issue Oct 13, 2022 · 5 comments
Labels
bug Something isn't working documentation Documentation needs improvement

Comments

@nishaq503
Copy link

Bug Description

There is a compilation error with cargo-xwin v0.10.2. I've pasted the error in the "Steps to Reproduce" section. I'm not sure if this issue should be raised here or with xwin.

Your Python version (python -V)

3.9.13

Your pip version (pip -V)

22.2.2

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

I have a MacBook Pro with an M1 Max and my OS is macOS 12.4 21F79 arm64. I have rustc and cargo versions 1.64.0. I tried installing maturin using cargo install maturin. This is the compiler error:

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/cargo-xwin-0.10.2/src/common.rs:238:22
    |
238 |         let pruned = xwin::prune_pkg_list(&pkg_manifest, arches, variants)?;
    |                      ^^^^^^^^^^^^^^^^^^^^--------------------------------- an argument of type `bool` is missing
    |
note: function defined here
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/xwin-0.2.8/src/lib.rs:263:8
    |
263 | pub fn prune_pkg_list(
    |        ^^^^^^^^^^^^^^
help: provide the argument
    |
238 |         let pruned = xwin::prune_pkg_list(&pkg_manifest, arches, variants, /* bool */)?;
    |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/cargo-xwin-0.10.2/src/common.rs:280:47
    |
280 |                 ProgressBar::with_draw_target(0, draw_target.into()).with_prefix(prefix).with_style(
    |                 ----------------------------- ^ expected enum `Option`, found integer
    |                 |
    |                 arguments to this function are incorrect
    |
    = note: expected enum `Option<u64>`
               found type `{integer}`
note: associated function defined here
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/indicatif-0.17.1/src/progress_bar.rs:52:12
    |
52  |     pub fn with_draw_target(len: Option<u64>, draw_target: ProgressDrawTarget) -> ProgressBar {
    |            ^^^^^^^^^^^^^^^^
help: try wrapping the expression in `Some`
    |
280 |                 ProgressBar::with_draw_target(Some(0), draw_target.into()).with_prefix(prefix).with_style(
    |                                               +++++ +

error[E0308]: mismatched types
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/cargo-xwin-0.10.2/src/common.rs:319:57
    |
319 |         let manifest_pb = ProgressBar::with_draw_target(0, dt.into())
    |                           ----------------------------- ^ expected enum `Option`, found integer
    |                           |
    |                           arguments to this function are incorrect
    |
    = note: expected enum `Option<u64>`
               found type `{integer}`
note: associated function defined here
   --> /Users/najibishaq/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/indicatif-0.17.1/src/progress_bar.rs:52:12
    |
52  |     pub fn with_draw_target(len: Option<u64>, draw_target: ProgressDrawTarget) -> ProgressBar {
    |            ^^^^^^^^^^^^^^^^
help: try wrapping the expression in `Some`
    |
319 |         let manifest_pb = ProgressBar::with_draw_target(Some(0), dt.into())
@nishaq503 nishaq503 added the bug Something isn't working label Oct 13, 2022
@konstin
Copy link
Member

konstin commented Oct 13, 2022

Happens platform independently, but it's fixed on main anymore since there it's cargo-xwin 0.11 instead of 0.10.2. You can use cargo install maturin --locked as a workaround for now. The problem is that cargo-xwin 0.10.2 used indicatif 0.17.0-rc.6 but didn't = pin the version, so cargo resolves this to the 0.17.1 release which is incompatible to the release candidate.

@nishaq503
Copy link
Author

Thank you!

messense added a commit that referenced this issue Oct 14, 2022
@messense
Copy link
Member

messense commented Oct 14, 2022

I've updated the docs to use cargo install --locked: https://maturin.rs/installation.html#cratesio

IMO --locked should be preferred to ensure reproducible builds, and to use the exact same set of dependencies that were available when the package was published.

@messense messense added the documentation Documentation needs improvement label Oct 14, 2022
@kaimast
Copy link

kaimast commented Oct 16, 2022

Saw the same issue on Linux. Thanks for posting a workaround!

Did someone already create an issue with cargo-xwin or whatever is causing this?

@messense
Copy link
Member

It's happening because the xwin crate does not adhere to semver because its primary interface is CLI.

cschin added a commit to cschin/bioconda-recipes that referenced this issue Nov 3, 2022
According to this PyO3/maturin#1196, we need to add `--locked` when installing/building `matruin` to
use the correct cargo-xwin version
dpryan79 pushed a commit to bioconda/bioconda-recipes that referenced this issue Nov 3, 2022
* Add https://github.com/Sema4-Research/pgr-tk/issues/4

According to this PyO3/maturin#1196, we need to add `--locked` when installing/building `matruin` to
use the correct cargo-xwin version

* fix, 0.3.4->0.3.6

* using wild card to adapte to whatever version default python used in biocoda
BiocondaBot added a commit to bioconda/bioconda-recipes that referenced this issue Nov 4, 2022
Merge PR #37352, commits were: 
 * Add https://github.com/Sema4-Research/pgr-tk/issues/4 (#37787)

* Add https://github.com/Sema4-Research/pgr-tk/issues/4

According to this PyO3/maturin#1196, we need to add `--locked` when installing/building `matruin` to
use the correct cargo-xwin version

* fix, 0.3.4->0.3.6

* using wild card to adapte to whatever version default python used in biocoda
 * Update pgr-tk to 0.3.6
 * Update meta.yaml
 * Update meta.yaml
 * Update pgr-tk to 0.3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Documentation needs improvement
Projects
None yet
Development

No branches or pull requests

4 participants