Skip to content

Commit

Permalink
Merge pull request scala#8916 from iamrecursion/wip/ara/fix-build
Browse files Browse the repository at this point in the history
Closes scala#8873: Remove the outdated dist subproject
  • Loading branch information
smarter authored May 8, 2020
2 parents ed4ce59 + 124273a commit f5b1d79
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ jobs:

- name: Publish Release
run: |
./project/scripts/sbt dist-bootstrapped/packArchive
sha256sum dist-bootstrapped/target/dotty-* > dist-bootstrapped/target/sha256sum.txt
./project/scripts/sbt dist/packArchive
sha256sum dist/target/dotty-* > dist/target/sha256sum.txt
./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease"
echo "::set-env name=RELEASE_TAG::${GITHUB_REF#*refs/tags/}"
Expand All @@ -391,7 +391,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist-bootstrapped/target/dotty-${{ env.RELEASE_TAG }}.zip
asset_path: ./dist/target/dotty-${{ env.RELEASE_TAG }}.zip
asset_name: dotty-${{ env.RELEASE_TAG }}.zip
asset_content_type: application/zip

Expand All @@ -401,7 +401,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist-bootstrapped/target/dotty-${{ env.RELEASE_TAG }}.tar.gz
asset_path: ./dist/target/dotty-${{ env.RELEASE_TAG }}.tar.gz
asset_name: dotty-${{ env.RELEASE_TAG }}.tar.gz
asset_content_type: application/gzip

Expand All @@ -411,7 +411,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist-bootstrapped/target/sha256sum.txt
asset_path: ./dist/target/sha256sum.txt
asset_name: sha256sum.txt
asset_content_type: text/plain

Expand Down
4 changes: 2 additions & 2 deletions bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ target="$1"
shift # Mutates $@ by deleting the first element ($1)

# Marker file used to obtain the date of latest call to sbt-back
version="$ROOT/dist-bootstrapped/target/pack/VERSION"
version="$ROOT/dist/target/pack/VERSION"

# Create the target if absent or if file changed in ROOT/compiler
new_files="$(find "$ROOT/compiler" \( -iname "*.scala" -o -iname "*.java" \) -newer "$version" 2> /dev/null)"

if [ ! -f "$version" ] || [ ! -z "$new_files" ]; then
echo "Building Dotty..."
(cd $ROOT && sbt "dist-bootstrapped/pack")
(cd $ROOT && sbt "dist/pack")
fi

eval "$target" "$@"
2 changes: 1 addition & 1 deletion bin/dotc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."

eval "$ROOT/bin/common" "$ROOT/dist-bootstrapped/target/pack/bin/dotc" "$@"
eval "$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotc" "$@"
2 changes: 1 addition & 1 deletion bin/dotd
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."

eval "$ROOT/bin/common" "$ROOT/dist-bootstrapped/target/pack/bin/dotd" "$@"
eval "$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotd" "$@"
2 changes: 1 addition & 1 deletion bin/dotr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."

eval "$ROOT/bin/common" "$ROOT/dist-bootstrapped/target/pack/bin/dotr" "$@"
eval "$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotr" "$@"
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ val `scala-compiler` = Build.`scala-compiler`
val `scala-reflect` = Build.`scala-reflect`
val scalap = Build.scalap
val dist = Build.dist
val `dist-bootstrapped` = Build.`dist-bootstrapped`
val `community-build` = Build.`community-build`

val sjsSandbox = Build.sjsSandbox
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ Running all tests in Dotty is as simple as:
$ sbt test
```

Specifically, `sbt test` runs all tests that do _not_ require a bootstrapped
compiler. In practice, this means that it runs all compilation tests meeting
this criterion, as well as all non-compiler tests.

The entire suite of tests can be run using the bootstrapped compiler as follows:

```bash
$ sbt
> dotty-bootstrapped/test
```

There are currently several forms of tests in Dotty. These can be split into
two categories:

Expand Down
6 changes: 1 addition & 5 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1315,14 +1315,10 @@ object Build {
packArchiveName := "dotty-" + dottyVersion
)

lazy val dist = project.asDist(NonBootstrapped)
lazy val dist = project.asDist(Bootstrapped)
.settings(
packResourceDir += (baseDirectory.value / "bin" -> "bin"),
)
lazy val `dist-bootstrapped` = project.asDist(Bootstrapped)
.settings(
packResourceDir += ((baseDirectory in dist).value / "bin" -> "bin"),
)

implicit class ProjectDefinitions(val project: Project) extends AnyVal {

Expand Down
4 changes: 2 additions & 2 deletions project/scripts/bootstrapCmdTests
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ grep -qe "val a: scala.Int = 3" "$tmp"


# setup for `dotc`/`dotr` script tests
"$SBT" dist-bootstrapped/pack
"$SBT" dist/pack

# check that `dotc` compiles and `dotr` runs it
echo "testing ./bin/dotc and ./bin/dotr"
Expand All @@ -36,7 +36,7 @@ clear_out "$OUT1"
./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp"
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"

# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI
# echo ":quit" | ./dist/target/pack/bin/dotr # not supported by CI

echo "testing ./bin/dotd"
clear_out "$OUT"
Expand Down

0 comments on commit f5b1d79

Please sign in to comment.