-
Notifications
You must be signed in to change notification settings - Fork 2.6k
cargo-credential-libsecret: load libsecret only once #15295
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
Conversation
The main thing I'm wondering is if this is the right layer of caching. Alternatively, we could lazy load these fields in A potential way to side step any of that is for us to not load the library multiple times. It looks like during |
Thanks for your feedback.
I will check
This would be a good optimization, but it wouldn't fully resolve the issue. I discovered that libsecret is also loaded multiple times when multiple registries are present. By the way, should i open a issue too? |
Let's keep things simple for the first pass and put the |
@rustbot author Let us know if you have any question! |
Reminder, once the PR becomes ready for a review, use |
600114f
to
880d445
Compare
c9d4fa0
to
b8a0b68
Compare
@rustbot ready Sorry for the delay, I was busy with a lot of other stuff and forgot about this. |
b8a0b68
to
a156e31
Compare
@@ -83,7 +83,9 @@ mod linux { | |||
... | |||
) -> *mut gchar; | |||
|
|||
pub struct LibSecretCredential; | |||
pub struct LibSecretCredential { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: its a big help for reviewers to split up commits. In this case, I'd do
- Version bump
- Switch to
LibSecretCredential
owninglibsecret
- Add the
OnceLock
I mention this more for future reference to the point that I wasn't going to mention it if there wasn't other feedback to avoid you doing extra churn on this without a reason.
Previously, LibSecretCredential was created multiple times and with it libsecret was loaded and unloaded multiple times, leading to issues where calls could run indefinitely due to glib not properly cleaning up. Now, LibSecretCredential is stored in a OnceLock, ensuring it is only created once, preventing unnecessary unload/reload cycles of libsecret.
a156e31
to
b881a32
Compare
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost try-job: test-various
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Update cargo 18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51 2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000 - fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640) - Update "time out" to "timeout" (rust-lang/cargo#15637) - fix(workspace): reload current manifest path member only (rust-lang/cargo#15633) - Update dependencies (rust-lang/cargo#15635) - fix(publish): Don't tell people to ctrl-c without knowing consequences (rust-lang/cargo#15632) - refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631) - fix(package): Skip registry check if its not needed (rust-lang/cargo#15629) - Add --offline for comp (rust-lang/cargo#15623) - cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295) - test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628) - fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626) - docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572) - Remove double reference in Shell::print_json (rust-lang/cargo#15460) - fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614) - test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621) - fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617) - Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281) - chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616) r? ghost
Previously, libsecret was repeatedly loaded and unloaded—at least twice during cargo login (once for action get and once for action login). This caused issues where calls could hang indefinitely due to glib failing to clean up properly (some threads still running after unloading) and generating numerous error messages:
Now, libsecret is stored in a OnceLock, ensuring it is only loaded once, preventing unnecessary unload/reload cycles.
Fixes #15603