Skip to content

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

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

Merged
merged 5 commits into from
Feb 22, 2019

Conversation

IDoCodingStuffs
Copy link
Contributor

@IDoCodingStuffs IDoCodingStuffs commented Feb 7, 2019

scala/scala#7497 for reference

EDIT: About #5812, doesn't quite fix it.

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Commit Messages

We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).

Please stick to these guidelines for commit messages:

  1. Separate subject from body with a blank line
  2. When fixing an issue, start your commit message with Fix #<ISSUE-NBR>:
  3. Limit the subject line to 72 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line ("Add" instead of "Added")
  7. Wrap the body at 80 characters
  8. Use the body to explain what and why vs. how

adapted from https://chris.beams.io/posts/git-commit

Have an awesome day! ☀️

…placed with MaxNameLength and variants hardcoded to 240
@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

Both on latest release and this PR, tests/pending/run/t8199.scala still fails to compile by creating files with name of ~260 chars. So I'd merge the PR but keep the issue open since the underlying feature apparently doesn't work (and it's not this PR's fault).

sbt:dotty> dotc tests/pending/run/t8199.scala
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] Running (fork) dotty.tools.dotc.Main -classpath /Users/pgiarrusso/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.8.jar:/Users/pgiarrusso/git/dotty/library/../out/bootstrap/dotty-library-bootstrapped/scala-0.13/dotty-library_0.13-0.13.0-bin-SNAPSHOT.jar tests/pending/run/t8199.scala
java.nio.file.FileSystemException: ./reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname$cls01234567890.class: File name too long
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.createFile(Files.java:632)
	at dotty.tools.io.AbstractFile.fileOrSubdirectoryNamed(AbstractFile.scala:245)
	at dotty.tools.io.AbstractFile.fileNamed(AbstractFile.scala:256)
	at scala.tools.nsc.backend.jvm.BytecodeWriters.getFile(BytecodeWriters.scala:35)
	at scala.tools.nsc.backend.jvm.BytecodeWriters.getFile$(BytecodeWriters.scala:28)
	at dotty.tools.backend.jvm.GenBCodePipeline.getFile(GenBCode.scala:73)
	at scala.tools.nsc.backend.jvm.BCodeHelpers.getFileForClassfile(BCodeHelpers.scala:38)
	at scala.tools.nsc.backend.jvm.BCodeHelpers.getFileForClassfile$(BCodeHelpers.scala:37)
	at dotty.tools.backend.jvm.GenBCodePipeline.getFileForClassfile(GenBCode.scala:73)
	at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.$anonfun$visit$3(GenBCode.scala:256)
	at scala.collection.immutable.List.map(List.scala:290)
$ echo 'reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname$cls01234567890.class'|wc
       1       1     260

Copy link
Contributor

@Blaisorblade Blaisorblade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does its job correctly; technical debt gets in its way.

@Blaisorblade
Copy link
Contributor

I'm happy with this code — but letting @smarter pick the best action.

@IDoCodingStuffs
Copy link
Contributor Author

Would we want a separate issue for the test failing to compile? Scope of the addressed issue seems to be limited to matching 2.13

@IDoCodingStuffs
Copy link
Contributor Author

@smarter Is there anything else that needs to be taken care of or is this good for a merge?

@smarter smarter merged commit fda1250 into scala:master Feb 22, 2019
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

Successfully merging this pull request may close these issues.

5 participants