Skip to content

Commit f8f4dc7

Browse files
committed
scripts/jobserver-exec: parse the last --jobserver-auth= option
In the GNU Make manual, the section "Sharing Job Slots with GNU make" says: Be aware that the MAKEFLAGS variable may contain multiple instances of the --jobserver-auth= option. Only the last instance is relevant. Take the last element of the array, not the first. Link: https://www.gnu.org/software/make/manual/html_node/Job-Slots.html Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent be5ea98 commit f8f4dc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/jobserver-exec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ try:
2323
opts = [x for x in flags.split(" ") if x.startswith("--jobserver")]
2424

2525
# Parse out R,W file descriptor numbers and set them nonblocking.
26-
fds = opts[0].split("=", 1)[1]
26+
# If the MAKEFLAGS variable contains multiple instances of the
27+
# --jobserver-auth= option, the last one is relevant.
28+
fds = opts[-1].split("=", 1)[1]
2729
reader, writer = [int(x) for x in fds.split(",", 1)]
2830
# Open a private copy of reader to avoid setting nonblocking
2931
# on an unexpecting process with the same reader fd.

0 commit comments

Comments
 (0)