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

Launch the manifest-specified Julia version #1059

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tecosaur
Copy link

@tecosaur tecosaur commented Oct 5, 2024

Closes #10.

Auto-installing would be the next step, but let's do that another day 🙂.

Code review would be great, I haven't written rust in years 😉.

Things needed before we can merge:

  • Unit tests for command line parsing functions
  • Feature tests for the entire new functionality

@tecosaur tecosaur force-pushed the manifest-destiny branch 3 times, most recently from 82fcbf0 to 943c9da Compare October 5, 2024 04:43
Copy link
Collaborator

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

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

Very cool!

I'll open a PR against this branch here later today with a config option so that this can be behind a feature flag for a while.

Looking at all the command line parsing, I'm wondering whether we should factor that out a bit more and make it more general than mix it into the rest of the logic as it is right now. In particular because we will also want to know soon whether julia is running in interactive setting or not, which will require more understanding of command line flags.

src/bin/julialauncher.rs Show resolved Hide resolved
src/bin/julialauncher.rs Outdated Show resolved Hide resolved
src/bin/julialauncher.rs Outdated Show resolved Hide resolved
src/bin/julialauncher.rs Outdated Show resolved Hide resolved
@davidanthoff
Copy link
Collaborator

I'll open a PR against this branch here later today with a config option so that this can be behind a feature flag for a while.

I just added this to the PR here via a direct push.

@tecosaur
Copy link
Author

tecosaur commented Oct 6, 2024

Looking at all the command line parsing, I'm wondering whether we should factor that out a bit more and make it more general than mix it into the rest of the logic as it is right now. In particular because we will also want to know soon whether julia is running in interactive setting or not, which will require more understanding of command line flags.

If you take a look at the revised code, you should see the current get_project contains less general code.

Out of curiosity, why would we want to know whether it's being run interactively or not?

@davidanthoff
Copy link
Collaborator

Out of curiosity, why would we want to know whether it's being run interactively or not?

I'd generally like to replace the current prompts that say "Run juliaup update to update" with just a "Do you want to update (y/n)?" interactive prompt, but we must make sure to only show these interactive prompts when Julia itself is run in interactive mode.

For this feature here that would also be relevant: when run interactively, we could prompt for "This project requires Julia version X, do you want to install it (y/n)?", but in non-interactive mode we should just error (and ideally also offer a command line argument that triggers automatic installation).

@tecosaur
Copy link
Author

tecosaur commented Oct 6, 2024

Ah yep, I can see the use of that. I'd be happy to PR that too later (the detection function, not the prompts).

tecosaur and others added 2 commits October 6, 2024 16:29
When running `julia` with no extra arguments, and no explicit version,
it is best to match the manifest version.

This is done by implemented a limited form of the Julia executable's
argument parsing and load path interpreting to determine the appropriate
project to inspect, and then some light ad-hoc parsing of the manifest.

We can then search the installed versions for a matching minor version,
and run that.
@lgoettgens
Copy link

Maybe a stupid question: Starting with julia 1.11, I can have multiple manifest files in one folder. Which one does this feature here choose, if I have a Manifest.toml with 1.10.5, Manifest-v1.11.toml with 1.11.0 and Manifest-v1.12.toml with some 1.12-DEV version?

@tecosaur
Copy link
Author

If you don't specify the Julia version any other way, this will specifically look at the Manifest.toml.

@lgoettgens
Copy link

If you don't specify the Julia version any other way, this will specifically look at the Manifest.toml.

I must admit that this may be a reason for me to stop using juliaup in the future. If I set a default channel in juliaup and use the latest language features, I would still like to get the default channel. Please add a config option to opt-out/opt-in into this feature!

Image the world in a year or so (let's say after the release of 1.13). Everyone will then have Manifest-v1.11.toml, Manifest-v1.12.toml, Manifest-v1.13.toml, Manifest-v1.14.toml (for the upcoming rc), and Manifest-v1.15.toml (for nightly), but if one forgets to delete the old Manifest.toml from nowadays, one would still get 1.10 per this feature.

@tecosaur
Copy link
Author

If you want to use the latest Julia in a project, you can just update the manifest to the newer Julia version, or only have versioned manifests... 🤷

@davidanthoff
Copy link
Collaborator

In my mind the versioned manifest files will be more of a niche thing, at least that is how I imagine things will play out once this feature here lands.

I do think we should have good UI that makes it super, super easy to update a project once a new Julia version comes out. I generally imagine that if you launch Julia with a project that the launcher will check the julia compat section in the Project.toml, cross-check that with the Julia version in the manifest, and if this project could be updated to a newer Julia version, prompt the user whether they want to update the project before the actual Julia launches. We'll need various ways to store answers etc, but roughly that is how I imagine this will work out.

@tecosaur
Copy link
Author

Indeed, I don't think David or I see this as the "final destination" so much as a massive first step to more conveniently reproducible Julia environments.

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.

Start specific Julia version if it is specified in Project.toml/Manifest.toml
4 participants