scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

scala-compiler maven artefact has invalid Class-Path manifest entry #13016

Closed bishabosha closed 4 months ago

bishabosha commented 4 months ago

Problem

The scala-compiler jar uploaded to maven has an invalid Class-Path entry in the manifest

https://github.com/scala/scala/blob/c1fe21370b78365a7d2c41aaefde56a3196dd709/build.sbt#L554

This entry is only valid when using the scala binary distribution, where there exist sibling jar files scala-reflect.jar and scala-library.jar. Applications where the classpath might be formatted differently, e.g. paths into a maven cache, then can not resolve these jars - shouldn't the jar only have this structure in the binary distribution?

bishabosha commented 4 months ago

in practice I guess classpath loaders skip over non-existent entries

lrytz commented 4 months ago

I assume it doesn't hurt? https://github.com/scala/scala/pull/4959#discussion_r64227187. How did you come across this?

bishabosha commented 4 months ago

so to overcome the problem of Windows command line character limit, we needed a way to ship the classpath of the 3.5.0 binary release in a file - and this is the only way before Java 9 - in testing we found that the scala-compiler jar had these invalid entries when reading from a maven classpath - so we opted to skip these invalid entries

lrytz commented 4 months ago

OK, thanks. I think we'll leave this alone, the info has very limited use but maybe it still works for what it was added in https://github.com/scala/scala/pull/4959#discussion_r64227187.