Skip to content

Publish for dotty milestones #387

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

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ set -e
# can be released using that new Scala version by creating a new tag containing the Scala version
# after a hash, e.g., v1.2.3#2.13.0-M3.

# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x
# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x and Dotty 0.x
isReleaseJob() {
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.1[234]\..*$ ]]; then
true
elif [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^0\.[0-9]+\..*$ ]]; then
true
else
false
fi
}

# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases
# For tags that define a Scala version, we pick the jobs of a Scala version (2.13.x) or Dotty (0.x) to do the releases
isTagScalaReleaseJob() {
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then
true
elif [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^0\.[0-9]+\..*$ ]]; then
true
Copy link
Member

Choose a reason for hiding this comment

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

I think this should not be added. When creating a tag v1.2.3#2.13.0-M3 or v1.2.3#0.27.0-RC1, we need to make sure exactly one job of the release matrix has isTagScalaReleaseJob – which one doesn't matter. The setTagScalaVersion in the script will override the Scala version within the build, i.e., the Scala version of the build matrix is ignored in this case.

Copy link
Member Author

@ashawley ashawley Jan 9, 2020

Choose a reason for hiding this comment

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

Thanks for checking this, but I'm having difficulty following. You're saying there is a mismatch between the shell-script logic that is inisTagScalaReleaseJob and setTagScalaVersion? How would this situation happen, though? Isn't there only one value of TRAVIS_SCALA_VERSION per build in the build matrix (err.. the build jobs Travis starts in each build)?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the delay... So we have a travis build for every scala version x env combination

  • 2.12.10 / SCALAJS_VERSION= ADOPTOPENJDK=8
  • 2.12.10 / SCALAJS_VERSION=0.6.31 ADOPTOPENJDK=8
  • ...
  • 2.13.1 / SCALAJS_VERSION= ADOPTOPENJDK=8
  • 2.13.1 / SCALAJS_VERSION=0.6.31 ADOPTOPENJDK=8
  • ...

in isReleaseJob, we select builds that should be released for a normal tag, e.g. v1.2.3.

When using a tag with a specific scala version (v1.2.3#2.13.0-M3), the build script will ignore the scala version coming from travis and always do set every scalaVersion := "'$tagScalaVer'". To avoid running multiple times the same build, we have to select the right builds to release.

Anyway, in short, the code of isTagScalaReleaseJob should be something like

isTagScalaReleaseJob() {
  tagScalaVersion = <scala version from tag>
  "$ADOPTOPENJDK" == "8" && {
    tagScalaVersion.startsWith(2.12) && $TRAVIS_SCALA_VERSION.startsWith(2.12) ||
    tagScalaVersion.startsWith(2.13) && $TRAVIS_SCALA_VERSION.startsWith(2.13) ||
    tagScalaVersion.startsWith(0.) && $TRAVIS_SCALA_VERSION.startsWith(0.)
  }
}

Sorry for the sketchy syntax...

Copy link
Member

Choose a reason for hiding this comment

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

@ashawley do we need to circle back to this?

Copy link
Member Author

Choose a reason for hiding this comment

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

the build script will ignore the scala version coming from travis and always do set every scalaVersion := "'$tagScalaVer'".

This seems to be the crux of it. According to the docs for sbt-travisci:

  • scalaVersion in ThisBuild will be automatically set to TRAVIS_SCALA_VERSION if isTravisBuild is true, otherwise to the last version in crossScalaVersions, and so by default, sbt will assume you want to develop under the last version listed in .travis.yml.

Seems like the build script should stop trying to set scalaVersion.

else
false
fi
Expand Down