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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class ScalaSettings extends Settings.SettingGroup {
val Xhelp: Setting[Boolean] = BooleanSetting("-X", "Print a synopsis of advanced options.")
val XnoForwarders: Setting[Boolean] = BooleanSetting("-Xno-forwarders", "Do not generate static forwarders in mirror classes.")
val XmaxInlines: Setting[Int] = IntSetting("-Xmax-inlines", "Maximal number of successive inlines", 32)
val XmaxClassfileName: Setting[Int] = IntSetting("-Xmax-classfile-name", "Maximum filename length for generated classes", 255, 72 to 255)
val Xmigration: Setting[ScalaVersion] = VersionSetting("-Xmigration", "Warn about constructs whose behavior may have changed since version.")
val Xprint: Setting[List[String]] = PhasesSetting("-Xprint", "Print out program after")
val XprintTypes: Setting[Boolean] = BooleanSetting("-Xprint-types", "Print tree types (debugging option).")
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/NameOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ object NameOps {
*/
def apply(s: String)(implicit ctx: Context): String = {
val marker = "$$$$"
val limit: Int = ctx.settings.XmaxClassfileName.value

val limit: Int = 240
val MaxNameLength = (limit - 6) min 2 * (limit - 6 - 2 * marker.length - 32)

def toMD5(s: String, edge: Int): String = {
Expand Down
5 changes: 0 additions & 5 deletions sbt-dotty/sbt-test/source-dependencies/compactify/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@ TaskKey[Unit]("output-empty") := {
val classes = (outputDirectory ** "*.class").get
if (classes.nonEmpty) sys.error("Classes existed:\n\t" + classes.mkString("\n\t")) else ()
}

// apparently Travis CI stopped allowing long file names
// it fails with the default setting of 255 characters so
// we have to set lower limit ourselves
scalacOptions ++= Seq("-Xmax-classfile-name", "240")
2 changes: 1 addition & 1 deletion tests/pending/run/t8199.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Test extends dotty.runtime.LegacyApp {
checkClassName(c.getName)
}
def checkClassName(name: String): Unit = {
val defaultMaxClassFileLength = 255
val defaultMaxClassFileLength = 240
assert((name + ".class").length <= defaultMaxClassFileLength, name)
}
def checkCallerImplClassName(): Unit = {
Expand Down