Skip to content

Remove -Xmax-classfile-name; hard-code to 240, like Scala 2.13.0-RC1 #5812

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
smarter opened this issue Jan 29, 2019 · 5 comments · Fixed by #11279
Closed

Remove -Xmax-classfile-name; hard-code to 240, like Scala 2.13.0-RC1 #5812

smarter opened this issue Jan 29, 2019 · 5 comments · Fixed by #11279

Comments

@smarter
Copy link
Member

smarter commented Jan 29, 2019

See scala/scala#7497

@IDoCodingStuffs
Copy link
Contributor

Working on this, will create PR

@Blaisorblade Blaisorblade changed the title Remove -Xmax-classfile-length; hard-code to 240, like Scala 2.13.0-RC1 Remove -Xmax-classfile-name; hard-code to 240, like Scala 2.13.0-RC1 Feb 9, 2019
@Blaisorblade
Copy link
Contributor

Status: -Xmax-classfile-name seems to not work yet, and dotc -Xmax-classfile-name 240 tests/pending/run/t8199.scala seems to confirm it (retesting with latest master).
#5872 (comment)

smarter pushed a commit that referenced this issue Feb 22, 2019
…5872)

#5812 is still open since the limit is not respected in the backend.
@nigredo-tori
Copy link

nigredo-tori commented Jul 11, 2019

I've just found scala/scala#7497 and this issue. These don't take into account one use case: in one of my work projects we had to enable -Xmax-classfile-name since our project failed to compile or work (can't remember which) on Windows otherwise. The thing is, WinAPI has a path length limit of 260, which means that a 240-character file in an average SBT project would pretty much always go over.
To circumvent this there is a \\?\ hack, and Windows 10 allows changing this limit. Also, newer Scala versions are less likely to produce huge class names like this. Still, IMO, 240 character limit should be lowered.

@smarter
Copy link
Member Author

smarter commented Jul 11, 2019

@nigredo-tori Making this flag work correctly is really non-trivial (as demonstrated by the fact that that both the Scala 2 and Dotty implementation were always broken). If Windows has an option to change the path limit, then we should just tell people who get an error to go set that option instead of telling them about -Xmax-classfile-name.

@smarter
Copy link
Member Author

smarter commented Jan 28, 2021

-Xmax-classfile-name was removed in #5872 but the limit is still not respected: #5872 (comment), we should figure this out before 3.0 since it's an ABI issue.

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

Successfully merging a pull request may close this issue.

5 participants