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

Fix invoke.sh not detecting symlinks #6731

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

max-maag
Copy link
Contributor

@max-maag max-maag commented Aug 9, 2024

Summary

When invoke.sh is executed using a symlink with a working directory outside of InvokeAI's root directory, it will fail with the following message:

<path to symlink>: line 23: .venv/bin/activate: No such file or directory

invoke.sh attempts to cd into the correct directory at the start of the script, but will cd into the directory of the symlink instead. This MR fixes that.

QA Instructions

  • Create a symlink to invoke.sh
  • cd into any directory except InvokeAI's root directory
  • Execute invoke.sh using the previously created symlink to verify that the initial problem is fixed
  • Execute invoke.sh directly to verify that this still works

I performed these checks on Arch Linux 6.10.3-arch1-2 (64-bit). I did not test this MR on other Linux distributions or MacOS but to my knowledge readlink is available there as well by default.

Additional Notes

A similar fix may be needed for invoke.bat. I don't have a windows machine and don't know batch well enough to be sure though.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

@github-actions github-actions bot added the installer PRs that change the installer label Aug 9, 2024
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for finding and fixing this.

When invoke.sh is executed using a symlink with a working directory outside of InvokeAI's root directory, it will fail.

invoke.sh attempts to cd into the correct directory at the start of the script, but will cd into the directory of the symlink instead. This commit fixes that.
@psychedelicious psychedelicious merged commit df4dbe2 into invoke-ai:main Aug 16, 2024
14 checks passed
@psychedelicious
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer PRs that change the installer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants