conda-forge / rust-feedstock

A conda-smithy repository for rust.
BSD 3-Clause "New" or "Revised" License
7 stars 28 forks source link

install `rust-src` from conda? #124

Closed AngryMaciek closed 1 year ago

AngryMaciek commented 1 year ago

Comment:

Would it be possible to upload rust-src to Anaconda Cloud too?
We had this issue https://github.com/google/evcxr/issues/222 and it turned out that we are missing src and needed to download it by hand and put inside conda env manually, not a very clean solution...

pkgw commented 1 year ago

@sshockwave has proposed a rust-src package in https://github.com/conda-forge/staged-recipes/pull/21778. I'm not sure if I'll get the chance to review it in detail but the recipe implementation looks pretty straightforward.

Hoeze commented 1 year ago

I think this was fixed in #133, right?

pkgw commented 1 year ago

Yes, that's correct!

KubaOfca commented 1 year ago

Hey, I see that rust-src can be installed as a separate package (not as part of rust), right? @AngryMaciek means he wants rust-src in the rust package or be able to install both. At the moment, trying to install both rust and rust-src results in a conda conflict. rust and rust-src alone are not enough to properly configure the rust kernel in jupyter-server, because that is my and @AngryMaciek's goal. Is it possible to install both rust and rust-src at the same time? Sorry for any misunderstandings and mistakes as I am not a rust developer.

Here is our problem:

[I 2023-05-04 15:55:45.866 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
Error: Failed to find sysroot for Cargo.toml file /tmp/.tmp2ZN3PX/Cargo.toml. Is rust-src installed?

which can be resolved by manually adding rust-src downloaded from https://static.rust-lang.org/dist/2022-05-19/rust-src-1.61.0.tar.gz' and copying to the rustlib.

pkgw commented 1 year ago

Oh, it is certainly the intention that it should be possible to install both of them at the same time! But I agree with you that right now it is not:

$ mamba create -n rusttest rust rust-src
[...]
The following packages are incompatible
[...]
   └─ rust-src 1.69.0 would require
      └─ rust 1.69.0 1, which conflicts with any installable versions previously reported.

I think that there is a problem because rust-src is noarch while the main rust is not, and the pin_subpackage("rust", exact=True) in the rust-src definition might be causing problems? Right now the rust-src package metadata is indeed calling for a match to rust 1.69.0 1 (e.g.), and I think we need to make it not specify the exact build string, since that will vary depending on what platform you're using.