hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.
Other
659 stars 109 forks source link

Hermetic Python commit breakage #157

Closed lalten closed 8 months ago

lalten commented 8 months ago

Like @Attempt3035 noticed in https://github.com/hedronvision/bazel-compile-commands-extractor/commit/0e5b1aa26d87a431d2a52676d0b9ce469448ee54#commitcomment-136462555 that commit caused a regression:

ERROR: error loading package under directory '': error loading package 'path/to/pkg': at /mnt/data/bazel-user-root/27884f8c6ca1cf5fd7f4e20c15176f40/external/hedron_compile_commands/refresh_compile_commands.bzl:61:6: Unable to find package for @python_3_11//:defs.bzl: The repository '@python_3_11' could not be resolved: Repository '@python_3_11' is not defined.

We're still on Python 3.8, and there is no 3.11

lalten commented 8 months ago

Funny enough I ran into a similar thing with rules_appimage the other day, and asked in Bazel Slack: https://bazelbuild.slack.com/archives/CA306CEV6/p1704300901665709 One workaround seems to be something like https://github.com/lalten/rules_appimage/pull/115

cpsauer commented 8 months ago

Thanks for the friendly heads, guys. I'm so sorry about that--I'd intended to support bzlmod and realized I had a bug in my test setup 🤦🏻

I've been experimenting with fixes for the past bit. I think I've got something. I'll get back to you soon.

cpsauer commented 8 months ago

Should be fixed--but please test and let me know! Again, sorry guys, and thanks for letting me know.

Luke, thanks also for your offer of help. Please know that if you see something like this, I'd always love your help fixing and really appreciate your great bzlmod setup and contributions. I will, of course, try my best to not let more of these get through in the future.

Attempt3035 commented 8 months ago

No worries, will give it a go tonight! Thanks for such a quick development turnaround! Sorry I didn't have a chance to jump in and help, been preoccupied trying to get https://github.com/bazelbuild/bazel-central-registry/pull/1280 working😝

cpsauer commented 8 months ago

I saw that you'd created something there! Will that obsolete rules_boost, do you think?

Attempt3035 commented 8 months ago

That's the idea😜 It will be far more modular and maintainable, and should be a faster and more efficient solution as only required deps will be downloaded and built. Still working on a transition solution for everyone using the workspace boost rules (which are great, and a lot of the code for the new bzlmod modules comes from). Trying to implement all the original boost tests into it too, so it should be a bit more thorough and complete. Also working on some maintenance tools at https://github.com/dynacondev/boost.rules.tools for bumping versions, creating the patch files and calculating integrity as it's a pain to do manually while developing every time something changes!

cpsauer commented 8 months ago

Definitely! Thanks for your good care on maintenance tools; I know I've spent many an evening working on fixing things there. Also set up lots of automation to help keep everything up-to-date by default; not sure if there's an equivalent.

Attempt3035 commented 8 months ago

Good point! Will look into automations a bit further down the line👍

Attempt3035 commented 8 months ago

Confirmed bzlmod support is fixed in newest commit, thank you! Also got the warning: DEBUG: /private/var/tmp/_bazel_lukea/b010c5e57725766be1c569e8ff75e29e/external/rules_python~0.28.0/python/private/bzlmod/python.bzl:44:10: WARNING: Ignoring toolchain 'python_3_11' from module 'rules_python': Toolchain 'python_3_11' from module 'hedron_compile_commands' already registered Python version 3.11 and has precedence Which shouldn't be an issue, we do indeed want the already registered one from bzlmod to take precedence if I understand correctly 👍