Skip to content

Registry update failures should throw or return status #4244

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

Open
omus opened this issue May 22, 2025 · 2 comments · May be fixed by #4245
Open

Registry update failures should throw or return status #4244

omus opened this issue May 22, 2025 · 2 comments · May be fixed by #4245

Comments

@omus
Copy link
Member

omus commented May 22, 2025

When using Pkg.Registry.update() if a registry fails to be updated an error is logged but there is no exception or return value to indicate this. This can make it difficult to work with this function call in automated scripts such as Dockerfiles where you may want to abort immediately if registries fail to update:

...
#14 1.239     Updating registry at `/usr/local/share/julia-depot/registries/Private`
#14 1.275     Updating git-repo `https://github.com/.../PrivateRegistry.git`
#14 1.621 Username for 'https://github.com' [git]:     Updating registry at `/usr/local/share/julia-depot/registries/General.toml`
#14 1.816 ┌ Error: Some registries failed to update:
#14 1.816 │     — /usr/local/share/julia-depot/registries/Private — failed to fetch from repo: failed to fetch from https://github.com/../PrivateRegistry.git, error: GitError(Code:EUSER, Class:Callback, Aborting, user cancelled credential request.)
#14 1.816 └ @ Pkg.Registry /usr/local/julia/share/julia/stdlib/v1.10/Pkg/src/Registry/Registry.jl:528
#14 2.026 ┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.11.5). Unexpected behavior may occur.
#14 2.026 └ @ /project/Manifest.toml:0
...
@DilumAluthge
Copy link
Member

It looks like the manual doesn't currently say what the behavior of the function will be if the update fails.

So I wonder if we could make it throw, and call that a non-breaking change.

@DilumAluthge
Copy link
Member

Technically, we'd be introducing an exception where there wasn't one before, but given that we didn't promise (in the manual) that the function wouldn't throw, maybe it's okay?

@DilumAluthge DilumAluthge linked a pull request May 22, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants