-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
shared: support runtime variable for schema lookup #2657
Conversation
Is this an env var that Cargo sets for execution as well as compile time? In that can this change to simply |
Ah, I thought it wasn't but it appears it is:
(Tested with the following diff) diff --git a/crates/shared/build.rs b/crates/shared/build.rs
index 8e6ea1b0..7de949af 100644
--- a/crates/shared/build.rs
+++ b/crates/shared/build.rs
@@ -22,6 +22,7 @@ fn main() {
}
fn set_schema_version_env_var() {
+ assert_eq!(env!("CARGO_MANIFEST_DIR").to_owned(), env::var("CARGO_MANIFEST_DIR").unwrap());
let cargo_manifest_dir = env::var("CARGO_MANIFEST_DIR").expect(
"The `CARGO_MANIFEST_DIR` environment variable is needed to locate the schema file",
); |
Ok, thanks! |
Thanks @alexcrichton! What's the release cadence look like for |
I generally just release when requested, I'll try to get around to it this week. |
Ok I've published 0.2.76 now |
Thank you so much! And extra thanks for all the amazing work you've done. You're an inspiration to say the least 😄 |
This change fixes a regression in being able to use version
0.2.75
for the Bazel wasm_bindgen rules. Bazel builds each crate in a separate sandbox and as a result, theCARGO_MANIFEST_DIR
path is not consistent between use at runtime and compilation. To work around this, I'm looking for some way to control the lookup of the schema file when thebuild.rs
script is run.The change here allows for the
wasm_bindgen_shared
crate'sbuild.rs
script to allowCARGO_MANIFEST_DIR
to be set at runtime to determine the location of the schema file.