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

Fetch directly from crates.io if given a crate name #14

Open
thesamesam opened this issue Jan 26, 2023 · 4 comments
Open

Fetch directly from crates.io if given a crate name #14

thesamesam opened this issue Jan 26, 2023 · 4 comments

Comments

@thesamesam
Copy link

thesamesam commented Jan 26, 2023

It'd be nice if pycargoebuild could fetch directly from crates.io when given a crate name.

This would be useful for two reasons:

  1. Laziness: right now, I have to grab whatever the ebuild would fetch, unpack it, then run pycargoebuild inside. Lots of effort.
  2. Required for some software: pkgcraft-c's Cargo.toml refers to pkgcraft via a path (../pkgcraft) which neither pycargoebuild nor cargo-ebuild handle properly. Neither end up listing pkgcraft as a dependency. The version downloaded from crates.io does list it properly because cargo mangles it first on upload (or crates.io mangles it before publishing, whatever).

(If you don't like the general idea, consider this a bug report for 2., in that pycargoebuild can't handle pkgcraft-c because of the relative path dep.)

@gyakovlev
Copy link
Member

You don’t need to pre-fetch generally.
Just
cd pkgcraft-c && cargo_src_compile
You dont want to use crate tarball for workspace/vendored source like this, that’s why it’s omitted from CRATES

@mgorny
Copy link
Member

mgorny commented Feb 5, 2023

I suppose this could be done in two steps:

  1. Support specifying URL instead of directory, and unpack it to tmpdir.
  2. Support specifying crate name instead of URL.

Am I missing something?

@thesamesam
Copy link
Author

No, I think you're spot on. Both would be helpful and then together, it solves my bother.

@mgorny
Copy link
Member

mgorny commented Feb 5, 2023

So after spending >1 hour on implementing this, I'm stuck because crates don't have Cargo.lock.

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

No branches or pull requests

3 participants