indygreg / indygreg/PyOxidizer

linking failure in run subcommand: x86_64-pc-windows-msvc instead of x86_64-pc-windows-gnu

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

I use 64 bit Mingw-w64 with the latest gcc, 64 bit, and Rust 1.35 on Windows 10 64 bit. I changed the toolchain to x86_64-pc-windows-gnu when installing Rust.

After hacking together a toolchain that can compile pyoxidizer, pyoxidizer init is successful and pyoxidizer run fails because x86_64-pc-windows-msvc is used instead of x86_64-pc-windows-gnu.

error occurred: Failed to find tool. Is `cl.exe` installed? (see https://github.com/alexcrichton/cc-rs#compile-time-requirements for help)

The gcc toolchain appears to be utterly unsupported (projectmgmt,rs):

/// Attempt to resolve the default Rust target for a build.
pub fn default_target() -> Result {
// TODO derive these more intelligently.
if cfg!(target_os = "linux") {
Ok("x86_64-unknown-linux-gnu".to_string())
} else if cfg!(target_os = "windows") {
Ok("x86_64-pc-windows-msvc".to_string())
} else if cfg!(target_os = "macos") {
Ok("x86_64-apple-darwin".to_string())
} else {
Err("unable to resolve target".to_string())
}
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in projectmgmt.rs at default_target(), then reproduce the difference between pyoxidizer init and pyoxidizer run on a Windows x86_64-pc-windows-gnu toolchain. Trace where the run build target is selected and verify that the GNU target is retained instead of x86_64-pc-windows-msvc; done means the run subcommand no longer requires cl.exe for this toolchain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.