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

Fixes for relocatability [round 2] #74

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Keno
Copy link
Contributor

@Keno Keno commented May 3, 2021

I'm updating our distribution of magic and noticed that my fixes in #41
had broken, so this attempts to restore them. I understand that there's
a number of different configurations that people use magic in, so I'm
happy to carry these locally in our distribution setup if they break something
else, but I figured I'd at least have another go at it.

The three changes here are:

  • Restoration of the automatic CAD_ROOT detection from the bin/magic script.

I understand this got reverted in c0867ef because it broke symlinking to the script. This adds an extra readlink -f to fix that corner case. However, since I don't know the exact details of what broke there, it'd be good to verify that.

  • In merging Build system tweaks to make magic more relocatable #41, there was a change to just respect an already set CAD_ROOT rather than using the CAD_ROOT_DEFAULT variable I added. However, the corresponding creation of the CAD_ROOT_DEFAULT variable in magic.tcl was not adjusted, so cad root was not set automatically. Fix that by renaming the CAD_ROOT_DEFAULT to CAD_ROOT there also (making sure to respect it if already set).
  • Also fix relocation of magicdnull and magicexec. This fixes downstream tooling that does things like magic --version which currently just starts a tcl interpreter (blocking forever) is magic.tcl is not found because it was relocated.

Keno added 4 commits May 2, 2021 22:27
…e it breaks compatibility"

This reverts commit c0867ef.
In merging the original pull request, the C side was changed
to respect an originally set CAD_ROOT rather than defaulting
to CAD_ROOT_DEFAULT. However, this was left, so the code
never actually took effect. Rename the variable being set
to CAD_ROOT, but make it conditional to respect an external
user's override of CAD_ROOT.
By making the magic.tcl path relative to the path of the executable
itself rather than embedding the path during build time.
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.

1 participant