Skip to content

sbt-based PR validation job#4884

Merged
SethTisue merged 1 commit intoscala:2.11.xfrom
szeiger:wip/sbt-pr-validation
Jan 29, 2016
Merged

sbt-based PR validation job#4884
SethTisue merged 1 commit intoscala:2.11.xfrom
szeiger:wip/sbt-pr-validation

Conversation

@szeiger
Copy link
Contributor

@szeiger szeiger commented Dec 16, 2015

Testing the sbt-based PR validation...

@scala-jenkins scala-jenkins added this to the 2.11.8 milestone Dec 16, 2015
@szeiger
Copy link
Contributor Author

szeiger commented Dec 16, 2015

@SethTisue I think if you add the publishing stuff to the script that we figured out on Friday, it should actually work. Can you try that?

Remaining issues: Enable optimization & do not publish docs

@SethTisue
Copy link
Member

commit added, let's see what happens

@SethTisue
Copy link
Member

looks like publish-core went fine, but then of course validate-test couldn't run because we aren't yet publishing to https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/

@SethTisue
Copy link
Member

getting closer:

[error] Unable to find credentials for [Artifactory Realm @ scala-ci.typesafe.com].

@SethTisue
Copy link
Member

yay a bunch of JARs actually got published to the scala-ci artifactory 🎉

but then it bombed with

java.lang.RuntimeException: Repository for publishing is not specified.
    at scala.sys.package$.error(package.scala:27)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1493)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1493)
    at scala.Option.getOrElse(Option.scala:120)
    at sbt.Classpaths$.getPublishTo(Defaults.scala:1493)
    at sbt.Classpaths$$anonfun$62.apply(Defaults.scala:1165)
    at sbt.Classpaths$$anonfun$62.apply(Defaults.scala:1165)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
[error] (root/*:publishConfiguration) Repository for publishing is not specified.

EDIT: this is even though the root project has publishArtifact := false

@SethTisue
Copy link
Member

@SethTisue
Copy link
Member

perhaps the problem is the mix of -1 and -2 suffixes (here's ant not doing that). but what is causing those suffixes?

@SethTisue
Copy link
Member

ah, this appears to be sbt/sbt#2088

@adriaanm
Copy link
Contributor

can we just drop the -SNAPSHOT?

@szeiger
Copy link
Contributor Author

szeiger commented Jan 7, 2016

Dropping -SNAPSHOT would mean that we'd have to change the existing infrastructure that relies on these version numbers. It's the first time I've seen these "-1" and "-2" suffixes. I have no idea what they are and where they come from. I'll have to check the sbt sources.

build.sbt Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SethTisue What is the reason for using this over publishTo? It is only referenced in one place (for setting publishTo)

@szeiger
Copy link
Contributor Author

szeiger commented Jan 8, 2016

/rebuild

@szeiger
Copy link
Contributor Author

szeiger commented Jan 11, 2016

As far as I can tell this looks good. The integrate-ide job (and consequently validate-main) has been failing for several weeks. @SethTisue WDYT? Shall I clean up the code and squash?

(Still looking into the optimization and docs stuff)

@szeiger
Copy link
Contributor Author

szeiger commented Jan 11, 2016

Docs disabled, optimization enabled. The doc artifacts are gone and validate-test passes, so this should be ready for squashing and merging.

@adriaanm
Copy link
Contributor

🍰!

# Improve version handling in the sbt build:

The new settings `baseVersion` and `baseVersionSuffix` make it easier
to set version numbers for different kinds of builds in a consistent
way without e.g. having to first get a git SHA outside of sbt.

The new task `generateBuildCharacterPropertiesFile` writes the file
`buildcharacter.properties` to the root dir. The format is compatible
with the same file produced by the ANT build but it only contains a
subset of the properties, in particular the Maven version, which is
needed in publishing scripts and passed around between different
Jenkins jobs as `jenkins.properties`.

SHAs in version numbers are consistently shortened to 7 digits (as used
by git and github). Previously we used 7 digits in Maven snapshot
version numbers but 10 digits in canonical and OSGi version numbers.

# Add Jenkins script support to the sbt build:

The new command `setupPublishCore` takes the PR validation snapshot
repository as an argument and changes the required settings for the
`publish-core` build (use SHA-SNAPSHOT versioning, compile with
optimization enabled, do not publish scaladoc sets)

For example, the following command can be used to generate
`buildcharacter.properties` with the version numbers needed for PR
validation builds:

  sbt setupPublishCore dummy generateBuildCharacterPropertiesFile

The sbt build will now automatically detect and use a “~/.credentials”
file with the credentials for publishing to a remote repository.

# Call sbt from `publish-core`:

The correct`$SBT_CMD` is set directly in `bootstrap` and used by
`publish-core` to first generate `buildcharacter.properties` and then
build and publish. Parsing the git revision, computing a version
number and getting binary dependencies are no longer required in the
script. This is all done in the sbt build.
@szeiger szeiger force-pushed the wip/sbt-pr-validation branch from 17c450e to b1b5475 Compare January 12, 2016 13:19
@szeiger
Copy link
Contributor Author

szeiger commented Jan 12, 2016

Cleaned up and squashed.

@SethTisue
Copy link
Member

/nothingtoseehere

(integrate-ide failure is unrelated to the PR)

@SethTisue SethTisue self-assigned this Jan 13, 2016
@dwijnand
Copy link
Member

What was done to avoid sbt/sbt#2088?

@szeiger
Copy link
Contributor Author

szeiger commented Jan 18, 2016

@SethTisue
Copy link
Member

@szeiger may I suggest some light testing with sbt 0.13.10-RC1? it'd be a bit awkward if we merged this and then were immediately stuck on 0.13.9 because of some regression

@szeiger
Copy link
Contributor Author

szeiger commented Jan 26, 2016

@SethTisue No luck with 0.13.10-RC1: https://gist.github.com/szeiger/d494e70da91eb1ec9d06

@dwijnand
Copy link
Member

You want to try 0.13.10-M1 (but @eed3si9n might want to cut a new release).

Or you might want to wait for a successful community build for 0.13.10, see scala/community-build#210.

@szeiger
Copy link
Contributor Author

szeiger commented Jan 26, 2016

I was able to build it successfully with sbt 0.13.10-M1 but not with 0.13.10-RC1. /cc @eed3si9n

@dwijnand
Copy link
Member

That's good news. Thank you @szeiger.

SethTisue added a commit that referenced this pull request Jan 29, 2016
@SethTisue SethTisue merged commit 3c26633 into scala:2.11.x Jan 29, 2016
@adriaanm
Copy link
Contributor

time to merge 2.11.x into 2.12.x?

@dwijnand
Copy link
Member

Cool!

@SethTisue
Copy link
Member

time to merge 2.11.x into 2.12.x?

we're not that close yet. this PR makes validate-publish-core sbt-based, but doesn't update validate-test (not to mention integrate-bootstrap and integrate-windows). we can discuss overall status at scala/scala-dev#45

SethTisue added a commit to SethTisue/scala that referenced this pull request Jan 29, 2016
SethTisue added a commit to SethTisue/scala that referenced this pull request Jan 29, 2016
SethTisue added a commit to SethTisue/scala that referenced this pull request Feb 3, 2016
rather use sbt and direct invocation of partest

this is the next Ant-elimination step after scala#4884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants