Philipp Oppermann

Results 676 comments of Philipp Oppermann

Minimal example: ``` cargo new bar --lib cd bar cargo new foo --lib ``` In `bar/foo/Cargo.toml`: ```toml [features] default = ["use_std"] use_std = [] ``` In `bar/foo/src/lib.rs`: ```rust #[cfg_attr(not(feature =...

I opened https://github.com/rust-lang/cargo/issues/5730 for this.

@cbeck88 I'm not sure how OP is using `libc`, but builds scripts that use std work fine for me, as long as no feature unification takes place. For example, the...

Yes, I don't think there's a way how `cargo-xbuild` can work around https://github.com/rust-lang/cargo/issues/5730. Cargo-xbuild is just a wrapper that builds the sysroot before invoking cargo build. Changing the fundamental dependency...

Try [enabling the unstable `host_dep` feature](https://github.com/rust-lang/cargo/issues/7915#issuecomment-683294870) of cargo, either through a `.cargo/config` file or by passing `-Z host_dep` on the command line.

This sounds more like an issue in rustc/cargo itself, than related to `cargo-xbuild`. We only [invoke `cargo`](https://github.com/rust-osdev/cargo-xbuild/blob/07d65812e7cc1c2e5b14a11f781b23be8333252e/src/sysroot.rs#L95) for the sysroot build, nothing else. So if the wrong linker is used,...

Sounds good to me overall! > This differs from the previous approach of putting the binaries directly in the crates.io release. I couldn't find any specific policy about uploading prebuilts...

Thanks for reporting this issue! Does it also work if you do a `cargo clean` in between?

I think this is a bug of rust itself. Have you tried building this with cargo's built-in [`-Zbuild-std=core,alloc` flag](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) instead of `cargo-xbuild`? You probably need to add a dependency on...

Ah yeah, we deliberately set a `RUSTFLAGS` environment variable to override any `rustflags` keys in `.cargo/config` files: https://github.com/rust-osdev/cargo-xbuild/blob/a779803ab1062ce3e3f864f242b6c45aa02a0332/src/sysroot.rs#L93 Apart from passing `-Cembed-bitcode=yes`, the reason for this is that most of...