asdf icon indicating copy to clipboard operation
asdf copied to clipboard

Ensure we are using installation location instead of symlink location

Open deiga opened this issue 5 years ago • 10 comments

Summary

Change to resolve actual asdf script location before sourcing anything. Ensures that we are not using symlink location as basis for sourcing.

Fixes:

  • https://github.com/asdf-vm/asdf/issues/607

deiga avatar Mar 06 '20 09:03 deiga

I've also created a PR to Homebrew to change the formula, now that symlink resolution works the right way https://github.com/Homebrew/homebrew-core/pull/51200

deiga avatar Mar 06 '20 09:03 deiga

Nice @deiga, thanks for fixing this. 👍

There's also a resolve_symlink on utils.bash. May we remove it, and replace any resolve_symlink usage for normalized_readlink and see if everything is ok ?

vic avatar Mar 06 '20 13:03 vic

It would be great to have a test for this so we can prevent regressions.

Stratus3D avatar Mar 06 '20 15:03 Stratus3D

@Stratus3D @vic I actually realized a simpler way to fix this. Any changes to the Homebrew formula are unnecessary now.

It also turned out, that resolve_symlink was not able to actually resolve symlinks properly.

We've still got the problem with readlink in banned commands test though.

deiga avatar Mar 08 '20 17:03 deiga

@deiga How is the work on this going? Can you rebase to remove the false negative of Appveyor?

jthegedus avatar Apr 21 '20 06:04 jthegedus

@jthegedus I'm waiting on further comments. I rebased in the meantime

deiga avatar Apr 21 '20 12:04 deiga

@Stratus3D Are you able to review, rebase and potentially merge this? It seems @deiga may have resolved all the requested changes.

jthegedus avatar Apr 05 '23 14:04 jthegedus

@deiga @jthegedus re-reviewing this now.

Stratus3D avatar Apr 12 '23 12:04 Stratus3D

I'm going to merge https://github.com/asdf-vm/asdf/pull/1539 and then this PR can be rebased and merged.

Stratus3D avatar Apr 13 '23 13:04 Stratus3D

@deiga can you rebase this PR? I've merged some changes so only readlink -f is banned now. I think we can merge your changes after another rebase.

Stratus3D avatar Apr 13 '23 14:04 Stratus3D