Skip to content

Commit a9f1fa6

Browse files
Disallow experimental CB projects on release builds
Previous mechanism for this inferred experimental capabilities from the version of the compiler (SNAPSHOT or NIGHTLY permits experimental). However this doesn't work in practice: the version of the compiler is set by CI to a stable version only when publish task is executed (not when test tasks are executed). If we set the version as stable for community build as well, the community projects will not be able to resolve it as they operate against the locally published snapshot and not the official stable release version. Hence this solution adds another env var specifically to track experimental features allowance.
1 parent cf27211 commit a9f1fa6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ jobs:
219219
- name: Add SBT proxy repositories
220220
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
221221

222+
- name: Disable experimental features on release
223+
if: "github.event_name == 'push'
224+
&& startsWith(github.event.ref, 'refs/tags/')
225+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
226+
run: echo "DISALLOW_EXPERIMENTAL_FEATURES=true" >> $GITHUB_ENV
227+
222228
- name: Test
223229
run: |
224230
git submodule sync
@@ -262,6 +268,12 @@ jobs:
262268
- name: Add SBT proxy repositories
263269
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
264270

271+
- name: Disable experimental features on release
272+
if: "github.event_name == 'push'
273+
&& startsWith(github.event.ref, 'refs/tags/')
274+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
275+
run: echo "DISALLOW_EXPERIMENTAL_FEATURES=true" >> $GITHUB_ENV
276+
265277
- name: Test
266278
run: |
267279
git submodule sync
@@ -305,6 +317,12 @@ jobs:
305317
- name: Add SBT proxy repositories
306318
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
307319

320+
- name: Disable experimental features on release
321+
if: "github.event_name == 'push'
322+
&& startsWith(github.event.ref, 'refs/tags/')
323+
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
324+
run: echo "DISALLOW_EXPERIMENTAL_FEATURES=true" >> $GITHUB_ENV
325+
308326
- name: Test
309327
run: |
310328
git submodule sync

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ lazy val compilerVersion: String =
1111
new String(Files.readAllBytes(file), UTF_8)
1212

1313
lazy val compilerSupportExperimental: Boolean =
14-
compilerVersion.contains("SNAPSHOT") || compilerVersion.contains("NIGHTLY")
14+
sys.env.get("DISALLOW_EXPERIMENTAL_FEATURES") != Some("true")
1515

1616
lazy val sbtPluginFilePath: String =
1717
// Workaround for https://github.com/sbt/sbt/issues/4395

0 commit comments

Comments
 (0)