Skip to content

Avoid duplicate repl-jline.properties entries in compiler/packageBin#8687

Merged
dwijnand merged 1 commit intoscala:2.12.xfrom
retronym:2.12.x-reference
Feb 3, 2020
Merged

Avoid duplicate repl-jline.properties entries in compiler/packageBin#8687
dwijnand merged 1 commit intoscala:2.12.xfrom
retronym:2.12.x-reference

Conversation

@retronym
Copy link
Member

@retronym retronym commented Feb 3, 2020

I removed generatePropertiesFileSettings from commonSettings
leaving projects that really need to use it to directly add it
to the settings. This was already being done (redundatly in some
cases) in library, reflect, compiler, partestExtras
and partestJavaAgent.

Before this PR (but after the SBT upgrade on 2.12.x branch):

➜  sbt 'show compiler/Compile/packageBin/mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline/repl-jline.properties,repl-jline.properties)
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

➜  sbt scala
[info] Loading global plugins from /Users/jz/.sbt/1.0/plugins
[info] Loading settings for project scala-2-12-x-reference-build-build from plugins.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project/project
[info] Loading settings for project scala-2-12-x-reference-build from plugins.sbt,build.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project
[info] Loading settings for project root from build.sbt ...
[info] Resolving key references (18230 settings) ...
[error] Could not determine commit date + SHA: org.eclipse.jgit.errors.MissingObjectException: Missing unknown b8c33ad8f1d1238bc03c148854972522f0357f44
[info] *** Welcome to the sbt build definition for Scala! ***
[info] Check README.md for more information.
[error] java.util.zip.ZipException: duplicate entry: repl-jline.properties

After this PR:

fg: no current job
➜  sbt 'show compiler/Compile/packageBin/mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

➜  sbt scala
[info] Loading global plugins from /Users/jz/.sbt/1.0/plugins
[info] Loading settings for project scala-2-12-x-reference-build-build from plugins.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project/project
[info] Loading settings for project scala-2-12-x-reference-build from plugins.sbt,build.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project
[info] Loading settings for project root from build.sbt ...
[info] Resolving key references (18194 settings) ...
[info] *** Welcome to the sbt build definition for Scala! ***
[info] Check README.md for more information.
[info] running (fork) scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala 2.12.11-20200203-035143-5bdfd31 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_221).
Type in expressions for evaluation. Or try :help.

Prior to the SBT upgrade, we also had the duplicate mapping:

sbt 'show compiler/compile:packageBin::mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline/repl-jline.properties,repl-jline.properties)
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

I removed `generatePropertiesFileSettings` from commonSettings
leaving projects that really need to use it to directly add it
to the settings. This was already being done (redundatly in some
cases) in `library`, `reflect`, `compiler`, `partestExtras`
and `partestJavaAgent`.

Before this PR (but after the SBT upgrade on 2.12.x branch):

```
➜  sbt 'show compiler/Compile/packageBin/mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline/repl-jline.properties,repl-jline.properties)
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

➜  sbt scala
[info] Loading global plugins from /Users/jz/.sbt/1.0/plugins
[info] Loading settings for project scala-2-12-x-reference-build-build from plugins.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project/project
[info] Loading settings for project scala-2-12-x-reference-build from plugins.sbt,build.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project
[info] Loading settings for project root from build.sbt ...
[info] Resolving key references (18230 settings) ...
[error] Could not determine commit date + SHA: org.eclipse.jgit.errors.MissingObjectException: Missing unknown b8c33ad
[info] *** Welcome to the sbt build definition for Scala! ***
[info] Check README.md for more information.
[error] java.util.zip.ZipException: duplicate entry: repl-jline.properties
```

After this PR:

```
fg: no current job
➜  sbt 'show compiler/Compile/packageBin/mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

➜  sbt scala
[info] Loading global plugins from /Users/jz/.sbt/1.0/plugins
[info] Loading settings for project scala-2-12-x-reference-build-build from plugins.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project/project
[info] Loading settings for project scala-2-12-x-reference-build from plugins.sbt,build.sbt ...
[info] Loading project definition from /Users/jz/code/scala-2.12.x-reference/project
[info] Loading settings for project root from build.sbt ...
[info] Resolving key references (18194 settings) ...
[info] *** Welcome to the sbt build definition for Scala! ***
[info] Check README.md for more information.
[info] running (fork) scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala 2.12.11-20200203-035143-5bdfd31 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_221).
Type in expressions for evaluation. Or try :help.
```

Prior to the SBT upgrade, we also had the duplicate mapping:

```
sbt 'show compiler/compile:packageBin::mappings' | egrep 'repl-jline\.properties'
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline/repl-jline.properties,repl-jline.properties)
[info] * (/Users/jz/code/scala-2.12.x-reference/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)
```
@scala-jenkins scala-jenkins added this to the 2.12.12 milestone Feb 3, 2020
@retronym retronym requested a review from dwijnand February 3, 2020 04:19
@dwijnand dwijnand merged commit cc7da7d into scala:2.12.x Feb 3, 2020
@dwijnand
Copy link
Member

dwijnand commented Feb 3, 2020

Btw, I get duplicate entries using current 2.12.x (I noticed I got them upgrading 2.12.x to sbt 1.3.8 and noticed I got them before too):

> show compiler/compile:packageBin::mappings
...
[info] * (/System/Volumes/Data/d/scala-2.12/build/quick/classes/repl-jline/repl-jline.properties,repl-jline.properties)
...
[info] * (/System/Volumes/Data/d/scala-2.12/build/quick/classes/repl-jline-embedded/repl-jline.properties,repl-jline.properties)

@SethTisue SethTisue added the internal not resulting in user-visible changes (build changes, tests, internal cleanups) label Feb 4, 2020
@SethTisue SethTisue modified the milestones: 2.12.12, 2.12.11 Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal not resulting in user-visible changes (build changes, tests, internal cleanups)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants