Skip to content

Can't test target i686-pc-windows-gnu when -Zdoctest-xcompile flag is present #671

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

Closed
ens-scmeeu opened this issue Mar 23, 2022 · 5 comments

Comments

@ens-scmeeu
Copy link

ens-scmeeu commented Mar 23, 2022

Removing the -Zdoctest-xcompile and it works fine, albeit without doctests. Also, interestingly the x86_64-pc-windows-gnu target is not impacted, so it seems like something with this particular target. I should add this is under WSL2 in case that is relevant with a Ubuntu 20.04 OS.

scott@DESKTOP-26R2LTB:~/IdeaProjects/netapi_v2-rs$ cross +nightly test --target=i686-pc-windows-gnu -Zdoctest-xcompile
Warning: `cross` does not provide a Docker image for target i686-pc-windows-gnu, specify a custom image in `Cross.toml`. Falling back to `cargo` on the host.
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
@Emilgardis
Copy link
Member

Emilgardis commented Mar 24, 2022

Please run cargo +i686-pc-windows-gnu -Vv and paste the output here. Please tell us what version of cross you're using also

if it reports an old version, update the rustup toolchain with

rustup update i686-pc-windows-gnu or whatever toolchain was actually used

Note that cross on crates.io is very outdated now, preferably you should use current main, you'll need to specify the image used manually though. https://github.com/cross-rs/cross#custom-docker-images

[target.i686-pc-windows-gnu]
image = "ghcr.io/cross-rs/i686-pc-windows-gnu:edge"

to update cross: cargo install cross --git https://github.com/cross-rs/cross

There is a note that the command is not run with cross, it's all passed through to cargo. Use cross -vv <command> to see what is happening in the background.

Reading a bit further into the error message, you'll see that the issue is that the i686-pc-windows-gnu target is using a stable compiler and the flag is not usable there. You'll need to change the rustup target to be nightly, or specify the nightly toolchain.

This is not strictly a cross issue. But maybe we can improve the UX here, I've had the same confusion when having an old toolchain installed for a certain target

@ens-scmeeu
Copy link
Author

Thanks for your quick reply, but I'm a bit confused.

Please run cargo +i686-pc-windows-gnu -Vv and paste the output here. Please tell us what version of cross you're using also

if it reports an old version, update the rustup toolchain with

rustup update i686-pc-windows-gnu or whatever toolchain was actually used

My cross version is v0.2.1 installed yesterday via cargo install cross

I don't have +i686-pc-windows-gnu target installed, that is why I'm using cross in the first place. Did you mean to type cross +i686-pc-windows-gnu -Vv? (which just gives invalid toolchain error). Are you suggesting to update the toolchain in the docker container (but doesn't cross maintain these?)? Again, not sure I follow what you are suggesting.

Note that cross on crates.io is very outdated now, preferably you should use current main, you'll need to specify the image used manually though. https://github.com/cross-rs/cross#custom-docker-images

[target.i686-pc-windows-gnu]
image = "ghcr.io/cross-rs/i686-pc-windows-gnu:edge"
to update cross: cargo install cross --git https://github.com/cross-rs/cross

If it is so outdated shouldn't a new release be made? (early/often and all that) Regardless, this seems to have broken cross entirely (for ALL my targets - all the scripts for other targets I wrote yesterday that were working fine now report the same error):

scott@DESKTOP-26R2LTB:~/IdeaProjects/netapi_v2-rs$ cross test --target=i686-pc-windows-gnu
Unable to find image 'ghcr.io/cross-rs/i686-pc-windows-gnu:0.2.1' locally
docker: Error response from daemon: manifest unknown.
See 'docker run --help'.

Reading a bit further into the error message, you'll see that the issue is that the i686-pc-windows-> gnu target is using a stable compiler and the flag is not usable there. You'll need to change the rustup target to be nightly, or specify the nightly toolchain.

It seems to have lost the +nightly (that I did specify) on the fallback to cargo.

This is not strictly a cross issue. But maybe we can improve the UX here, I've had the same confusion when having an old toolchain installed for a certain target

I don't understand. This certainly looks like a cross issue, and appears to me that the i686-pc-windows-gnu target doesn't work in the current deployed version of cross. What am I misunderstanding?

I appreciate any other help or guidance you can give.

@ens-scmeeu
Copy link
Author

I see now I was using the supported targets off the main README.md which is MUCH (wow, has there not been a release in over 2 years?) newer than the v0.2.1 branch which does NOT support i686-pc-windows-gnu it appears. Apparently my choice are either to follow bleeding edge or give up this target. Since this was a "nice to have" target I'll just give it up for the moment, thx

@Emilgardis
Copy link
Member

we have a new release planned, #542, hope to have it out next month I think

to clarify, cross doesn't use toolchains in the docker images, it installs the toolchain with rustup on the host, and docker -v mounts them to the image.

the reason all targets fail with the current main branch is that the images it looks for are not published with that tag on ghcr.

@ens-scmeeu
Copy link
Author

Good to know, would be great to have another release. Thx for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants