-
Notifications
You must be signed in to change notification settings - Fork 148
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 set-version --workspace
does not update Cargo.lock
with private crate reference
#891
Comments
Can you provide local reproduction steps? |
I setup a repository that demonstrates the issue. Check out the actions to see what I'm talking about:
Turns out, it fails on For example, this fails: brogdonm/cargo-edit-issue-891@fa566e1 This does not: brogdonm/cargo-edit-issue-891@6da6ddc |
set-version --workspace
does not update Cargo.lock
on Linux like it does on Windowsset-version --workspace
does not update Cargo.lock
with private crate reference
Can you provide local reproduction steps. Meaning without the use of an action |
Yes...
|
When I was originally on Windows running locally, I was not using |
When I ran this I got $ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Cargo.toml
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
diff --git i/Cargo.toml w/Cargo.toml
index a3f8e69..2429eff 100644
--- i/Cargo.toml
+++ w/Cargo.toml
@@ -3,7 +3,7 @@ resolver = "2"
members = [ "cargo-edit-issue-891" ]
[workspace.package]
-version = "0.1.0"
+version = "0.2.0"
authors = [ "Michael Brogdon <[email protected]>" ]
description = "A workspace for reproducing cargo-edit issue 891"
edition = "2021"
$ cargo check
Updating git repository `https://github.com/brogdonm/private-crate`
error: failed to get `private-crate` as a dependency of package `cargo-edit-issue-891 v0.2.0 (/home/epage/src/personal
/dump/cargo-edit-issue-891/cargo-edit-issue-891)`
Caused by:
failed to load source for dependency `private-crate`
Caused by:
Unable to update https://github.com/brogdonm/private-crate?branch=main#f33c4b65
Caused by:
failed to fetch into: /home/epage/.cargo/git/db/private-crate-2edb19a8c0a6874c
Caused by:
failed to authenticate when downloading repository
* attempted to find username/password via git's `credential.helper` support, but failed
if the git CLI succeeds then `net.git-fetch-with-cli` may help here
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
failed to acquire username/password from local configuration
If this is what you are seeing, I'm not sure what there is we can do about this. |
@epage first off, thanks for your prompt replies and help. Second off, yes, this is what I'm seeing. It seemed like this was an issue with the crate since I'm just attempting to update the version of the local crate. Even if I add Should this issue be filed with a different crate perhaps? If so, which one does the issue belong with? |
From what I understand, there is no bug to fix. Cargo itself requires everything in the lockfile to be accessible. Usually that means from the original source while |
@epage would it be possible to produce an error? The silence is deafening. :) If I do In the meantime, we will work around this by making sure we have the token in place for access. Thanks for your support. |
#819 is when we first adopted the code that calls into I remember needing to do this for a reason but I don't recall the reason and not seeing any notes. I'm assuming erroring for the lockfile generation should be fine though. As I have priorities elsewhere at the moment, I likely won't get to it for a bit but would gladly accept a contribution that changes the lockfile generation code to pass the error up. btw so far I've seen little interest in this tool and so I haven't been putting much attention to it generally. For example,, no one has initiated the conversation on the cargo repo on whether this should be merged into cargo like |
Apparently, when using the
cargo set-version --workspace
command in GitHub actions using a linux runner, theCargo.lock
file does not get updated with the updated version. When running on Windows, my WIP has aCargo.toml
andCargo.lock
change. In our scenario, the repository using the action is setup to use workspaces.Update:
Apparently, the issue recreates for
windows-latest
runners too. I could only recreate the issue in my sample repository once I added a private crate.This is with the latest version:
0.12.2
The text was updated successfully, but these errors were encountered: