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

add small shell script wrapping port from local sources #204

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

Conversation

danchr
Copy link
Member

@danchr danchr commented Aug 20, 2020

I wanted to test out some changes without upgrading my current installation. This minor script allowed me to do so.

Copy link
Member

@neverpanic neverpanic left a comment

Choose a reason for hiding this comment

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

Strictly speaking, in autotools-based builds, the source directory is not always the build directory, so the tclsh and port executables may actually be located in a subfolder.

However, since out-of-tree building is broken in MacPorts anyway, I'm willing to ignore this.

port.sh Outdated Show resolved Hide resolved
port.sh Outdated Show resolved Hide resolved
@danchr
Copy link
Member Author

danchr commented Oct 10, 2020

Ping?

Copy link
Contributor

@ryandesign ryandesign left a comment

Choose a reason for hiding this comment

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

Being able to run port from the source directory without installing it would be useful for testing. Does this really work? Does it load all of its support files from the source directory, or are there still files it loads from the installation prefix?

port.sh Outdated Show resolved Hide resolved
port.sh Outdated Show resolved Hide resolved
port.sh Outdated Show resolved Hide resolved
@danchr
Copy link
Member Author

danchr commented Oct 11, 2020

Being able to run port from the source directory without installing it would be useful for testing. Does this really work? Does it load all of its support files from the source directory, or are there still files it loads from the installation prefix?

I'll try to run it in opensnoop and see if it accesses ${prefix}, but AFAICT most things do work. Concerning spaces, I just tried to build it in another directory, and ran into this:

config.status: creating Makefile
config.status: creating pkgIndex.tcl
configure: === finished configuring in vendor/thread ([...]/macports-base-3 with space/vendor/thread)
configure: === configuring in vendor/tclx ([...]/macports-base-3 with space/vendor/tclx)
make: *** No rule to make target `distclean'.  Stop.
configure: running /bin/sh ./configure '--cache-file=/dev/null' '--disable-option-checking'  '--prefix=/opt/local/libexec/macports' '--srcdir=.' 'CC=clang' in vendor/tclx
checking for correct TEA configuration... ok (TEA 3.5)
checking for Tcl configuration... found [...]/macports-base-3 with space/vendor/tcl/unix/tclConfig.sh
checking for existence of [...]/macports-base-3 with space/vendor/tcl/unix/tclConfig.sh... loading
./configure: line 1603: [...]/macports-base-3: No such file or directory
configure: error: configure failed for vendor/tclx

I'll see if I can fix this easily.

@danchr danchr force-pushed the script branch 4 times, most recently from a8de8b8 to 2447a82 Compare October 11, 2020 15:30
@danchr
Copy link
Member Author

danchr commented Oct 11, 2020

Okay, I've adjusted the script so that it's generated by configure; that should be more robust. I also added checks for out-of-source builds and build locations containing spaces, since both are broken. The latter is caused by Tcl, and it's non-trivial to fix — I managed to get most things building, but some oddity with configure invoking make still fails.

I've added a small sandbox profile that actively prevents accessing the installed sources, and opensnoop confirms that it works. The only thing accessed within ${prefix} is the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants