-
Notifications
You must be signed in to change notification settings - Fork 970
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
post_package hook corrupts packages #5588
Comments
This is something for the |
I think we should change the order of the hook, to allow file creating without breaking manifests. |
I think it is useful to have a hook that is executed after the package is created and the manifest computed, so I would look for a different approach: the hook can tell Conan back if the package has been modified (return True/False value?), the hook itself can recompute the manifest (it would require exposing and documenting internal functions), or we can always add more hooks (I would prefer not to). |
Yes, it might be useful, but right now I cannot think of any example that really needs to have the manifest already computed. We would need to have stronger evidence or users request to support this case. Exposing internal functions to hooks doesn't seem the way to go, and having to rely on the user reminding to return True for correct behavior seems fragile. In the meanwhile, the current approach for the use case that we already have example for (package signing) is broken, so the priority would be to fix it. If the package signing uses the manifest for its creation, it will be broken too when the manifest is recomputed, so wouldn't it be better if the manifest is not there? |
We've been talking a lot in the past about generating quality artifacts after the package has been created (test reports, doxygen,...) and some users may have hooks that are using the packaged folder to generate those artifacts (store them somewhere else). I cannot know if having the manifest there already computed is important or not for those users. I totally agree that there is not a good alternative, but changing this behavior may break someone. Some users will want to execute it before the manifest and others afterward (they might be using the manifest as a sentinel to know that the package is ready or even to mark a package as invalid an prevent the upload). Let me know about the decision and I will write a PR for it. |
Run it by default before the manifest calculation. If any issue or breaking behavior is reported we will think about it. |
As it is done after the manifest is created, examples like the one in the docs:
Will break the manifest, and
conan upload --check
will reject the package as corruptedThe text was updated successfully, but these errors were encountered: