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

alr publish refuses to build if a crate with same name/version exists in the loaded index #1083

Closed
stcarrez opened this issue Jul 9, 2022 · 3 comments
Labels
cost: 0-trivial Minimal changes required (<1h) type: enhancement Improvements to existing functionality

Comments

@stcarrez
Copy link
Contributor

stcarrez commented Jul 9, 2022

I have a local index where I populate several project crates before publishing widely.

alr index
# NAME      URL                                                         PATH                                              
1 community git+https://github.com/alire-project/alire-index#stable-1.2 /home/ciceron/.config/alire/indexes/community/repo
2 local     file:///src/awa/alire-index-local                           /src/awa/alire-index-local

At some time in the publish process, it is necessary to re-publish to fix issues but when you do so, you'll get the error:

alr publish
✓ Local repository is clean.
error: Target release elada=1.8.4 already exist in a loaded index

and I have to remove the crate from my local repository to be able to run the command.

The -f (force) option does nothing.
May be Alire should:

  • honor the -f option and ignore that error,
  • don't report an error if the crate+version is found in a local repository
@stcarrez
Copy link
Contributor Author

stcarrez commented Jul 9, 2022

I've managed to hack alire and make the -f option being taken into account.

It works like a charm :-)

@mosteo mosteo added type: enhancement Improvements to existing functionality cost: 0-trivial Minimal changes required (<1h) labels Jul 11, 2022
@mosteo
Copy link
Member

mosteo commented Jul 11, 2022

Thanks for the report, Stephane. Probably in this case we should check that the release doesn't exist taking into account only the community index. This is not a trivial change though with our current loading infrastructure.

As for making this an overridable error with --force, it can certainly be an interim solution.

stcarrez added a commit to stcarrez/alire that referenced this issue Aug 3, 2022
When publishing and checking for existing crate with same version,
if the crate already exist and the force option is used,
emit a warning message and continue.
mosteo pushed a commit that referenced this issue Aug 3, 2022
)

* Honor the --force option when publishing a crate (#1083)

When publishing and checking for existing crate with same version,
if the crate already exist and the force option is used,
emit a warning message and continue.

* Use Recoverable_Error to report that a crate version already exists
mosteo pushed a commit that referenced this issue Aug 8, 2022
)

* Honor the --force option when publishing a crate (#1083)

When publishing and checking for existing crate with same version,
if the crate already exist and the force option is used,
emit a warning message and continue.

* Use Recoverable_Error to report that a crate version already exists
@stcarrez
Copy link
Contributor Author

The --force option works for that purpose so there is no need to keep this opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cost: 0-trivial Minimal changes required (<1h) type: enhancement Improvements to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants