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

Add Cargo.lock to workspace root #107

Closed
orhun opened this issue Mar 30, 2021 · 4 comments
Closed

Add Cargo.lock to workspace root #107

orhun opened this issue Mar 30, 2021 · 4 comments
Assignees

Comments

@orhun
Copy link
Contributor

orhun commented Mar 30, 2021

Describe the issue.

According to the cargo workspace documentation, all packages should share a common Cargo.lock file which should be present in the workspace root.

All packages share a common Cargo.lock file which resides in the workspace root.

Also AUR packages will become non-reproducible due to this issue since --locked flag causes the build to fail. (because Cargo.lock doesn't exist in the workspace root)

==> Starting build()...
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /build/gfold/src/gfold-1.0.0/gfld/Cargo.toml
workspace: /build/gfold/src/gfold-1.0.0/Cargo.toml
    Updating crates.io index
error: the lock file /build/gfold/src/gfold-1.0.0/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
==> ERROR: A failure occurred in build().

Solution is simply removing Cargo.lock from .gitignore and pushing it.

Is this about gfold, gfld, or both?

Both, about Cargo workspaces.

Is this a bug report, feature request, or another type of issue?

Bug report.

Paste the output of the relevant application(s).

# to reproduce the build error
git clone "https://aur.archlinux.org/gfold-git"
cd gfold-git/
extra-x86_64-build
@nickgerace
Copy link
Owner

nickgerace commented Mar 30, 2021

Thanks @orhun. I'll get to work on this soon in my free time.

@nickgerace
Copy link
Owner

nickgerace commented Mar 30, 2021

@orhun the fix has been added to main: e2738b2

Next step: Would it be best for you if I tagged 1.0.1 and we skipped 1.0.0 in the AUR, or would you prefer that we fix 1.0.0? My objection to the second option would be that crates.io already has 1.0.0 out and I would need to republish the crate, but I'm willing to do either.

Side note: apologies, I accidentally closed the issue. Please disregard that.

@orhun
Copy link
Contributor Author

orhun commented Mar 30, 2021

@orhun the fix has been added to main: e2738b2

Thanks!

if I tagged 1.0.1 and we skipped 1.0.0 in the AUR

That's totally fine.

Side note: apologies, I accidentally closed the issue. Please disregard that.

No problem!

P.S. You might want to add --locked flag to cargo commands in your CI just to check if Cargo.lock is up-to-date. Otherwise I might have to open up other issue(s) and ping you just for that in the future. ref: bf0e607

@nickgerace
Copy link
Owner

Ok great! Added the --locked flag back to CI and tagged 1.0.1.
We should be good to go!

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

2 participants