Skip to content

Remove the -Xelide-below scalac option, which no longer switches anything #7706

Description

@aglinxinyuan

Task Summary

-Xelide-below WARNING is set in sixteen build.sbt files. Once #7451 lands, the tree contains no @elidable annotation at all, so the flag is a switch over nothing.

Follow-up to a review note from @Yicong-Huang on #7451, kept separate because it touches sixteen build files while #7451 is a two-file deletion.

Background

-Xelide-below <level> tells scalac to replace calls to @elidable(n)-annotated methods with () when n < level. The only thing in this repo that carried such an annotation was ElidableStatement (FINEST 300 / FINER 400 / FINE 500 / INFO 800) — all below WARNING (900), so its call sites were compiled out. It had no callers, and #7451 deletes it.

The standard library's assert / assume are @elidable(ASSERTION) = 2000, which is above WARNING, so they are retained today. Scalac's default when the flag is absent elides nothing, so they stay retained after removal. No behaviour change.

Scope

Remove the flag and its now-meaningless value from all sixteen files:

File Line
access-control-service/build.sbt 51
amber/build.sbt 40
common/auth/build.sbt 44
common/config/build.sbt 41
common/dao/build.sbt 117
common/pybuilder/build.sbt 45
common/resource/build.sbt 41
common/util/build.sbt 40
common/workflow-compiler/build.sbt 29
common/workflow-core/build.sbt 83
common/workflow-operator/build.sbt 45
computing-unit-managing-service/build.sbt 59
config-service/build.sbt 51
file-service/build.sbt 51
notebook-migration-service/build.sbt 51
workflow-compiling-service/build.sbt 53

Also drop the comments that only exist to explain the flag — they describe ElidableStatement's on/off switch and refer to nothing once it is gone:

// amber/build.sbt:38-40
// to turn on, use: INFO
// to turn off, use: WARNING
scalacOptions ++= Seq("-Xelide-below", "WARNING")

and, in the other fifteen, the trailing // Turn on optimizations with "WARNING" as the threshold.

In amber/build.sbt the whole scalacOptions ++= Seq(...) line goes; elsewhere the flag is one entry in a longer Seq, so only the two elements are dropped.

Verification

git grep -n Xelide            # empty
git grep -in elidable         # empty
sbt compile Test/compile      # unchanged

Task Type

  • Refactor / Cleanup

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions