-
Notifications
You must be signed in to change notification settings - Fork 25
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
BISON_PKGDATADIR
breaks when using cmake()
from rules_foreign_cc
#17
Comments
Some investigation notes: The reason
Then the paths work, although obviously the ergonomics aren't great. Using The Bison data directory can't be found in the runfiles because the
Looking into the The reason your override of
I'm not sure how to begin fixing this, or even figure out which repository the fix(es) should be applied to. So for now, I'm going to investigate patching Bison's data lookup code so it incorporates some of the Bazel runfiles lookup logic. |
@mbland With the change to patch Bison to use the Bazel runfiles support library, https://github.com/mbland/rules-bison-pkgdatadir-repro successfully builds with this env = {
"BISON_EXECUTABLE": "$(execpath @bison//bin:bison)",
"M4": "$(execpath @m4//bin:m4)",
}, Could you try pointing your original repository at the current |
Just updated my
Works like a champ, with both Bazel 7.3.2 and 8.0.0-pre.20240911.1! (I know the fix was in commit ce9ddfd, but I'm happy to close this once there's a new release with the fix. (But it's your repo; close it now if you want.) |
Thanks so much! When do you expect to post it to https://registry.bazel.build/modules/rules_bison? |
The BCR PR is bazelbuild/bazel-central-registry#2904, which is blocked by issues with the BCR CI configuration for Java (bazelbuild/bazel-central-registry#2905). According to bzlmod slack, the place to fix their CI would be somewhere in https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/bazel-central-registry/bcr_presubmit.py, but I don't know how long that would take to review or what the release cadence is like for BCR container images. I'll probably poke at |
Thanks for the heads-up. Subscribed to both issues, as well as the corresponding #bzlmod Bazel Slack thread. |
@jmillikin just as a heads-up, I found this issue while trying to compile a project with I've forked @mbland's repro and added a
I'll try to see if I can find something in the Thanks!! P.S. the failure was also present when using |
In that repro, the The relevant code is https://github.com/bazelbuild/bazel/blob/7.3.2/tools/cpp/runfiles/runfiles_src.h#L54-L78 Another option is to add another layer of wrapping, such that
|
@jmillikin I see! Then, I'll go look at |
@jmillikin looks like setting (...)
env = select({
"//conditions:default": {
"PATH": ":".join([
"$$(dirname $$EXT_BUILD_ROOT/$(execpath @python_3_12//:python3))",
"$$(dirname $$EXT_BUILD_ROOT/$(execpath @bison//bin:bison))",
"$$PATH",
]),
"RUNFILES_DIR": "$$EXT_BUILD_ROOT/$(execpath @bison//bin:bison).runfiles/",
},
}),
(...) I'm now getting other errors that I think I can fix to get the repro working! Plus I've tried this in the project I was working and it did compile! Thanks a ton!! |
In Migrating to Bazel Modules (a.k.a. Bzlmod) - Repo Names, Macros, and Variables, I described a problem when using
rules_bison
with thecmake()
rule from rules_foreign_cc.Without defining a custom Make variable as described in that post, and using that to define
BiSON_PKGDATADIR
, the build will fail with:The above output comes from a minimal repo I've created to reproduce the issue: mbland/rules-bison-pkgdatadir-repro
Filing at @jmillikin's request from a thread in the #bzlmod channel of the Bazel slack.
The text was updated successfully, but these errors were encountered: