Fixing `bazel_4` after #234710
Error example
https://hydra.nixos.org/build/241174862/nixlog/1
```
Execution platform: //:default_host_platform
third_party/zlib/gzwrite.c:89:20: error: call to undeclared function 'write'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
writ = write(state->fd, strm->next_in, put);
^
```
Similar to #269481 and #269297
Fixing `bazel_5` after #234710
Error example
https://hydra.nixos.org/build/241240612/nixlog/1
```
external/com_google_absl/absl/meta/type_traits.h:560:8: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
(__has_trivial_assign(ExtentsRemoved) || !kIsCopyOrMoveAssignable) &&
```
Similar to #269297, and remaining `bazel_4` is WIP for another PR
bazel_6 https://hydra.nixos.org/build/241090720/nixlog/1
```
external/upb/upb/upb.c:228:25: error: defining a type within '__builtin_offsetof' is a Clang extension [-Werror,-Wgnu-offsetof-extensions]
n = UPB_ALIGN_DOWN(n, UPB_ALIGN_OF(upb_Arena));
^~~~~~~~~~~~~~~~~~~~~~~
```
bazel_6 https://hydra.nixos.org/build/241127779/nixlog/1
```
In file included from external/com_google_absl/absl/algorithm/container.h:55:
external/com_google_absl/absl/meta/type_traits.h:560:8: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
(__has_trivial_assign(ExtentsRemoved) || !kIsCopyOrMoveAssignable) &&
^
```
Note: `bazel_5` and `bazel_4` require more work, for some reason extra
`-Wall` in combination with `-Werror` sneaks in and overrides `-Wno-`
settings, haven't managed yet to debug where exactly are the last
flags (last one wins) come from there.
ZHF: #265948
https://hydra.nixos.org/build/240805256/nixlog/1https://hydra.nixos.org/build/240805170/nixlog/2
Failure is a bit obscured but long story short, a script within
bazel gets custom nixpkgs shebang which in turn makes shell run
in POSIX-compatible mode. Bazel expects bash in non-POSIX mode
and osx-specific script starts to fail due to `set -e` and subshell
interaction differences in those modes (sub-shells and functions
suddently start inheriting `set -e` and fail to produce desired
output). More debug info is available in #267670
Shell scripts aren't guaranteed to work as interpreters in shebang.
In particular thin shell wrappers aren't shebang-ready on MacOS.
It may work sometimes depending on what exactly would try to execute
a script with such shebang, but generally it's not guaranteed to work.
See #124556
Bash wrapper was introduced in #266847 and so far seems like the
issue only affects darwin builds: hydra failure is in osx-specific
script, also shebang issue is usually darwin-specific.
Let's wrap it as a native binary to make it shebang-compatible.
The wrapper is only currently added to `bazel_6` so no need for
changes in other versions.
ZHF: #265948
The maven `dependency:go-offline` plugin has various issues
(see https://issues.apache.org/jira/browse/MDEP-204 and other
issues in that tracker), which the dedicated plugin from
https://github.com/qaware/go-offline-maven-plugin largely
fixes. I have confirmed that for an application I'm packaging
outside of nixpkgs, dependency-track, this indeed makes the
build work while it didn't with `dependency:go-offline`.
The offline mode is only used in one place in nixpkgs, for
lemminx. That build still succeeds and the program starts, though
I haven't tested further.