Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package samurai for openSUSE:Factory checked in at 2026-09-17 15:20:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/samurai (Old) and /work/SRC/openSUSE:Factory/.samurai.new.383539 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "samurai" Thu Sep 17 15:20:01 2026 rev:4 rq:1378343 version:1.3 Changes: -------- --- /work/SRC/openSUSE:Factory/samurai/samurai.changes 2025-06-12 15:54:56.481368546 +0200 +++ /work/SRC/openSUSE:Factory/.samurai.new.383539/samurai.changes 2026-09-17 15:21:19.722784810 +0200 @@ -1,0 +2,9 @@ +Sun Sep 13 06:20:26 UTC 2026 - Martin Pluskal <[email protected]> + +- Update to 1.3: + * Forward SIGTERM, SIGINT, SIGHUP and SIGQUIT to child jobs + * Propagate mtime of newest input of phony targets + * Fix default maxjob detection + * Clearer error message when reading from the signal pipe + +------------------------------------------------------------------- Old: ---- samurai-1.2+git41.g737f702.tar.gz New: ---- samurai-1.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ samurai.spec ++++++ --- /var/tmp/diff_new_pack.Qutwq6/_old 2026-09-17 15:21:20.322809976 +0200 +++ /var/tmp/diff_new_pack.Qutwq6/_new 2026-09-17 15:21:20.327810186 +0200 @@ -1,7 +1,7 @@ # # spec file for package samurai # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,15 +16,13 @@ # -%global git_ref 737f702fed670acb25e5e70b4b802690df7a4a8b - Name: samurai -Version: 1.2+git41.g737f702 +Version: 1.3 Release: 0 Summary: C99 implementation of the ninja build tool License: Apache-2.0 URL: https://github.com/michaelforney/samurai -Source0: %{URL}/archive/%{git_ref}/%{name}-%{version}.tar.gz +Source: https://github.com/michaelforney/samurai/releases/download/%version/samurai-%version.tar.gz BuildRequires: c_compiler BuildRequires: make @@ -37,13 +35,13 @@ and 4, respectively. %prep -%autosetup -n %{name}-%{git_ref} -p1 +%autosetup -p1 %build export CC=cc %set_build_flags -make clean +%make_build clean %make_build %install @@ -51,6 +49,6 @@ %files %license LICENSE -%_bindir/* -%_mandir/man1/*.1* +%_bindir/samu +%_mandir/man1/samu.1* ++++++ samurai-1.2+git41.g737f702.tar.gz -> samurai-1.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/.github/workflows/build.yml new/samurai-1.3/.github/workflows/build.yml --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/.github/workflows/build.yml 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/.github/workflows/build.yml 2026-04-06 01:16:59.000000000 +0200 @@ -7,8 +7,11 @@ strategy: matrix: os: [ubuntu-latest, macOS-latest] + include: + - os: macOS-latest + flags: LDLIBS= runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 - name: make - run: make + run: make ${{ matrix.flags }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/LICENSE new/samurai-1.3/LICENSE --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/LICENSE 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/LICENSE 2026-04-06 01:16:59.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright © 2017-2021 Michael Forney +Copyright © 2017-2026 Michael Forney Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/build.c new/samurai-1.3/build.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/build.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/build.c 2026-04-06 01:16:59.000000000 +0200 @@ -8,6 +8,7 @@ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/wait.h> #include <time.h> #include <unistd.h> @@ -34,6 +35,7 @@ static size_t nstarted, nfinished, ntotal; static bool consoleused; static struct timespec starttime; +static int sigfd[2]; void buildreset(void) @@ -59,11 +61,16 @@ e = n->gen; if (e->rule == &phonyrule) { - if (e->nin > 0 || n->mtime != MTIME_MISSING) - return false; - if (buildopts.explain) - warn("explain %s: phony and no inputs", n->path->s); - return true; + if (n->mtime == MTIME_MISSING) { + if (e->nin == 0) { + if (buildopts.explain) + warn("explain %s: phony and no inputs", n->path->s); + return true; + } + if (newest) + n->mtime = newest->mtime; + } + return false; } if (n->mtime == MTIME_MISSING) { if (buildopts.explain) @@ -539,19 +546,46 @@ #endif } +static void +catchsig(int sig) +{ + write(sigfd[1], &sig, sizeof(sig)); +} + void build(void) { + static const int sigs[] = { + SIGHUP, + SIGINT, + SIGQUIT, + SIGTERM, + }; struct job *jobs = NULL; struct pollfd *fds = NULL; size_t i, next = 0, jobslen = 0, maxjobs = buildopts.maxjobs, numjobs = 0, numfail = 0; struct edge *e; + struct sigaction sa; + int sig; + ssize_t ret; if (ntotal == 0) { warn("nothing to do"); return; } + if (pipe(sigfd) != 0) + fatal("pipe:"); + if (fcntl(sigfd[0], F_SETFD, FD_CLOEXEC) != 0 || fcntl(sigfd[1], F_SETFD, FD_CLOEXEC) != 0) + fatal("fcntl CLOEXEC:"); + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = catchsig; + sa.sa_flags = SA_RESTART; + for (i = 0; i < countof(sigs); ++i) { + if (sigaction(sigs[i], &sa, NULL) != 0) + warn("sigaction %d:", sigs[i]); + } + clock_gettime(CLOCK_MONOTONIC, &starttime); formatstatus(NULL, 0); @@ -579,7 +613,7 @@ if (jobslen > buildopts.maxjobs) jobslen = buildopts.maxjobs; jobs = xreallocarray(jobs, jobslen, sizeof(jobs[0])); - fds = xreallocarray(fds, jobslen, sizeof(fds[0])); + fds = xreallocarray(fds, jobslen + 1, sizeof(fds[0])); for (i = next; i < jobslen; ++i) { jobs[i].buf.data = NULL; jobs[i].buf.len = 0; @@ -588,6 +622,8 @@ fds[i].fd = -1; fds[i].events = POLLIN; } + fds[i].fd = sigfd[0]; + fds[i].events = POLLIN; } fds[next].fd = jobstart(&jobs[next], e); if (fds[next].fd < 0) { @@ -600,8 +636,29 @@ } if (numjobs == 0) break; - if (poll(fds, jobslen, 5000) < 0) - fatal("poll:"); + for (;;) { + if (poll(fds, jobslen + 1, 5000) >= 0) + break; + if (errno != EINTR) + fatal("poll:"); + } + if (fds[jobslen].revents & POLLIN) { + ret = read(sigfd[0], &sig, sizeof(sig)); + if (ret == -1) + fatal("read signal:"); + if (ret != sizeof sig) + fatal("read signal: unexpected size"); + warn("received signal: %s", strsignal(sig)); + for (i = 0; i < jobslen; ++i) { + if (fds[i].fd != -1) + kill(jobs[i].pid, sig); + } + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = SIG_DFL; + sigaction(sig, &sa, NULL); + raise(sig); + exit(128 + sig); + } for (i = 0; i < jobslen; ++i) { if (!fds[i].revents || jobwork(&jobs[i])) continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/os-posix.c new/samurai-1.3/os-posix.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/os-posix.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/os-posix.c 2026-04-06 01:16:59.000000000 +0200 @@ -83,3 +83,13 @@ #endif } } + +long +osnproc(void) +{ +#ifdef _SC_NPROCESSORS_ONLN + return sysconf(_SC_NPROCESSORS_ONLN); +#else + return 1; +#endif +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/os.h new/samurai-1.3/os.h --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/os.h 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/os.h 2026-04-06 01:16:59.000000000 +0200 @@ -7,3 +7,5 @@ int osmkdirs(struct string *, _Bool); /* queries the mtime of a file in nanoseconds since the UNIX epoch */ int64_t osmtime(const char *); +/* queries the number of online processors */ +long osnproc(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/samu.c new/samurai-1.3/samu.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/samu.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/samu.c 2026-04-06 01:16:59.000000000 +0200 @@ -102,7 +102,7 @@ argv[0] = NULL; arg = strtok(env, " "); while (arg) { - if ((size_t)argc >= LEN(argvbuf) - 1) + if ((size_t)argc >= countof(argvbuf) - 1) fatal("too many arguments in SAMUFLAGS"); argv[argc++] = arg; arg = strtok(NULL, " "); @@ -200,8 +200,7 @@ } ARGEND argdone: if (!buildopts.maxjobs) { -#ifdef _SC_NPROCESSORS_ONLN - long nproc = sysconf(_SC_NPROCESSORS_ONLN); + long nproc = osnproc(); switch (nproc) { case -1: case 0: case 1: buildopts.maxjobs = 2; @@ -213,9 +212,6 @@ buildopts.maxjobs = nproc + 2; break; } -#else - buildopts.maxjobs = 2; -#endif } buildopts.statusfmt = getenv("NINJA_STATUS"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/scan.c new/samurai-1.3/scan.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/scan.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/scan.c 2026-04-06 01:16:59.000000000 +0200 @@ -151,7 +151,7 @@ {"rule", RULE}, {"subninja", SUBNINJA}, }; - int low = 0, high = LEN(keywords) - 1, mid, cmp; + int low = 0, high = countof(keywords) - 1, mid, cmp; for (;;) { switch (s->chr) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/tool.c new/samurai-1.3/tool.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/tool.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/tool.c 2026-04-06 01:16:59.000000000 +0200 @@ -451,7 +451,7 @@ size_t i; t = NULL; - for (i = 0; i < LEN(tools); ++i) { + for (i = 0; i < countof(tools); ++i) { if (strcmp(name, tools[i].name) == 0) { t = &tools[i]; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/util.c new/samurai-1.3/util.c --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/util.c 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/util.c 2026-04-06 01:16:59.000000000 +0200 @@ -189,7 +189,7 @@ continue; } } - if (n == LEN(component)) + if (n == countof(component)) fatal("path has too many components: %s", path->s); component[n++] = d; while (*s != '/' && *s != '\0') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/util.h new/samurai-1.3/util.h --- old/samurai-737f702fed670acb25e5e70b4b802690df7a4a8b/util.h 2025-03-03 21:27:25.000000000 +0100 +++ new/samurai-1.3/util.h 2026-04-06 01:16:59.000000000 +0200 @@ -15,7 +15,9 @@ struct evalstring *next; }; -#define LEN(a) (sizeof(a) / sizeof((a)[0])) +#ifndef countof +#define countof(a) (sizeof(a) / sizeof((a)[0])) +#endif void warn(const char *, ...); void fatal(const char *, ...);
