Skip to content
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

rustc error on Windows: The filename or extension is too long #93920

Closed
jszwedko opened this issue Feb 11, 2022 · 5 comments
Closed

rustc error on Windows: The filename or extension is too long #93920

jszwedko opened this issue Feb 11, 2022 · 5 comments
Labels
C-bug Category: This is a bug.

Comments

@jszwedko
Copy link

jszwedko commented Feb 11, 2022

Hi all!

I think we are running into the same issue described by #39644 but with rustc.exe rather than link.exe.

We have a project where we noticed that any PRs that introduce a new dependency were causing our Windows CI builds to fail with:

Caused by:
  The filename or extension is too long. (os error 206)

In the example failure below, it does seem like the rustc command is 33,184 characters, which would be over the 32,767 character limit mentioned in https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation.

Example failure:

https://github.com/vectordotdev/vector/runs/5157867395?check_suite_focus=true

Does that sound right to people? Do we need the same fix from #44094 but for the rustc invocation?

Meta

rustc --version --verbose:

rustc 1.58.1 (db9d1b20b 2022-01-20)
binary: rustc
commit-hash: db9d1b20bba1968c1ec1fc49616d4742c1725b4b
commit-date: 2022-01-20
host: x86_64-pc-windows-msvc
release: 1.58.1
LLVM version: 13.0.0
@jszwedko jszwedko added the C-bug Category: This is a bug. label Feb 11, 2022
@jszwedko
Copy link
Author

bazelbuild/rules_rust#1076 seems related.

@ChrisDenton
Copy link
Member

Yes, for arguments longer than the 32,767 limit, you would need to load command-line flags from a path.

@jszwedko
Copy link
Author

jszwedko commented Feb 11, 2022

Yes, for arguments longer than the 32,767 limit, you would need to load command-line flags from a path.

Is that something we can do from outside? We are just executing cargo test which then calls rustc. I suppose maybe this issue should be moved over to https://github.com/rust-lang/cargo ?

@ChrisDenton
Copy link
Member

ChrisDenton commented Feb 11, 2022

I think so. It seems more like a bug with Cargo because I'm not sure there's much rustc can do here.

@jszwedko
Copy link
Author

Yeah, I think so too. I opened rust-lang/cargo#10381 so I'll close this one out. Thanks for the pointer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants