Skip to content

Flex and Bison toolchain switching stopped working with bazel 8 #2435

@hzeller

Description

@hzeller

To be able to switch to a local --//bazel:use_local_flex_bison

we switch toolchains accordingly

verible/bazel/bison.bzl

Lines 33 to 37 in 98bdb38

cmd = select({
"//bazel:use_local_flex_bison_enabled": "bison --defines=$(location " + header_out + ") --output-file=$(location " + source_out + ") " + " ".join(extra_options) + " $<",
"@platforms//os:windows": "win_bison.exe --defines=$(location " + header_out + ") --output-file=$(location " + source_out + ") " + " ".join(extra_options) + " $<",
"//conditions:default": "M4=$(M4) $(BISON) --defines=$(location " + header_out + ") --output-file=$(location " + source_out + ") " + " ".join(extra_options) + " $<",
}),

verible/bazel/flex.bzl

Lines 27 to 31 in 98bdb38

cmd = select({
"//bazel:use_local_flex_bison_enabled": "flex --outfile=$@ $<",
"@platforms//os:windows": "win_flex.exe --outfile=$@ $<",
"//conditions:default": "M4=$(M4) $(FLEX) --outfile=$@ $<",
}),

This stopped working with bazel 8

ERROR: verible/verilog/parser/BUILD:20:7: //verible/verilog/parser:verilog-lex: attribute "toolchains" is not configurable
ERROR: verible/verible/verilog/parser/BUILD:95:8: //verible/verilog/parser:verilog-y: attribute "toolchains" is not configurable

So for now, let's force bazelversion to 7.x, but ideally this could be reformulated in a way that it works with bazel 7 and 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions