Skip to content

Fat linking with subsecond fails on windows due to CLI command length #4191

@dsgallups

Description

@dsgallups

Problem
The command issued here can be extremely long on windows systems.

let res = Command::new(linker)
.args(args.iter().skip(1))
.args(out_arg)
.env_clear()
.envs(rustc_args.envs.iter().map(|(k, v)| (k, v)))
.output()
.await?;

Windows has a command length limit of 32767...so, projects with many dependencies are likely to fail.

Steps To Reproduce

On Windows, you will need to create a project with many dependencies. This should fail, even if the project is located in the root of the drive.

Attached is output, where I have added a trace for the command to be executed. This is a debug of the Command struct.

commandbroke.txt

  • Dioxus version: main
  • Rust version: 1.87
  • OS info: Windows 11 current stable

Edit:

Jon Kelley has mentioned decreasing codegen-unit size as a workaround 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions