-
Notifications
You must be signed in to change notification settings - Fork 152
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
1.5.0 breaks h2 build #144
Comments
I suppose your lock file had an older version before, but do you have any idea what that was? You could try You say Windows works, so what is the target which fails? If that's using cross or a custom spec, it could be related to cuviper/autocfg#15. Right now |
@cuviper that's exactly what happened, Cargo.lock was old. Windows works and Now a strange thing happened. I tried to build the repo with |
I'd close this issue because I think it should be in autocfg repo. Thanks for help to you @cuviper and few people from the discord server. Edit: If I can help somehow let me know. |
Ultimately, whether the issue is here or in autocfg, I'm going to need a way to reproduce the failure. If you're doing something with with rustc flags that's not picked up by autocfg, that's the known issue, otherwise I don't know what's wrong. |
Fortunately, it was fresh Ubuntu 18.04 on WSL initialized with a single script so you can reproduce this. [dependencies.hyper]
version = "^0.13.7"
features = ["runtime", "stream"] #!/bin/sh
sudo add-apt-repository -y ppa:avsm/ppa
sudo apt-get update &&
sudo apt-get install -qy \
m4 \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
build-essential \
git \
wget patch diffutils zlib1g-dev libtinfo-dev \
opam libffi-dev \
pkg-config libssl-dev python3.8 python3.8-dev python3-pip &&
sudo apt-get clean autoclean &&
sudo apt-get autoremove -y
echo "alias python3=python3.8" >>$HOME/.bashrc
python3.8 -m pip install --upgrade pip
python3.8 -m pip install -r requirements-dev.txt
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -qy docker-ce docker-ce-cli containerd.io
sudo usermod -a -G docker $USER
# Rust
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-07-27 --no-modify-path -y
echo "source $HOME/.cargo/env" >>$HOME/.bashrc
source $HOME/.cargo/env
rustup component add rls rust-analysis rust-src
wget https://github.com/Kitware/CMake/releases/download/v3.11.0/cmake-3.11.0-Linux-x86_64.tar.gz
mkdir -p /tmp/cmake
tar -xf cmake-3.11.0-Linux-x86_64.tar.gz -C /tmp/cmake
sudo cp -r /tmp/cmake/cmake-3.11.0-Linux-x86_64/bin /usr/
sudo cp -r /tmp/cmake/cmake-3.11.0-Linux-x86_64/share /usr/
sudo cp -r /tmp/cmake/cmake-3.11.0-Linux-x86_64/doc /usr/share/
sudo cp -r /tmp/cmake/cmake-3.11.0-Linux-x86_64/man /usr/share/
rm -rf cmake-3.11.0-Linux-x86_64.tar.gz /tmp/cmake
opam init -a --disable-sandboxing
opam install -y dune core core_bench alcotest conf-rust-2018 ppx_jane cohttp lwt odoc torch || true
eval $(opam env)
echo "eval \$(opam env)" >>$HOME/.bashrc |
I'm running Fedora 32, but I tried your setup in a
I don't have the file for this step -- pressing on...
Are you suggesting an new project with just that dependency? Because this worked fine for me.
This fickle behavior makes me wonder if it's a problem with WSL, like a race in the filesystem or something. If you manage to get back to a failed build, you can try to see what the build script did -- I get:
|
I removed $ cat target/debug/build/indexmap-*/output
cargo:rustc-cfg=has_std
cargo:rerun-if-changed=build.rs
$ cat target/debug/build/indexmap-*/stderr Looks like I myself cannot reproduce that. Did I miss removing any directory?
I was using the rust language server on vscode through WSL, maybe that could be the reason. It is highly likely that the problem is related to WSL more than anything. I will re-install Ubuntu again. |
It failed with the same error. $ cat target/debug/build/indexmap-*/output
cat: 'target/debug/build/indexmap-*/output': No such file or directory
$ cat target/debug/build/indexmap-*/stderr
cat: 'target/debug/build/indexmap-*/stderr': No such file or directory Maybe you could try changing cargo to
Edit: I also skipped Edit: FYI
|
If those don't exist, it's as if the build script didn't run at all... 😕
In my container I used the exact nightly you specified:
|
@cuviper before posting an issue I tried with fresh ubuntu twice: once with All following commands would fail with same error: $ cargo test --release
(error)
$ cargo test
(error)
$ cargo check
(error) I did (all in a mounted directory): $ rm -rf ~/.cargo/registry
$ rustup toolchain install stable
$ rustup default stable
$ cargo test
(lots of errors about features not supported on stable)
For more information about this error, try `rustc --explain E0554`.
error[E0107]: wrong number of type arguments: expected 3, found 2
--> /home/pah/.cargo/registry/src/github.com-1ecc6299db9ec823/h2-0.2.6/src/proto/streams/store.rs:15:10
|
15 | ids: IndexMap<StreamId, SlabIndex>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 type arguments
error: aborting due to previous error
For more information about this error, try `rustc --explain E0107`.
error: build failed
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /home/pah/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu (default)
nightly-2020-07-27-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
active toolchain
----------------
stable-x86_64-unknown-linux-gnu (default)
rustc 1.45.0 (5c1f21c3b 2020-07-13) Now in $ rustup default stable
$ git clone https://github.com/hyperium/hyper.git
$ cargo test --features stream --features runtime
(...)
test result: ok. 18 passed; 0 failed; 6 ignored; 0 measured; 0 filtered out I copied my repo to |
I've seen issues with Windows virtual drives before: rust-lang/rust#54216 |
Does autocfg rely in any way on file system modification time? |
I got something! $ cat target/debug/build/indexmap-*/output
cargo:rerun-if-changed=build.rs
$ cat target/debug/build/indexmap-*/stderr
error: could not copy "/mnt/d/crypto-market/cxmr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe0.probe0.3a1fbbbh-cgu.0.rcgu.ll" to "/mnt/d/crypto-market/cx
mr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe0.ll": Operation not permitted (os error 1)
error: aborting due to previous error
error: could not copy "/mnt/d/crypto-market/cxmr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe1.probe1.3a1fbbbh-cgu.0.rcgu.ll" to "/mnt/d/crypto-market/cx
mr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe1.ll": Operation not permitted (os error 1)
error: aborting due to previous error
warning: autocfg could not probe for `std`
error: could not copy "/mnt/d/crypto-market/cxmr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe2.probe2.3a1fbbbh-cgu.0.rcgu.ll" to "/mnt/d/crypto-market/cx
mr/cxmr-master/cxmr/target/debug/build/indexmap-62ff17e61db67c74/out/probe2.ll": Operation not permitted (os error 1)
error: aborting due to previous error
|
It tries to copy a file which doesn't exist. The directory does exist though. $ ls -lh target/debug/build/indexmap-62ff17e61db67c74/out
total 0
-rwxrwxrwx 1 root root 0 Jul 30 21:07 probe0.ll
-rwxrwxrwx 1 root root 0 Jul 30 21:07 probe1.ll
-rwxrwxrwx 1 root root 0 Jul 30 21:07 probe2.ll The |
All |
This workaround works and is actually much faster, thanks. |
Ok, great! If you want to chime in on that rust bug or file a new one, feel free, but I don't think there's anything we can really do in |
If you know you need "std", e.g. relying on default `S = RandomState`, then you can enable this feature to force it on, bypassing target detection. This may help scenarios where `autocfg` fails detection, like issue indexmap-rs#144, but at the very least it will speed up the build script by avoiding extra `rustc` invocations.
If you know you need "std", e.g. relying on default `S = RandomState`, then you can enable this feature to force it on, bypassing target detection. This may help scenarios where `autocfg` fails detection, like issue indexmap-rs#144, but at the very least it will speed up the build script by avoiding extra `rustc` invocations.
Just FYI: I got here via the [build]
rustflags = [
"-W", "missing_docs", # detects missing documentation for public members
"-W", "trivial_casts", # detects trivial casts which could be removed
"-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed
"-W", "unsafe_code", # usage of `unsafe` code
"-W", "unused_qualifications", # detects unnecessarily qualified names
"-W", "unused_extern_crates", # extern crates that are never used
"-W", "unused_import_braces", # unnecessary braces around an imported item
"-D", "warnings",
] which causes
with the same result (std not detected, missing 3rd generic parameter on
The solution for this case is to remove the IIUC this is essentially what https://rust-lang.github.io/rfcs/1193-cap-lints.html intends to avoid, so the solution would probably be to have |
@Xiphoseer can you open an issue on For |
After re-installing my environment I'm getting an error on same code base:
Is there a way to somehow set
has_std
for indexmap crate so deep in dependency tree?Edit: It works on windows.
The text was updated successfully, but these errors were encountered: