From 7741008a0a804e7078a18735dc7b7d65bad6b17d8e9302c63b04691ede94ac2c Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sun, 22 Jun 2025 14:10:11 +0000 Subject: [PATCH] Accepting request 1286782 from home:mathletic:branches:devel:tools:building - update to 1.13.0 * Ninja now automatically joins a GNU Make jobserver as a client (version 4.4 on non-Windows systems required for "fifo" style) * Print exit code of failed subcommands * ninja -t compdb accepts a target * Support for ANSI (color) escape codes in NINJA_STATUS OBS-URL: https://build.opensuse.org/request/show/1286782 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/ninja?expand=0&rev=68 --- .gitattributes | 23 +++ .gitignore | 1 + _multibuild | 3 + macros.ninja | 12 ++ ninja-1.12.1.tar.gz | 3 + ninja-1.13.0.tar.gz | 3 + ninja-disable-maxprocs-test.patch | 41 ++++ ninja-re2c-g.patch | 11 ++ ninja.changes | 308 ++++++++++++++++++++++++++++++ ninja.spec | 91 +++++++++ 10 files changed, 496 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 macros.ninja create mode 100644 ninja-1.12.1.tar.gz create mode 100644 ninja-1.13.0.tar.gz create mode 100644 ninja-disable-maxprocs-test.patch create mode 100644 ninja-re2c-g.patch create mode 100644 ninja.changes create mode 100644 ninja.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/macros.ninja b/macros.ninja new file mode 100644 index 0000000..9ca7b4c --- /dev/null +++ b/macros.ninja @@ -0,0 +1,12 @@ +%__ninja %{_bindir}/ninja +%__ninja_common_opts -v %{?_smp_mflags} + +%ninja_build \ + %{__ninja} %{__ninja_common_opts} + +%ninja_install \ + DESTDIR=%{buildroot} %{__ninja} install %{__ninja_common_opts} + +%ninja_test \ + %{__ninja} test %{__ninja_common_opts} + diff --git a/ninja-1.12.1.tar.gz b/ninja-1.12.1.tar.gz new file mode 100644 index 0000000..da2a399 --- /dev/null +++ b/ninja-1.12.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:821bdff48a3f683bc4bb3b6f0b5fe7b2d647cf65d52aeb63328c91a6c6df285a +size 240483 diff --git a/ninja-1.13.0.tar.gz b/ninja-1.13.0.tar.gz new file mode 100644 index 0000000..3cb2987 --- /dev/null +++ b/ninja-1.13.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f08641d00099a9e40d44ec0146f841c472ae58b7e6dd517bee3945cfd923cedf +size 291328 diff --git a/ninja-disable-maxprocs-test.patch b/ninja-disable-maxprocs-test.patch new file mode 100644 index 0000000..e2e8422 --- /dev/null +++ b/ninja-disable-maxprocs-test.patch @@ -0,0 +1,41 @@ +Index: src/subprocess_test.cc +=================================================================== +--- a/src/subprocess_test.cc.orig ++++ b/src/subprocess_test.cc +@@ -216,36 +216,6 @@ TEST_F(SubprocessTest, SetWithMulti) { + } + } + +-#if defined(USE_PPOLL) +-TEST_F(SubprocessTest, SetWithLots) { +- // Arbitrary big number; needs to be over 1024 to confirm we're no longer +- // hostage to pselect. +- const unsigned kNumProcs = 1025; +- +- // Make sure [ulimit -n] isn't going to stop us from working. +- rlimit rlim; +- ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlim)); +- if (rlim.rlim_cur < kNumProcs) { +- printf("Raise [ulimit -n] above %u (currently %lu) to make this test go\n", +- kNumProcs, rlim.rlim_cur); +- return; +- } +- +- vector procs; +- for (size_t i = 0; i < kNumProcs; ++i) { +- Subprocess* subproc = subprocs_.Add("/bin/echo"); +- ASSERT_NE((Subprocess *) 0, subproc); +- procs.push_back(subproc); +- } +- while (!subprocs_.running_.empty()) +- subprocs_.DoWork(); +- for (size_t i = 0; i < procs.size(); ++i) { +- ASSERT_EQ(ExitSuccess, procs[i]->Finish()); +- ASSERT_NE("", procs[i]->GetOutput()); +- } +- ASSERT_EQ(kNumProcs, subprocs_.finished_.size()); +-} +-#endif // !__APPLE__ && !_WIN32 + + // TODO: this test could work on Windows, just not sure how to simply + // read stdin. diff --git a/ninja-re2c-g.patch b/ninja-re2c-g.patch new file mode 100644 index 0000000..1cfaa90 --- /dev/null +++ b/ninja-re2c-g.patch @@ -0,0 +1,11 @@ +--- ninja-1.11.0/configure.py.orig 2022-05-18 10:45:04.772811782 +0200 ++++ ninja-1.11.0/configure.py 2022-05-18 10:45:13.968857314 +0200 +@@ -479,7 +479,7 @@ + return False + if has_re2c(): + n.rule('re2c', +- command='re2c -b -i --no-generation-date --no-version -o $out $in', ++ command='re2c -g -b -i --no-generation-date --no-version -o $out $in', + description='RE2C $out') + # Generate the .cc files in the source directory so we can check them in. + n.build(src('depfile_parser.cc'), 're2c', src('depfile_parser.in.cc')) diff --git a/ninja.changes b/ninja.changes new file mode 100644 index 0000000..5ada1d8 --- /dev/null +++ b/ninja.changes @@ -0,0 +1,308 @@ +------------------------------------------------------------------- +Wed Jun 18 19:34:41 UTC 2025 - Christoph G + +- update to 1.13.0 + * Ninja now automatically joins a GNU Make jobserver as a client + (version 4.4 on non-Windows systems required for "fifo" style) + * Print exit code of failed subcommands + * ninja -t compdb accepts a target + * Support for ANSI (color) escape codes in NINJA_STATUS + +------------------------------------------------------------------- +Fri May 24 20:52:03 UTC 2024 - Christoph G + +- update to 1.12.1 + * Dry run error if the build directory does not exist + * New critical path scheduler performance improvements + +------------------------------------------------------------------- +Tue May 7 13:45:10 UTC 2024 - Christoph G + +- Move testing and its dependency google-test into a separate + package + +------------------------------------------------------------------- +Sat May 4 21:31:20 UTC 2024 - Christoph G + +- Use build dependency googletest-devel instead of gtest to + break dependency cycle + +------------------------------------------------------------------- +Tue Apr 30 17:40:20 UTC 2024 - Christoph G + +- update to 1.12.0 + * Critical path scheduler which orders the jobs by their runtime + history. This may break your build if you haven't specified + your dependencies correctly. + * Resiliency against inputs changing during the build + * Reliable ETA and progress percentage in status #1963 +- Use CMake as build system + +------------------------------------------------------------------- +Wed Aug 31 05:32:49 UTC 2022 - Christoph G + +- update to 1.11.1: + * A fix for a potential SIGFPE in the new (Docker-compatible) + default number of jobs detection. + +------------------------------------------------------------------- +Wed May 18 08:46:55 UTC 2022 - Paolo Stivanin + +- update to 1.11.0: + * this release adds Validation Nodes which are a new way to add jobs + like linters or static analyzers to the build graph + * support cpu limit on docker + * fixes to disk_interface + * fixes to ninja -t parameter + * optimize ninja -d stats + * add -q (quiet) option +- rebase ninja-disable-maxprocs-test.patch +- rebase ninja-re2c-g.patch + +------------------------------------------------------------------- +Mon Apr 5 21:51:58 UTC 2021 - Cristian Rodríguez + +- ninja-re2c-g.patch tell re2c to generate gcc specific code using + the -g flag, this usually results in lexers that are 20-25% faster. + +------------------------------------------------------------------- +Tue Dec 29 18:55:10 UTC 2020 - Dirk Müller + +- update to 1.10.2: + * The browse tool is now enabled when building with CMake + (so it's part of the official binaries again) + * it should now work in all circumstances to run the restat tool + by the generator on Windows + +------------------------------------------------------------------- +Wed Nov 4 16:33:12 UTC 2020 - Ludwig Nussel + +- LFS fix for 32bit arch builds (gh#ninja-build/ninja#829) + +------------------------------------------------------------------- +Mon Aug 24 20:25:43 UTC 2020 - Dirk Mueller + +- update to 1.10.1: + * https://groups.google.com/g/ninja-build/c/QQM54eAhrjU/m/q5zn_zTlAQAJ + +------------------------------------------------------------------- +Mon Feb 3 21:21:44 UTC 2020 - Christoph G + +- update to version 1.10.0: + * New dyndep binding to support Fortran and C++20 modules + * Also there are three new tools: cleandead, restat, rules + +------------------------------------------------------------------- +Wed Sep 11 12:49:19 UTC 2019 - Martin Pluskal + +- Run more tests +- Small spec file improvements + +------------------------------------------------------------------- +Wed Jan 30 20:23:01 UTC 2019 - Christoph G + +- Update to version 1.9.0: + * High-resolution timestamps +- Update ninja-disable-maxprocs-test.patch to include + upstream changes +- Drop ninja-64bit-timestamps.patch as it is part of 1.9.0 + +------------------------------------------------------------------- +Mon Jan 14 13:27:10 UTC 2019 - Adam Mizerski + +- fix bash-completion path + +------------------------------------------------------------------- +Thu Dec 6 09:56:57 UTC 2018 - Ismail Dönmez + +- Add ninja-64bit-timestamps.patch from upstream to use 64bit + timestamps, fixes bsc#1118619 +- Fix bash-completion install path + +------------------------------------------------------------------- +Tue Sep 12 08:38:18 UTC 2017 - mpluskal@suse.com + +- Update to version 1.8.2: + * Restore tolerance of self-referencing phony build statements + * Factor ManifestParser options into a structure +- Drop support for building on old distributions + +------------------------------------------------------------------- +Thu Sep 7 14:44:24 UTC 2017 - idonmez@suse.com + +- Version update to 1.8.1 + * Support more path components + * Performance improvement in highly parallerized and large build + +------------------------------------------------------------------- +Wed Dec 7 09:52:57 UTC 2016 - mpluskal@suse.com + +- Add macros.ninja (boo#1014177) +- Backport latest release to SLE12 bsc#1055189 fate#323787 + +------------------------------------------------------------------- +Tue Dec 6 14:07:36 UTC 2016 - badshah400@gmail.com + +- Add macros.ninja as an external source file and install it to + the %{_rpmconfigdir}/macros.d/; this installs macros for RPM + that are in turn used by the RPM macros for meson. + +------------------------------------------------------------------- +Sun Nov 13 11:08:00 UTC 2016 - mpluskal@suse.com + +- Update to version 1.7.2: + * %e and %r work again in dumb terminals (#1146, #1148) + * `-t browse` now HTML-escapes rule names (#1157) + * an edge may now have 0 explicit outputs if it has implicit + outputs (#1159) + * make misc/measure.py python 3-compatible + * misc/write_fake_manifest.py now optionally writes source files, + use it to quickly produce large, buildable projects for testing + (#1109, #1198) + * on newer FreeBSDs, use ppoll() +- Refresh ninja-disable-maxprocs-test.patch + +------------------------------------------------------------------- +Fri Apr 29 17:34:13 UTC 2016 - idonmez@suse.com + +- Update to version 1.7.1 + * Change default NINJA_STATUS to [%f/%t] github issue #1143 + +------------------------------------------------------------------- +Thu Apr 28 05:24:46 UTC 2016 - foss@grueninger.de + +- update to version 1.7.0 + * ninja now supports implicit outputs. + * Ninja's output has slightly changed, to make it easier to + automated tools to look at ninja's output. + * Ninja now explicitly handles SIGHUP and cleans up after itself. + * Ninja now uses posix_spawn instead of fork/exec to launch + subprocesses (on POSIX). +- adjust links to new wesite + +------------------------------------------------------------------- +Tue Apr 26 13:27:25 UTC 2016 - matz@suse.de + +- Make it build on SLE11 (use python2 there). + +------------------------------------------------------------------- +Tue Feb 23 10:48:59 UTC 2016 - sndirsch@suse.com + +- needed for building current llvm on sle12 + (fate #315643-315645, 319159-319161, 319618) + +------------------------------------------------------------------- +Sat Jan 30 21:39:59 UTC 2016 - mpluskal@suse.com + +- Update dependencies +- Use optflags when building +- Make building more verbose + +------------------------------------------------------------------- +Wed Jul 1 08:04:09 UTC 2015 - foss@grueninger.de + +- Update to version 1.6.0 + * rules are now scoped to the subninja they're in. + * dupe edges with multiple outputs now uses first edge + instead of last (#867) + * pools actually work now + * generators can now run more often than twice if needed + * unexpected output names now cause a rebuild instead of + a hard error + * POSIX-specific changes + + child processes get detached from terminal + + check for SIGINT after ppoll/pselect -> faster Ctrl-C + + add an explicit SIGTERM signal handler + * Ran ninja under afl-fuzz and fixed all crashes and bugs it found + + fix crashes on cyclic graphs with multiple outputs + + failing stat() now aborts build + + cyclic rule bindings no longer crash + + dependency cycles with multiple outputs no longer get + ninja into a stuck state +- Update ninja-disable-maxprocs-test.patch to match upstream + changes +- use Python 3 for configure + +------------------------------------------------------------------- +Wed Nov 26 07:42:03 UTC 2014 - idonmez@suse.com + +- Update to version 1.5.3 + * Reaping finished subprocesses now has precedence over + starting new jobs + * ninja no longer depends on googletest +- Install bash/zsh completion +- Install vim syntax file +- Implement %check +- Add ninja-disable-maxprocs-test.patch to disable max procs test, + it needs a ulimit raise. + +------------------------------------------------------------------- +Thu Sep 11 10:21:01 UTC 2014 - idonmez@suse.com + +- Only depend on python-base to trim down BuildRequires +- Do not build the html manual +- Use upstream pristine tarball + +------------------------------------------------------------------- +Sun Jun 29 10:25:33 UTC 2014 - idonmez@suse.com + +- Update to version 1.5.1 + * Recompacting removes more entries from the build and deps logs. + * Add a manifest parsing perftest and generator that generates + random build manifests. + * $in, $out are escaped more robustly. + * `depfile=$out.d` now works if $out gets escaped. + * ninja doesn't error out when it tries to create a directory and + the directory already exists. + * Ninja now accepts both / and \ on windows when making directories. + * \r\n line endings are now accepted in depfiles. + * depfile file names can now contain '{' and '}'. + * -t compdb no longer crashes on edges with emtpy inputs. + * 'keeprsp' is now included in the spelling suggestestions for -d + * Many improvements to ninja-mode.el. + * ninja_syntax.py is now faster. + * bash completion and zsh completion provides completions more often. + * ninja.vim now highlights $$ correctly. + +------------------------------------------------------------------- +Wed Sep 18 08:32:52 UTC 2013 - idonmez@suse.com + +- Update to version 1.4.0 + * Bug fixes +- Fix version field. Its 1.x not 3.x + +------------------------------------------------------------------- +Wed Jun 5 14:36:06 UTC 2013 - idonmez@suse.com + +- Update to git hash 0f53fd3 + * Version 3.0 now + * Don't poll pipes using POLLRDHUP + * Recompact the deps log when it gets too big + +------------------------------------------------------------------- +Wed Apr 17 09:19:56 UTC 2013 - idonmez@suse.com + +- Update to git hash 7bf53c6 + * Build ninja itself in deps mode + * Bugfixes + * Documentation updates + +------------------------------------------------------------------- +Tue Mar 12 15:51:24 UTC 2013 - idonmez@suse.com + +- Update to git hash ecc876e + * Add compdb command to generate compile_commands.json for clang. + * Add elapsed time (%e) to NINJA_STATUS. + +------------------------------------------------------------------- +Fri Feb 22 13:22:33 UTC 2013 - idonmez@suse.com + +- Update to git hash b26d217 + * Documentation updates + * Fix wrong usage of std::string::find + +------------------------------------------------------------------- +Thu Jan 10 19:38:44 UTC 2013 - idonmez@suse.com + +- First release + diff --git a/ninja.spec b/ninja.spec new file mode 100644 index 0000000..e35e21b --- /dev/null +++ b/ninja.spec @@ -0,0 +1,91 @@ +# +# spec file for package ninja +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define name_ext -test +%bcond_without test +%else +%define name_ext %{nil} +%bcond_with test +%endif + +Name: ninja%{name_ext} +Version: 1.13.0 +Release: 0 +Summary: A small build system closest in spirit to Make +License: Apache-2.0 +Group: Development/Tools/Building +URL: https://ninja-build.org/ +Source0: https://github.com/ninja-build/ninja/archive/v%{version}/ninja-%{version}.tar.gz +Source1: macros.ninja +Patch1: ninja-disable-maxprocs-test.patch +Patch2: ninja-re2c-g.patch +BuildRequires: cmake +BuildRequires: gcc-c++ +%if %{with test} +BuildRequires: googletest-devel +%endif +BuildRequires: python3-base +BuildRequires: re2c + +%description +Ninja is yet another build system. It takes as input the interdependencies +of files (typically source code and output executables) and orchestrates +building them, quickly. + +%prep +%autosetup -p1 -n ninja-%{version} + +%build +export CFLAGS="%{optflags}" +%if "%__isa_bits" == "32" +CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +%endif +export CXXFLAGS="$CFLAGS" +%if %{without test} +%cmake -DBUILD_TESTING=OFF +%else +%cmake +%endif +%cmake_build + +%install +%if %{without test} +%cmake_install +install -D -p -m 0644 misc/zsh-completion %{buildroot}%{_datadir}/zsh/site-functions/_ninja +install -D -p -m 0644 misc/ninja.vim %{buildroot}%{_datadir}/vim/site/syntax/ninja.vim +install -D -p -m 0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completion/completions/ninja +install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.ninja +%endif + +%check +%if %{with test} +%ctest +%endif + +%files +%if %{without test} +%license COPYING +%{_bindir}/ninja +%{_datadir}/bash-completion +%{_datadir}/vim +%{_datadir}/zsh +%{_rpmconfigdir}/macros.d/macros.ninja + +%changelog +%endif \ No newline at end of file -- 2.51.1