Skip to content

Add --rust-target to bindgen invocation#3955

Open
UebelAndre wants to merge 3 commits intobazelbuild:mainfrom
UebelAndre:bindgen
Open

Add --rust-target to bindgen invocation#3955
UebelAndre wants to merge 3 commits intobazelbuild:mainfrom
UebelAndre:bindgen

Conversation

@UebelAndre
Copy link
Copy Markdown
Collaborator

No description provided.

user_flags = [f.split("=")[0] for f in ctx.attr.bindgen_flags]

# Ignore `nightly` or `beta` versions.
if rust_toolchain.version and rust_toolchain.version[0].isdigit():
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might suggest that rust_toolchain also gets a channel and iso_date attribute to match the repositor yrule interface and make this data more accessible. Even nightly and beta versions have an associated semver version that could be used in rust_toolchain.version

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I think that would make sense

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit that adds iso_date and channel and added a mapping of iso_date -> version so even nightly toolchains have a registered version.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also cut a separate PR for that: #3957

@UebelAndre UebelAndre marked this pull request as ready for review April 8, 2026 19:05
@UebelAndre UebelAndre requested a review from krasimirgg April 8, 2026 19:06
user_flags = [f.split("=")[0] for f in ctx.attr.bindgen_flags]

# Ignore `nightly` or `beta` versions.
if rust_toolchain.version and rust_toolchain.version[0].isdigit():
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I think that would make sense


# Ignore `nightly` or `beta` versions.
if rust_toolchain.version and rust_toolchain.version[0].isdigit():
# Pass `--rust-target` so bidgen knows the actual toolchain version.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/bidgen/bindgen/

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

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.

2 participants