Skip to content

Hide "Parallelize position pickling" under a flag #9645

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
Aug 26, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class ScalaSettings extends Settings.SettingGroup {
val YshowPrintErrors: Setting[Boolean] = BooleanSetting("-Yshow-print-errors", "Don't suppress exceptions thrown during tree printing.")
val YshowRawQuoteTrees: Setting[Boolean] = BooleanSetting("-Yshow-raw-tree", "Don't remove quote artifacts.")
val YtestPickler: Setting[Boolean] = BooleanSetting("-Ytest-pickler", "Self-test for pickling functionality; should be used with -Ystop-after:pickler.")
val YparallelPickler: Setting[Boolean] = BooleanSetting("-Yparallel-pickler", "Run part of the pickling phase in parallel, disable because it breaks some tests.")
val YcheckReentrant: Setting[Boolean] = BooleanSetting("-Ycheck-reentrant", "Check that compiled program does not contain vars that can be accessed from a global root.")
val YdropComments: Setting[Boolean] = BooleanSetting("-Ydrop-comments", "Drop comments when scanning source files.")
val YcookComments: Setting[Boolean] = BooleanSetting("-Ycook-comments", "Cook the comments (type check `@usecase`, etc.)")
Expand Down
12 changes: 11 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/Pickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ class Pickler extends Phase {
pickled
}(using ExecutionContext.global)
def force(): Array[Byte] = Await.result(pickledF, Duration.Inf)
if ctx.settings.YtestPickler.value then force()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this a Config option? That way it is easier to find where things should be turned on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.


// Turn off parallelism because it lead to non-deterministic CI failures:
// - https://github.com/lampepfl/dotty/runs/1029579877?check_suite_focus=true#step:10:967
// - https://github.com/lampepfl/dotty/runs/1027582846?check_suite_focus=true#step:10:564
//
// Turning off parallelism in -Ytest-pickler and Interactive mode seems to
// work around the problem but I would prefer to not enable this at all
// until the root cause of the issue is understood since it might manifest
// itself in other situations too.
if !ctx.settings.YparallelPickler.value then force()

unit.pickled += (cls -> force)
}
}
Expand Down