Closed mmorel-35 closed 1 month ago
Thank you very much for your contribution, but it seems that ci did not pass. I will check the reason why ci failed, but it may take a while.
cc @zyfjeff
I test it on my computer, and it appears that the reason for the build demo failure is due to refresh_compile_commands
being defined in the BUILD file. When hessian2-codec as a module import, it can't load the dependency.
ERROR: error loading package '@@hessian2-codec~//': Unable to find package for @@[unknown repo 'hedron_compile_commands' requested from @@hessian2-codec~]//:refresh_compile_commands.bzl: The repository '@@[unknown repo 'hedron_compile_commands' requested from @@hessian2-codec~]' could not be resolved: No repository visible as '@hedron_compile_commands' from repository '@@hessian2-codec~'.
After I removed the refresh_compile_commands
in the BUILD file, it can build success.
Let's keep this a draft until this https://github.com/bazelbuild/bazel-central-registry/pull/1989 is merged
Thank you very much.
@Lynskylate , that’s ready for your review. There won’t be any change concerning hedron_compile_commands
git-override implict do same action as dev_dependency.
This directive only takes effect in the root module; in other words, if a module is used as a dependency by others, its own overrides are ignored.
This is also the reason why it fails to load refresh_compile_commands
in the demo.
I am still reading the documentation on dev dependencies to see if I should consider loading that target only when in dev dependency mode.
I created this : https://github.com/bazelbuild/bazel-central-registry/pull/2054
I believe adding to the BCR is going to become a necessity.
I may not have been clear.
Because hessian2-codec, as a module, depends on hedron_compile_commandsand
also uses git_override to override this module. Therefore, when the demo module depends on the hessian2-codec
module, the demo cannot find the hedron_compile_commandsand
that the Hessian module depends on.
So if we want to fix the error, Perhaps we could first simply remove the refresh_compile from the hessian2-codec BUILD.
And i have test the different version bazel for the build, it can build in bazel 6.0 but can't work in bazel 7.0+.
Perhaps we could first simply remove the refresh_compile from the hessian2-codec BUILD.
It can be removed if you don't need it but if https://github.com/bazelbuild/bazel-central-registry/pull/2055 get merged we shall be able to make things works.
@Lynskylate, can you retry? This follows @cpsauer's preconisation
I apologize for not responding promptly. I have tested before, and there might be some issues with calculating coverage after migrating to the module. We can merge this PR first, and then I will create another PR to fix this issue.
@zyfjeff @wbpcode If you have no objections, I will merge this pull request first, and then create another pull request later to fix the issues.
The current compilation parameters under the demo will cause a failure, and in addition to this, there is also an incompatibility with coverage.
You could see the action detail. https://github.com/Lynskylate/hessian2-codec/actions/runs/9139284705/job/25131395468
@mmorel-35 Thanks for your contribution.
Signed-off-by: Matthieu MOREL matthieu.morel35@gmail.com