Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 760848

Summary: dev-util/ninja-1.10.1: Fails on filesystem with 64bit inodes
Product: Gentoo Linux Reporter: Bruno <bonbons>
Component: Current packagesAssignee: Chromium Project <chromium>
Status: RESOLVED FIXED    
Severity: normal CC: alexander, herrtimson, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/ninja-build/ninja/issues/829
https://github.com/ninja-build/ninja/pull/2203
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 471102    

Description Bruno 2020-12-20 09:56:57 UTC
ninja run in a 32bit chroot on a lage XFS filesystem fails e.g. for MariaDB compilation:

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/dev-db/mariadb-10.4.17/work/mariadb-10.4.17_build
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-db/mariadb-10.4.17/work/mysql ...
 * Working in BUILD_DIR: "/var/tmp/portage/dev-db/mariadb-10.4.17/work/mariadb-10.4.17_build"
ninja -v -j4 -l0
ninja: error: rebuilding 'build.ninja': stat(/usr/share/cmake/Modules/CMakeCCompiler.cmake.in): Value too large for defined data type


Reproducible: Always




Adding -D_FILE_OFFSET_BITS=64 to CFLAGS while building ninja works around the issue.

This should be a blocker for bug #471102.
Comment 1 Stephan Hartmann (RETIRED) gentoo-dev 2020-12-20 14:26:26 UTC
Upstream doesn't care for more than 6 years now :(
Comment 2 Bruno 2020-12-20 14:46:19 UTC
(In reply to Stephan Hartmann from comment #1)
> Upstream doesn't care for more than 6 years now :(

That's a pity.

(looking through the push request mentioned there they seem to be willing to care slightly if the patch only impacts 32bit builds of it)

Can we work around it by forcing -D_FILE_OFFSET_BITS=64 via the ebuild?

Checking devmanual:
  https://devmanual.gentoo.org/eclass-reference/flag-o-matic.eclass/index.html
flag-o-matic eclass has the helper `append-lfs-flags` for this.
Comment 3 Larry the Git Cow gentoo-dev 2020-12-20 15:48:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=650171c086d8f52f6dbd008c69529e581e22d18f

commit 650171c086d8f52f6dbd008c69529e581e22d18f
Author:     Stephan Hartmann <sultan@gentoo.org>
AuthorDate: 2020-12-20 15:47:27 +0000
Commit:     Stephan Hartmann <sultan@gentoo.org>
CommitDate: 2020-12-20 15:47:57 +0000

    dev-util/ninja: fix LSF handling
    
    Closes: https://bugs.gentoo.org/760848
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Stephan Hartmann <sultan@gentoo.org>

 dev-util/ninja/ninja-1.10.2-r1.ebuild | 136 ++++++++++++++++++++++++++++++++++
 1 file changed, 136 insertions(+)
Comment 4 Larry the Git Cow gentoo-dev 2024-02-05 23:16:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=102f79613e208193ade66e71ddf6530db3fadc05

commit 102f79613e208193ade66e71ddf6530db3fadc05
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-02-05 23:15:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-02-05 23:16:32 +0000

    dev-build/ninja: fix LFS (by respecting CPPFLAGS)
    
    Reported by dilfridge w/ x86 build on XFS (which has larger inodes). See
    also 280be1cadfdfd607d422dcefa33e9f15bf9c638c.
    
    Bug: https://bugs.gentoo.org/760848
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-build/ninja/files/ninja-cppflags.patch |  21 +++++
 dev-build/ninja/ninja-1.11.1-r5.ebuild     | 118 +++++++++++++++++++++++++++++
 dev-build/ninja/ninja-9999.ebuild          |   1 +
 3 files changed, 140 insertions(+)
Comment 5 tt_1 2024-02-10 16:44:39 UTC
the new -r5 ebuild fails for me on native aarch64: 

./src/ninja.cc:1402:3: warning:   when initialized here [-Wreorder]
 1402 |   DeferGuessParallelism(BuildConfig* config)
      |   ^~~~~~~~~~~~~~~~~~~~~
aarch64-unknown-linux-gnu-g++ -Lbuild -O2 -pipe -Wl,-O1 -Wl,--as-needed -o ninja build/ninja.o -lninja
wrote build.ninja.
bootstrap complete.  rebuilding...
Traceback (most recent call last):
  File "/var/tmp/portage/dev-build/ninja-1.11.1-r5/work/ninja-1.11.1/configure.py", line 720, in <module>
    subprocess.check_call(rebuild_args)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['./ninja', '-v']' died with <Signals.SIGSEGV: 11>.


the filesystem is plain old ext4, in a chroot on an usb drive via ssh & screen. 

-r4 is fine, and so is -r5 on my main amd64 machine. 

should I open a new bug for this and have it depend, or would you like me to add anything of interest here?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-10 17:14:26 UTC
new bug please with full build.log, emerge --info, and backtrace from the crash