Skip to content

Use flex and bison directly instead from toolchain. - #2524

Open
hzeller wants to merge 1 commit into
chipsalliance:masterfrom
hzeller:feature-20260616-new-flex
Open

Use flex and bison directly instead from toolchain.#2524
hzeller wants to merge 1 commit into
chipsalliance:masterfrom
hzeller:feature-20260616-new-flex

Conversation

@hzeller

@hzeller hzeller commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

The flex toolchain from rules_{bison,flex} do not have a version that works on Windows.

Using these directly simplifies things as well.

Fixes #2435

@hzeller
hzeller force-pushed the feature-20260616-new-flex branch 2 times, most recently from 27de3d8 to c57c014 Compare June 16, 2026 20:35
@hzeller

hzeller commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @UebelAndre I am attempting to use your flex and bison BCR modules as they look promising to get this compiling again beyond bazel 7. The flex part works well, but looks like not all compatibility functions used in bison work on Windows yet.

https://github.com/chipsalliance/verible/actions/runs/27646448734/job/81759530364?pr=2524

(this is the corresponding windows github action).

It runs into trouble with sys/time.h or termios.h. Are you aware if there might be more autoconf flags we could use in the bison BCR that could help ?

@hzeller
hzeller force-pushed the feature-20260616-new-flex branch 2 times, most recently from fab596b to 7a94de8 Compare June 18, 2026 07:33
@hzeller

hzeller commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

Now it looks like we're down to issues in m4; fseeko and ftello seem to be trouble-makers on Windows
https://github.com/chipsalliance/verible/actions/runs/27744063143/job/82077943587?pr=2524#step:7:18

Is there similar autoconf magic you did in bison possible in M4, @UebelAndre ?

@UebelAndre

Copy link
Copy Markdown

Yeah, I’m currently poking around at it but won’t really have bandwidth until later this week

@UebelAndre

Copy link
Copy Markdown

Can you try adding bazel_dep(name = "rules_cc_autoconf", version = "0.15.0") and see if that gets you farther?

@hzeller
hzeller force-pushed the feature-20260616-new-flex branch 3 times, most recently from 3db5cd8 to ac9005c Compare June 25, 2026 08:58
@hzeller

hzeller commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

@UebelAndre

Copy link
Copy Markdown

@hzeller Sorry, for the delay here. I still haven't root caused the issue. Some work is being done to introduce clang-cl and mingw toolchains to rules_cc_autoconf CI at periareon/rules_cc_autoconf#168, if you already have that infra working here, making a PR to add that there will help reveal the root cause.

@hzeller

hzeller commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

In the Verible CI, we do use indeed clang-cl, mostly by choosing the compiler in the .bazelrc (

verible/.bazelrc

Lines 23 to 27 in f3e4d98

# Use clang-cl by default on Windows. MSVC has some issues with the codebase,
# so we focus the effort for now is to have a Windows Verible compiled with
# clang-cl before fixing the issues unique to MSVC.
common:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//:x64_windows-clang-cl
common:windows --compiler=clang-cl --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --client_env=BAZEL_CXXOPTS=/std:c++17
)

What do you mean with 'making a PR there' ?

The flex toolchain from rules_{bison,flex} do not have
a version that works on Windows.

Using these directly simplifies things as well.

Fixes chipsalliance#2435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flex and Bison toolchain switching stopped working with bazel 8

2 participants