-
Notifications
You must be signed in to change notification settings - Fork 105
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
Indexmap Dep Not properly Compiled #114
Comments
Here's the relevant snippet of #[cfg(not(has_std))]
#[macro_use(vec)]
extern crate alloc; It looks like let ac = autocfg::new();
ac.emit_sysroot_crate("std");
autocfg::rerun_path(file!()); From the documentation of autocfg::emit_sysroot_crate, the function "Emits a config value /// Emits a config value `has_CRATE` if `probe_sysroot_crate` returns true.
pub fn emit_sysroot_crate(&self, name: &str) {
if self.probe_sysroot_crate(name) {
emit(&format!("has_{}", mangle(name)));
}
} (Nitty gritty aside: It seem the way this works is the TL;DR: indexmap depends on --cfg has_std, which is populated by the I don't think this build.rs file can work in the context of Bazel. Your best bet is probably to include the config value manually in an "additional_flags" cargo-raze/examples/remote/complicated_cargo_library/cargo/Cargo.toml Lines 19 to 22 in 3b9cb84
|
Ahh great that helped a bunch thanks for clearing that up! Just one more quick question if you could help with that it would be great. |
Yeah, I think you'd need to do something similar. I actually did this work once before for bringing in libsqlite3-sys for rusqlite, and it looks like I decided to totally overwrite the libsqlite3-sys dependency. I can't remember why... Here's the settings for rusqlite: [raze.crates.rusqlite.'0.14.0']
skipped_deps = [
"libsqlite3-sys-0.9.3"
]
additional_deps = [
"@//third_party/cargo/overrides/libsqlite3-sys:libsqlite3_sys"
] And the libsqlite override library: I think the significant changes were:
https://github.com/acmcarther/void/tree/master/third_party/sqlite3 I feel like these Cargo crate transformations should be captured somewhere so we can pool our efforts. I'll think about the best way to accomplish this. Ideas very welcome of course! |
Hey thanks for all the help and sorry for late reply. That was super helpful. We can capture these transformation in a separate repo that just has a folder for the different cargo packages(when needed). Then just link that to the main page here, as one idea. Although I suppose that could be a nightmare with the different cargo package versions. |
Hey when trying to compile with Bazel I get the following error for the Indexmap version-1.3.0 dependency.
The following is the BUILD file generated for said dep.
My rust version is 1.38 and alloc should compile and if not the package build.rs should add the std lib.
Is there a way I can help fix this or anything?
The text was updated successfully, but these errors were encountered: