Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

reference to target crate missing? #40

Open
s7m0n opened this issue Aug 28, 2020 · 5 comments
Open

reference to target crate missing? #40

s7m0n opened this issue Aug 28, 2020 · 5 comments

Comments

@s7m0n
Copy link

s7m0n commented Aug 28, 2020

Being new to cargo & rust and trying to understand this i tried it on zoxide and du-dust (https://github.com/ajeetdsouza/zoxide, https://github.com/bootandy/dust).

In both cases it seems that when i follow the steps as described i get a good ebuild but the references to the package sources or the crate of the same is missing. Therefore i get a "error: could not find Cargo.toml in ..." for these when calling 'build'.
I can then add the package+version to the list of crates or add a reference to SRC_URI "https://github/user/{P}/archive/v${PV}.tar.gz -> ${P}.tar.gz" as i've seen it in another package.

I wanted to check if that is intended to be (then sorry for the question, might be worth mentioning in the docs) or a issue?
And of course if there is a preferred one of these two solutions.

@cardoe
Copy link
Owner

cardoe commented Aug 29, 2020

No it should reference itself. This appears to be a regression.

@leonardohn
Copy link
Contributor

@cardoe do you think it would be good to add ${HOMEPAGE}/archive/v${PV}.tar.gz -> ${P}.tar.gz by default in SRC_URI? It is GitHub-specific, but would work out of the box for many crates.

@s7m0n
Copy link
Author

s7m0n commented Aug 30, 2020

@leonardohn - tested both ebuilds. Zoxoide works and dust had a mismatch in the name (tar file extracts to dust and not du-dust if i rename the folder and ebuild to just 'dust' it works.
I'm using cargo-ebuild-0.3.1 (newest in portage for now) which does not create the reference to itself. Didn't yet test older versions.

@leonardohn
Copy link
Contributor

@s7m0n I've read your issue a bit too fast and thought there were problems with other packages as well, thats why I've generated those ebuilds to test. In 0.3.2 there is still no automatic self referencing, although that was the only change I had to do manually, which is good because everything else is working well. So now is just a matter of deciding how to implement this change, and as you pointed out about du-dust, there is room for further improvements when the crate name differs from the repository name.

@cardoe
Copy link
Owner

cardoe commented Aug 30, 2020

I'm not a fan of the defaulting to GitHub style URLs. Many crates aren't hosted on GitHub and many don't match name wise as we've seen. I'll likely restore some of the code that was stripped out previously to identify the self crate to include the download link for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants