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

sbt runEngineDistribution ...args... to build and execute the engine #5609

Merged
merged 16 commits into from
Feb 16, 2023

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Feb 10, 2023

Pull Request Description

Automating the assembly of the engine and its execution into a single task. If you are modifying standard libraries, engine sources or Enso tests, you can launch sbt and then just:

sbt:enso> runEngineDistribution --run test/Tests/src/Data/Maybe_Spec.enso
[info] Engine package created at built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev
[info] Executing built-distribution/enso-engine-...-dev/bin/enso --run test/Tests/src/Data/Maybe_Spec.enso
Maybe:  [5/5, 30ms]
    - should have a None variant [14ms]
    - should have a Some variant [5ms]
    - should provide the `maybe` function [4ms]
    - should provide `is_some` [2ms]
    - should provide `is_none` [3ms]
5 tests succeeded.
0 tests failed.unEngineDistribution 4s
0 tests skipped.

the runEngineDistribution sbt input task makes sure all your sources are properly compiled and only then executes your enso source. Everything ready at a single press of Enter.

Important Notes

To debug in chrome dev tools, just add --inspect:

sbt:enso> runEngineDistribution --inspect --run test/Tests/src/Data/Maybe_Spec.enso
E.g. in Chrome open: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9229/7JsgjXlntK8

everything gets build and one can just attach the Enso debugger.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach added -tooling Category: tooling CI: No changelog needed Do not require a changelog entry for this PR. -compiler -libs Libraries: New libraries to be implemented labels Feb 10, 2023
@JaroslavTulach JaroslavTulach self-assigned this Feb 10, 2023
@JaroslavTulach
Copy link
Member Author

CCing Michal, as this enhancement shall work fine with

enso$ ./run backend sbt

as well. E.g. it is not just another helper script, but a step towards ultimate integration with CI tools. Overall I tend to start believing that download related task shall be solved by ./run and interactive tasks for engine developers shall be coded as sbt tasks. The ./run backend sbt would then be the glue to join these two approaches together.

@jdunkerley
Copy link
Member

Nice - could we have this on buildStdLib... as well?

Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

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

Does not suite my personal workflow, as I use custom key bindings for engine building in IntelliJ, but is very helpful nonetheless.

Copy link
Contributor

@4e6 4e6 left a comment

Choose a reason for hiding this comment

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

I suggest moving this logic in the DistributionPackage module.

@JaroslavTulach
Copy link
Member Author

I suggest moving this logic in the DistributionPackage module.

Done in 7a3697d

@JaroslavTulach
Copy link
Member Author

Nice - could we have this on buildStdLib... as well?

Adding this execution to a single task isn't hard - see the current changes in build.sbt - just add new task and set the dependency up.

Adding this to all the various tasks for building libraries requires some sbt trickery I don't have will to investigate. Ideally (as has been suggested elsewhere) we fix the dependency check of buildEngineDistribution and make it fast on its own. Then runEngineDistribution would be good enough.

@JaroslavTulach JaroslavTulach added CI: Ready to merge This PR is eligible for automatic merge and removed CI: No changelog needed Do not require a changelog entry for this PR. labels Feb 13, 2023
```

Then one can execute the launcher:
One can use the `runEngineDistribution` command or execute the launcher:
Copy link
Member

Choose a reason for hiding this comment

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

I know this was already there, but technically this executable is the runner. The launcher is a separate project. Can we rename it to reduce possible confusion?


```bash
enso$ ./built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso --dump-graphs --run yourprogram.enso
enso$ sbt runEngineDistribution --dump-graphs --run yourprogram.enso
Copy link
Member

Choose a reason for hiding this comment

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

This is very cool 🎉

@JaroslavTulach JaroslavTulach added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label Feb 16, 2023
@mergify mergify bot merged commit f53696e into develop Feb 16, 2023
@mergify mergify bot deleted the wip/jtulach/RunEngineDistribution branch February 16, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler -libs Libraries: New libraries to be implemented -tooling Category: tooling CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants