Skip to content

declare CARGO_CFG_(WINDOWS|UNIX) in build scripts#1025

Merged
UebelAndre merged 2 commits intobazelbuild:mainfrom
ankitects:platform-var
Nov 19, 2021
Merged

declare CARGO_CFG_(WINDOWS|UNIX) in build scripts#1025
UebelAndre merged 2 commits intobazelbuild:mainfrom
ankitects:platform-var

Conversation

@dae
Copy link
Contributor

@dae dae commented Nov 18, 2021

These variables are documented as being available:
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

The latest rusqlite depends on CARGO_CFG_WINDOWS to be defined
in order to link correctly: rusqlite/rusqlite#961

@google-cla google-cla bot added the cla: yes label Nov 18, 2021
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

One question probably for my own sake. Also, could you add a test that asserts CARGO_CFG_(WINDOWS|UNIX) is set in the expected cases?

These variables are documented as being available:
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

The latest rusqlite depends on CARGO_CFG_WINDOWS to be defined
in order to link correctly: rusqlite/rusqlite#961
@dae dae force-pushed the platform-var branch 2 times, most recently from 73664c4 to 63e9f4d Compare November 19, 2021 00:31
dae added a commit to ankitects/anki that referenced this pull request Nov 19, 2021
@dae dae requested a review from UebelAndre November 19, 2021 00:46
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Awesome work! Thanks for putting this together 😄

@UebelAndre UebelAndre merged commit 77cffb0 into bazelbuild:main Nov 19, 2021
ddeville pushed a commit to ddeville/rules_rust that referenced this pull request Nov 22, 2021
* declare CARGO_CFG_(WINDOWS|UNIX) in build scripts

These variables are documented as being available:
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

The latest rusqlite depends on CARGO_CFG_WINDOWS to be defined
in order to link correctly: rusqlite/rusqlite#961

* add a test for rustc cfg parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants