NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.21k stars 14.21k forks source link

Build failure: mongodb #321226

Open hbjydev opened 5 months ago

hbjydev commented 5 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build mongodb from unstable

Build log

This is the last few lines of the log:

Compiling build/nixos/mongo/db/index/fts_access_method.o
Compiling build/nixos/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_sinh.o
Compiling build/nixos/mongo/util/periodic_runner_factory.o
In file included from src/mongo/db/catalog/util/partitioned.h:43,
                 from src/mongo/db/query/plan_cache.h:32,
                 from src/mongo/db/query/classic_plan_cache.h:36,
                 from src/mongo/db/query/plan_explainer.h:33,
                 from src/mongo/db/query/plan_executor.h:37,
                 from src/mongo/db/clientcursor.h:42,
                 from src/mongo/db/query/cursor_response.h:36,
                 from build/nixos/mongo/s/query/async_results_merger_params_gen.h:25,
                 from src/mongo/db/pipeline/pipeline.h:48,
                 from src/mongo/db/cst/cst_pipeline_translation.h:36,
                 from src/mongo/db/cst/cst_match_translation.cpp:39:
src/mongo/util/aligned.h:170:88: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
  170 |             aligned_detail::roundUpByStep<stdx::hardware_destructive_interference_size>(sizeof(T))>;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
src/mongo/util/aligned.h:170:88: note: its value can vary between compiler versions or with different ‘-mtune’ or ‘-mcpu’ flags
src/mongo/util/aligned.h:170:88: note: if this use is part of a public ABI, change it to instead use a constant variable you define
src/mongo/util/aligned.h:170:88: note: the default value for the current CPU tuning is 64 bytes
src/mongo/util/aligned.h:170:88: note: you can stabilize this value with ‘--param hardware_destructive_interference_size=64’, or disable this warning with ‘-Wno-interference-size’
src/mongo/util/aligned.h:170:99: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
  170 |             aligned_detail::roundUpByStep<stdx::hardware_destructive_interference_size>(sizeof(T))>;
      |                                                                                                   ^
src/mongo/util/aligned.h:205:85: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
  205 |                                        stdx::hardware_constructive_interference_size>;
      |                                                                                     ^
src/mongo/util/aligned.h:205:85: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
Compiling build/nixos/third_party/timelib/parse_date.o
/build/cc8d21zD.s: Assembler messages:
/build/cc8d21zD.s:97196: Error: internal error: fixup not contained within frag
scons: *** [build/nixos/mongo/util/periodic_runner_factory.o] Error 1
scons: building terminated because of errors.
build/nixos/mongo/util/periodic_runner_factory.o failed: Error 1

Additional context

I need this for the Unifi Controller, but it's failing to compile which makes this hard.

Notify maintainers

@bluescreen303 @offline

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

❯ nix shell 'nx#nix-info' -c nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.31, NixOS, 24.11 (Vicuña), 24.11.20240524.bfb7a88`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.22.1`
 - nixpkgs: `not found`

Add a :+1: reaction to issues you find important.

ghpzin commented 5 months ago

Saw related messages from you on matrix and that somebody built it successfully from same commit (and another person went with build past that file). Not sure if it's worth leaving this issue open, unless somebody else wants to build it or investigate where this strange error comes from.

hbjydev commented 5 months ago

I think the outcome of this was essentially that MongoDB needs a stupidly beefy machine to build. I can't really do anything about that because we refuse to build unfree (though redistributable) packages in Hydra (i.e. they don't land on cache.nixos.org). Not really sure what the fix here is.

hughobrien commented 4 months ago

On NixOS you can override the build directory to be one that isn't tmpfs backed, so disk space rather than memory becomes the limit.

systemd.services.nix-daemon.serviceConfig.Environment = "TMPDIR=/swap/build";
zoechi commented 4 months ago

Building mongodb got much much worse in April, but that seems to be fixed and back to just "bad" about a week ago.

On unstable now it seems to run into Python3.12 issues and doesn't build at all as mentioned in https://stackoverflow.com/questions/77401730/modulenotfounderror-no-module-named-imp

qubitnano commented 4 months ago

Building mongodb got much much worse in April, but that seems to be fixed and back to just "bad" about a week ago.

On unstable now it seems to run into Python3.12 issues and doesn't build at all as mentioned in https://stackoverflow.com/questions/77401730/modulenotfounderror-no-module-named-imp

I opened a PR https://github.com/NixOS/nixpkgs/issues/325961

hughobrien commented 3 months ago

module issue now https://github.com/NixOS/nixpkgs/issues/330060

drupol commented 3 months ago

For you that are interested in MongoDB, I needed MongoDB 7 and did this: https://github.com/NixOS/nixpkgs/pull/333623 I hope that at some time we'll be able to use it from the source, but to be honest, I've already dedicated too much time in it, without luck yet... https://github.com/NixOS/nixpkgs/pull/333258