Skip to content
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

Contributing guide needs an update #3950

Closed
retronym opened this issue Feb 17, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@retronym
Copy link
Member

commented Feb 17, 2018

https://github.com/sbt/sbt/blob/1.1.x/CONTRIBUTING.md should be updated to:

  • Update the "last stable" and "current dev" versions
  • Give the recipe on how to build SBT locally with modified modules (see sbt/util#151)
@retronym

This comment has been minimized.

Copy link
Member Author

commented Feb 17, 2018

/cc @mkeskells who was also keen to learn how to perform a local build to test his performance improvements to the clean tasks.

@retronym

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2018

$ mkdir sbt-all
$ cd sbt-all
$ for i in sbt io util librarymanagement zinc; do \
  git clone https://github.com/sbt/$i.git && (cd $i; git checkout -b 1.1.x origin/1.1.x)
 done
$ cd sbt
$ ./sbt-allsources.sh
sbt:sbtRoot> ;{file:/Users/jz/code/sbt-all/io/}/publishLocal;{file:/Users/jz/code/sbt-all/util/}/publishLocal;{file:/Users/jz/code/sbt-all/libraryManagement/}/publishLocal;{file:/Users/jz/code/sbt-all/zinc/}/publishLocal;publishLocal
...
[info] 	published sbt to /Users/jz/.ivy2/local/org.scala-sbt/sbt/1.1.2-SNAPSHOT/poms/sbt.pom
...
% cd /code/myproject
% sbt -sbt-version=1.1.2

But we get:

sbt> compile
[error] sbt.internal.inc.InvalidComponent: The compiler bridge sources org.scala-sbt:compiler-bridge_2.13.0-M2:1.1.1-67207c323a9412fe3012eb8303a2164113cbb4b5:compile could not be retrieved.

TODO:

  • How to do we cross publish the compiler-bridge module? @jvican the best I could figure out follows.
$ cd sbt-all/zinc; sbt
sbt:zinc Root> set List(version in compilerBridge := "1.1.1-67207c323a9412fe3012eb8303a2164113cbb4b5", scalaVersion in compilerBridge := "2.13.0-M2")
[info] Defining compilerBridge / scalaVersion, compilerBridge / version
[info] The new values will be used by compilerBridge / Compile / packageBin / artifactPath, compilerBridge / Compile / packageBin / packageOptions and 29 others.
[info] 	Run `last` for details.
[info] Reapplying settings...
[info] Set current project to zinc Root (in build file:/Users/jz/code/sbt-all/zinc/)
sbt:zinc Root> compilerBridge/publishLocal
@jvican

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

@retronym

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2018

That's where I started, but I wasn't able to run that command when I was using Zinc as a source dependency of SBT, and when I tried to run that command separately in the zinc build I didn't get the -SHA suffix in the version numbers that SBT was depending on. This is probably just a lack of understanding on my part about how the version numbers are derived (I'm still a bit old school and used to plain old -SNAPSHOT versions)

@eed3si9n

This comment has been minimized.

Copy link
Member

commented Feb 21, 2018

There's a bug in + so it currently doesn't work, but it should be

> + {../zinc}compilerBridge/publishLocal

The versioning uses sbt-git, and if some local changes are detected it appends -SNAPSHOT.

eed3si9n added a commit to eed3si9n/sbt that referenced this issue Feb 21, 2018

@eed3si9n eed3si9n self-assigned this Feb 21, 2018

@retronym

This comment has been minimized.

Copy link
Member Author

commented Feb 21, 2018

I've been using a different worklow:

  • modify sbt build to allow module version numbers to be controlled with env vars, and to force use of them with override
  • set the plugin and sbt version to some new version
  • publishLocal in each project (also publishBridgesAndSet 2.12.4) in zinc
 (
  export V=1.1.2-pre-JZ19;
  (set -x; cd ./util && sbt "set version in ThisBuild := \"$V\""  publishLocal) && 
  (set -x; cd ./zinc && sbt "set version in ThisBuild := \"$V\""  publishLocal "publishBridgesAndSet 2.12.4") && 
  (cd sbt; sbt -Dsbt.util.version=$V -Dsbt.zinc.version=$V "set version in ThisBuild := \"$V\""  publishLocal "show update")
)
===================================================================
--- project/Dependencies.scala	(revision 7df32cff849e4c9ef1412d979628fe20702b73d0)
+++ project/Dependencies.scala	(revision 2266349a7747c8daa03214e2941365db81247741)
@@ -9,9 +9,9 @@
 
   // sbt modules
   private val ioVersion = "1.1.4"
-  private val utilVersion = "1.1.2"
+  private val utilVersion = System.getProperty("sbt.util.version", "1.1.2")
   private val lmVersion = "1.1.3"
-  private val zincVersion = "1.1.1"
+  private val zincVersion = System.getProperty("sbt.util.version", "1.1.1")
 
   private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
 
@@ -55,7 +55,7 @@
   def addSbtModule(p: Project, path: Option[String], projectName: String, m: ModuleID) =
     path match {
       case Some(f) => p dependsOn ProjectRef(file(f), projectName)
-      case None    => p settings (libraryDependencies += m)
+      case None    => p settings (libraryDependencies += m, dependencyOverrides += m)
     }
 
   def addSbtIO(p: Project): Project = addSbtModule(p, sbtIoPath, "io", sbtIO)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.