Skip to content

Commit

Permalink
[nomerge] downgrade sbt-native-packager to 0.6.4
Browse files Browse the repository at this point in the history
this restores the 2.11.7 status quo for the 2.11.8 release.

the upgrade turned out to be way too problematic.  even after multiple
PRs addressing regressions, new ones continue to turn up; see
scala/scala-dev#92 for details on the latest
regressions. for past history (including details on regressions), see
these PRs in this repo: scala#159, scala#157, scala#156, scala#155, scala#154, scala#142, plus issue

so what's next after this?

- we could maybe still consider upgrading for 2.11.9, but someone
  would need to thoroughly QA it on all platforms and assure us there
  are no regressions

- or we could restrict the upgrade to 2.12.x and hope for
  partially crowdsourced QA so that regressions would be caught
  during the milestone and release candidate phases.

I lean towards leaving 2.11.x frozen at 0.6.4, at least unless the
upgrade brings concrete benefits to end users (no one has listed
any, to my knowledge).  if this is mainly just dogfooding, then
2.12.x is a better context for that.
  • Loading branch information
SethTisue committed Mar 3, 2016
1 parent eeefb5c commit 3f8f152
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Docs.settings

ScalaDist.platformSettings

enablePlugins(UniversalPlugin, RpmPlugin, JDebPackaging, WindowsPlugin)

// resolvers += "local" at "file:///e:/.m2/repository"
// resolvers += Resolver.mavenLocal
// to test, run e.g., stage, or windows:packageBin, show s3-upload::mappings
2 changes: 1 addition & 1 deletion project/Docs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object Docs {
import ScalaDist._

def settings: Seq[Setting[_]] = Seq(
packageName in UniversalDocs := s"scala-docs-${version.value}",
name in UniversalDocs := s"scala-docs-${version.value}",
// libraryDependencies += scalaDistDep(version.value, "javadoc"), // seems not to be necessary
// need updateClassifiers to get javadoc jars
mappings in UniversalDocs ++= createMappingsWith(updateClassifiers.value.toSeq, universalDocsMappings)
Expand Down
38 changes: 13 additions & 25 deletions project/ScalaDist.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import sbt._
import sbt.Keys._

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.packager.MappingsHelper._
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.useNativeZip
import com.typesafe.sbt.packager.Keys._

import com.typesafe.sbt.S3Plugin.S3.upload
Expand Down Expand Up @@ -40,18 +38,11 @@ object ScalaDist {
mappings in upload += uploadMapping(packageZipTarball in UniversalDocs).value,
mappings in upload += uploadMapping(packageXzTarball in UniversalDocs).value,
mappings in upload += uploadMapping(packageBin in Rpm).value,
// Debian needs special handling because the value sbt-native-packager
// gives us for `packageBin in Debian` (coming from the archiveFilename
// method) includes the debian version and arch information,
// which we historically have not included. I don't see a way to
// override the filename on disk, so we re-map at upload time
mappings in upload += Def.task {
(packageBin in Debian).value ->
s"scala/${version.value}/${(name in Debian).value}-${version.value}.deb"
}.value
mappings in upload += uploadMapping(packageBin in Debian).value
)

def settings: Seq[Setting[_]] =
packagerSettings ++
useNativeZip ++ // use native zip to preserve +x permission on scripts
Seq(
name := "scala",
Expand All @@ -65,13 +56,7 @@ object ScalaDist {

// create lib directory by resolving scala-dist's dependencies
// to populate the rest of the distribution, explode scala-dist artifact itself
mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings),

// work around regression in sbt-native-packager 1.0.5 where
// these tasks invoke `tar` without any flags at all
universalArchiveOptions in (UniversalDocs, packageZipTarball) := Seq("--force-local", "-pcvf"),
universalArchiveOptions in (UniversalDocs, packageXzTarball ) := Seq("--force-local", "-pcvf")

mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings)
)

// private lazy val onWindows = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")
Expand All @@ -89,16 +74,19 @@ object ScalaDist {
case "scala-dist" =>
val tmpdir = IO.createTemporaryDirectory
IO.unzip(file, tmpdir)
// IO.listFiles(tmpdir) does not recurse, use ** with glob "*" to find all files
(PathFinder(IO.listFiles(tmpdir)) ** "*").get flatMap { file =>
val relative = IO.relativize(tmpdir, file).get // .get is safe because we just unzipped under tmpdir

// files are stored in repository with platform-appropriate line endings
// if (onWindows && (relative endsWith ".bat")) toDosInPlace(file)

// create mappings from the unzip scala-dist zip
contentOf(tmpdir) filter {
case (file, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF"))
} map {
// make unix scripts executable (heuristically...)
case (file, dest) if (dest startsWith "bin/") && !(dest endsWith ".bat") =>
if ((relative startsWith "bin/") && !(file.getName endsWith ".bat"))
file.setExecutable(true, true)
file -> dest
case mapping => mapping

if (relative startsWith "META-INF") Seq()
else Seq(file -> relative)
}

// core jars: use simple name for backwards compat
Expand Down
5 changes: 3 additions & 2 deletions project/Unix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import sbt.Keys._
import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.packager.linux.{LinuxPackageMapping => pkgMap, LinuxSymlink}
import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.packageMapping

/** Create debian & rpm packages.
*
Expand Down Expand Up @@ -92,7 +91,9 @@ object Unix {

linuxPackageMappings in Debian += (packageMapping(
(sourceDirectory.value / "debian" / "changelog") -> "/usr/share/doc/scala/changelog.gz"
).withUser("root").withGroup("root").withPerms("0644").gzipped).asDocs()
).withUser("root").withGroup("root").withPerms("0644").gzipped).asDocs(),

// Hack so we use regular version, rather than debian version.
target in Debian := target.value / s"${(name in Debian).value}-${version.value}"
)
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.4")

addSbtPlugin("com.typesafe.sbt" % "sbt-s3" % "0.8")

Expand Down

0 comments on commit 3f8f152

Please sign in to comment.