This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
chromium <139's histogram_macros_internal.h contains a UB static cast
that causes a compile error for LLVM 21+
return static_cast<Enum>(base::to_underlying(Enum::kMaxValue) + 1);
→
integer value 4 is outside the valid range of values [0, 3] for the enumeration type 'LandlockState'
→
error: static assertion expression is not an integral constant expression
UMA_HISTOGRAM_ENUMERATION("Security.Sandbox.LandlockState", landlock_state);
applying upstream fix from https://chromium-review.googlesource.com/c/chromium/src/+/6633292
A static cast to an enum type that is outside the range of enum values
was defined to be undefined behavior in February 2014 in
https://cplusplus.github.io/CWG/issues/1766.html
Follow-up to ce04dc5edc.
Turns out the very same log spam is happening on x86_64-linux and not
just on aarch64-linux but hydra.nixos.org does not enforce the log limit
of 64mb for some reason.
I should have figured.
clang-19 deprecation warnings on aarch64-linux specifically are causing
the log grow beyond h.n.o's log limit of 64mb, which in turn causes the
build to get killed.
To work around this, likely until electron_32 is EOL in a month, we
simply disable those deprecation warnings. We still have another things
causing unnecessary logs, but this should be good enough for now.
https://hydra.nixos.org/build/283952243
This fixes the following build errors:
~~~
[2607/50420] CXX obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_legacy.o
FAILED: obj/third_party/perfetto/src/tracing/client_api_without_backends/track_event_legacy.o
clang++ -MD -MF [...]
In file included from ../../third_party/perfetto/src/tracing/track_event_legacy.cc:17:
In file included from ../../third_party/perfetto/include/perfetto/tracing/track_event_legacy.h:26:
In file included from ../../third_party/perfetto/include/perfetto/tracing/track_event.h:20:
../../third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:331:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
331 | Base::template Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
| ^
[...]
6 errors generated.
~~~
and
~~~
FAILED: obj/electron/electron_lib/keyboard_util.o
clang++ -MD -MF [...]
../../electron/shell/common/keyboard_util.cc:19:30: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
19 | constexpr CodeAndShiftedChar KeyboardCodeFromKeyIdentifier(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../electron/shell/common/keyboard_util.cc:111:33: note: non-constexpr function 'find' cannot be used in a constant expression
111 | if (auto* const iter = Lookup.find(str); iter != Lookup.end())
| ^
../../base/containers/flat_tree.h:310:18: note: declared here
310 | const_iterator find(const Key& key) const;
| ^
1 error generated.
~~~
This is happening since staging has been merged into master, which
included both a rustc and llvm bump.
Note that we inherit the llvm that rustc exposes.
Co-Authored-By: K900 <me@0upti.me>
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev 78e9caf153
result/bin/apply-formatting $NIXPKGS_PATH