Commit 1aca27a
committed
build: mamake: run shell actions in POSIX mode (re: 11bd592)
On QNX (at least 6.5.0), /bin/cp does not update the target file's
last-modified timestamp by default, unless the POSIX_STRICT
variable is exported. So, as of the referenced commit, repeated
builds without that variable exported fail with "target not
updated" in shell actions that rely on cp(1) to update the target's
timestamp. (And before that, this issue was causing unnecessary
re-execution of other shell actions.)
To avoid similar issues in future, it generally seems like a good
idea to set POSIX compliance mode for the shell and external
commands where available. The shell is launched with argv[0]=="sh"
(see line 1564), which puts several shells in POSIX mode already.
But many external commands, especially the GNU versions, need an
environment variable.
src/cmd/INIT/mamake.c:
- Unconditionally export POSIXLY_CORRECT=y. Though that is
originally a GNU thing, several other systems now use it, too.
- On QNX, export POSIX_STRICT=y to fix /bin/cp and avoid the
described rebuild issues.1 parent 02b5172 commit 1aca27a
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
3009 | 3009 | | |
3010 | 3010 | | |
3011 | 3011 | | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
3012 | 3021 | | |
3013 | 3022 | | |
3014 | 3023 | | |
| |||
0 commit comments