Search $PATH on Unix - #5
Conversation
execvp searches a user's $PATH, allowing for the specification of relative paths, which this commit uses by default. This is particularly convenient for users and administrators who wish to set up portable installations or have systems with mercurial filesystem layouts. In introducing this change, the path for `asl` is no longer hard-coded to `/usr/bin/asl`; instead a macro `ASEXE` can be provided. Since its invocations also use execvp, it can be anywhere on $PATH, and thus `ASEXE` defaults to the empty string.
It seems that the Qt Resource Compiler has decided to use `rcc`; as per
the [FHS 3.0][FHS], Debian unpackages this into `/usr/bin` as the
"primary directory" for "most commands" without regard to other
mountpoints (cf. /bin). `/usr/local` is set aside for "software locally
installed" that is "safe from being overwritten when system software is
updated", and is a reasonable choice for unpackaged software such as
this.
Without citation, most Linux hosts I've seen order their PATHs as
`/usr/local/{sbin,bin}`, then `/usr/{sbin,bin}`, then `/{sbin,bin}`,
which means that `/usr/local` will have higher search precedence, making
it particularly suitable for the execvp changes introduced in 4998f38,
while making conflicting binaries (i.e. Qt's `rcc`) still accessible by
absolute path (e.g. `/usr/bin/rcc`) if needed.
[FHS]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
|
The next commit is fine, IMO, to cherry-pick out, but is (1) a tiny change and (2) pursuant with the goals of making this ergonomic on Unix, where file names are entirely case-sensitive. |
The code emitted by this generator was incapable of being assembled on systems with case-sensitive filesystems.
|
Hi: I'm fine with the changes if they still fit the build instructions at:
bill2009/lcc1802: An ANSI C Compiler for the RCA 1802 family of processors (github.com)<https://github.com/bill2009/lcc1802#installing-for-linux>
[https://opengraph.githubassets.com/9349b146470f71af0ddd3063ba297ab06d9404d51eeeba556efdb4f4cfa82f17/bill2009/lcc1802]<https://github.com/bill2009/lcc1802#installing-for-linux>
GitHub - bill2009/lcc1802: An ANSI C Compiler for the RCA 1802 family of processors<https://github.com/bill2009/lcc1802#installing-for-linux>
An ANSI C Compiler for the RCA 1802 family of processors - GitHub - bill2009/lcc1802: An ANSI C Compiler for the RCA 1802 family of processors
github.com
…________________________________
From: Graham Northup ***@***.***>
Sent: August 18, 2023 3:16 PM
To: bill2009/lcc1802 ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [bill2009/lcc1802] Search $PATH on Unix (PR #5)
See the commit messages for further details. In summary, though, these changes should make it much easier to build a portable version of this software, while not sacrificing the ability to compile-in certain paths if need be. The ergonomics on Linux for local administrators is thereby much improved.
________________________________
You can view, comment on, or merge this pull request online at:
#5
Commit Summary
* 4998f38<4998f38> Use execvp instead of execv
* 750c6d0<750c6d0> Recommend /usr/local/bin over /usr/bin
File Changes
(5 files<https://github.com/bill2009/lcc1802/pull/5/files>)
* M README.md<https://github.com/bill2009/lcc1802/pull/5/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5> (8)
* M lcc42/etc/gcc1802.c<https://github.com/bill2009/lcc1802/pull/5/files#diff-bea2727b5f6239e4fecc222a43e061dcf221e300229588cc7436e542c4eefa7d> (4)
* M lcc42/etc/lcc.c<https://github.com/bill2009/lcc1802/pull/5/files#diff-5c7c17e36fcb166adda6552468512f9ab735ae4ac6eef3b4012cd156886e827e> (4)
* M lcc42/etc/lcc2b.c<https://github.com/bill2009/lcc1802/pull/5/files#diff-4e4fdf1499405e8a4ca17d427646ab67c15ae3181c773f99a1c7f8668536074b> (4)
* M lcc42/etc/linux.c<https://github.com/bill2009/lcc1802/pull/5/files#diff-ff9d2c24685c5f85c53686fecfb6b7ae0b8ce023c3d68eb259571cb70cc6f6f3> (7)
Patch Links:
* https://github.com/bill2009/lcc1802/pull/5.patch
* https://github.com/bill2009/lcc1802/pull/5.diff
—
Reply to this email directly, view it on GitHub<#5>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACHWM2XYY25YSAPG2TO5U2TXV65PRANCNFSM6AAAAAA3V5LJ5Y>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Commit 750c6d0 does change those instructions, but they remain largely the same--the only difference is recommending |
See the commit messages for further details. In summary, though, these changes should make it much easier to build a portable version of this software, while not sacrificing the ability to compile-in certain paths if need be. The ergonomics on Linux for local administrators is thereby much improved.