-
Notifications
You must be signed in to change notification settings - Fork 988
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
find boot files relative to executable by default #755
Conversation
Consistency across platforms is great. Maybe we can go further to uniform
With Changing signature of |
That path is not quite right in general, though, because the actual middle search path depends on the relative path from
On reflection, |
8219e9c
to
eab4f5c
Compare
Building on recent support for "%x" everywhere, the change here makes the default boot-file search path "%x:%x/../lib/csv%v/%m:%x/../../boot/%m" which searches in the immediate directory, then in the place relative to the executable's install location to reach installed boot files, and then relative to the workarea executable to reach workarea boot files. More precisely, the middle path in the default takes into account the configured bin and lib target directories. As a result of this change, it's much easier to run a just-built executable before installing it, and installing to a non-system directory produces something that you can move around in the filesystem. As a further step to make things work in the default way, `configure` now supports `--prefix` as an alias for `--installprefix`. The `--installabsolute` flag uses the old default search path, which is absolute relative to the target installation directory.
This PR builds on #732 by changing the default boot-file search path to
which searches in the executable's directory, through a relative path that works post-installation, and through a relative path that works within the workarea. (More precisely, the middle path in the default takes into account the configured bin and lib target directories.)
After the change, it's much easier to run a just-built executable before installing. Also, installing produces something that you can move around in the filesystem.
As a further step to make things work in the default way,
configure
is changed to recognize--prefix
as an alias for--installprefix
. The--installabsolute
flag uses the old default search path, which is absolute relative to the target installation directory.Potential discussion points:
I'm not sure about putting
%x
as the first search path. The intent is to be consistent with Windows and to make it easy for someone to gather files into a single directory and still havescheme
run.Instead of changing the default configuration while adding
--installabsolute
to get the old bevahior, the new behavior could be opt-in with--installabs
. I think the new behavior is easier to work with, but the extra path operations and searching aren't useful or unnecessary in a conventional installation.The
main
program communicatesargv[0]
to%x
resolution through a newSregister_argv0
function. That function isn't needed on platforms and configurations where the process executable's path can be discovered, but usingargv[0]
supports a general and portable fallback.