Skip to content
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

simple scripts to run non-bootstrapped compiler after 'sbt buildQuick' #19894

Merged
merged 1 commit into from
May 21, 2024

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Mar 6, 2024

The current scripts in bin are not suitable for iterative development, as they invoke sbt dist/pack whenever any source file has a newer timestamp. Also they are full of magic which I don't think I need for compiler development.

I know there are repl / scala / scalac sbt tasks, but I highly prefer working in zsh versus sbt shell, for example because I can cd to a sandbox directory. Then I run scq A.scala, cfr-decompiler A.class, stuff like that.

This PR is a proposal, I'm curious if anyone else would find it useful.

Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

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

I'd like this (I guess obligatory "what about windows users" - but not a requirement )

@lrytz
Copy link
Member Author

lrytz commented Apr 4, 2024

I missed your review, thanks @bishabosha. I added a paragraph to docs/_docs/contributing/getting-started.md.

bin/scalacQ Outdated Show resolved Hide resolved
project/Build.scala Outdated Show resolved Hide resolved
@lrytz
Copy link
Member Author

lrytz commented Apr 4, 2024

In the current approach, buildQuick depends on fullClasspath, so the user has to guess to re-run buildQuick when the scripts break at some point.

An alternative would be to make buildQuick depend on the compile task, then the workflow would be to always run buildQuick (or ~buildQuick) when working on the codebase. This is sort of how it works in Scala 2. what do you think?

@bishabosha
Copy link
Member

ok so the idea is for the user to replace compile command with buildQuick, when working with these scripts, I guess that makes sense

@smarter
Copy link
Member

smarter commented Apr 4, 2024

I know there are repl / scala / scalac sbt tasks, but I highly prefer working in zsh versus sbt shell

For what it's worth, if you have sbt already started somewhere, you can do sbtn scalac sandbox/foo.scala from your shell.

@dwijnand
Copy link
Member

dwijnand commented Apr 9, 2024

👍🏼 I've missed these, particularly because once I have the scripts I can run scalac on different files in parallel, while even with sbtn I can only run scalac serially.

@lrytz
Copy link
Member Author

lrytz commented Apr 18, 2024

Removed scaladocQ because scaladoc depends on scala3-compiler-bootstrapped which makes buildQuick less quick.

@dwijnand
Copy link
Member

@bishabosha happy to merge this?

Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

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

could probably use a follow up PR to trap exit signals and cleanup like you see in dist/bin, but as its for testing its fine

@bishabosha bishabosha merged commit 24d703c into scala:main May 21, 2024
19 checks passed
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants