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

Use symlink to shorten Lima config path #1458

Closed
wants to merge 1 commit into from

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Feb 2, 2022

Fixes #797

Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

This wouldn't actually solve the issue, as we're running limactl start with the long path (and that's the one emitting the failure).

We will need to fix the nerdctl stub too, of course (because that also spawns limactl), but this isn't the full thing.

Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

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

This kind of setup should be done as soon as the directory is either created or known to exist. The problem with this solution is that we're going to run the same code every time someone runs nerdctl.

So setting up the symlink after LAS/rd/lima is first created should happen at

await fs.promises.mkdir(path.dirname(this.CONFIG_PATH), { recursive: true });
.

Creating a symlink when the LAS/rd/lima already exists could actually be done on upgrades only by leveraging the settings update table at

const CURRENT_SETTINGS_VERSION = 4;
and adding a setting for 4: at . If we don't want to overload the settings module with non-settings stuff we could just check for an existing symlink in the else part of the above code.

Or did I miss something?

@jandubois
Copy link
Member

There are a number of issues to think through:

  • what is the name we want to create? Is ~/.lima-rd the right one (it doesn't tab-complete when you already have ~/.lima)?
  • what do we do when both ~/Library/Application\ Support/rancher-desktop/lima and ~/.lima-rd exist?
  • how do we migrate an existing install from the current name to the symlink setup
  • how does this affect the code excluding the directory from time machine backups?
  • should the symlink always be created, or only when necessary?

I'm tempted to move this discussion into a new issue, as this should be hashed out before coding starts... 😄

@jandubois
Copy link
Member

Please move discussion to #1465

@mook-as
Copy link
Contributor

mook-as commented Feb 7, 2022

Closing this PR — this needs to be done in the TypeScript code (and will probably more discussion before we can agree on the details of the implementation).

Thanks for getting this rolling!

@mook-as mook-as closed this Feb 7, 2022
@jsoref jsoref deleted the shorten-lima-link branch February 7, 2022 19:19
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.

"Starting virtual machine" step fails due to SSH socket path being too long.
4 participants