Skip to content

Fix relative path resolution in "mix release" for symlinked scripts #13796

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

Merged
merged 6 commits into from
Aug 27, 2024

Conversation

jdanielnd
Copy link
Contributor

This PR addresses an issue (#13672) with path resolution in mix release when scripts are executed via relative symlinks.

The original script did not correctly resolve paths, leading to errors when the release script was invoked through a symlink that pointed to a relative path.

The fix ensures that SELF is always resolved to an absolute path, regardless of how the script is invoked.

This update improves the reliability of release scripts in environments where symlinks are used. Additionally, tests have been added to verify that both absolute and relative symlinks work correctly with the updated path resolution logic.

@jdanielnd
Copy link
Contributor Author

I'm investigating the Windows failing tests

@josevalim
Copy link
Member

Symlinks are actually tricky on Windows. Maybe you can try using hard link (File.ln) instead of symbolic ones on Windows, but I am also fine with skipping these tests on Windows (because the traversal issue is pretty much exclusive to Unix anyway).

@josevalim josevalim merged commit e1b265a into elixir-lang:main Aug 27, 2024
9 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants