Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel_6, bazel_5, bazel_4: fix CLang 16 Werror-s on darwin #268620

Closed
wants to merge 4 commits into from

Conversation

boltzmannrain
Copy link
Contributor

@boltzmannrain boltzmannrain commented Nov 20, 2023

Description of changes

WIP Trying to fix bazel_* after #234710

TODO: upb adds copts last and -Werror wins https://github.com/protocolbuffers/upb/blob/a5477045acaa34586420942098f5fecd3570f577/bazel/build_defs.bzl#L43

ERROR: /private/tmp/nix-build-bazel-6.4.0.drv-6/bazel_GviWM2J0/out/external/upb/BUILD:102:11: Compiling upb/upb.c [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target @upb//:upb) 
  (cd /private/tmp/nix-build-bazel-6.4.0.drv-6/bazel_GviWM2J0/out/execroot/io_bazel && \
  exec env - \
... -Wno-deprecated-builtins -Wno-gnu-offsetof-extensions '-std=c99' -pedantic '-Werror=pedantic' -Wall -Wstrict-prototypes -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/upb/upb/upb.c -o bazel-out/darwin-opt-exec-EDC14992/bin/external/upb/_objs/upb/upb.o)
# Configuration: 5b91c041255b8a865f889a23e1897de0f7a874d5fc7840158993ff22fe12f070
# Execution platform: //:default_host_platform
external/upb/upb/upb.c:228:25: error: defining a type within '__builtin_offsetof' is a Clang extension [-Werror,-Wgnu-offsetof-extensions]

Trying to fix following

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) &&
       ^

bazel_5

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) &&

bazel_4

third_party/zlib/gzlib.c:496:14: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);

ZHF: #265948

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@boltzmannrain boltzmannrain added the 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign label Nov 20, 2023
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Nov 20, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 20, 2023
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) &&
       ^
```
bazel_5
```
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) &&
```
bazel_4
```
third_party/zlib/gzlib.c:496:14: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);
```

ZHF: NixOS#265948
@boltzmannrain boltzmannrain force-pushed the bazel_clang16 branch 2 times, most recently from 96c91b9 to c31ab42 Compare November 22, 2023 19:47
@boltzmannrain
Copy link
Contributor Author

@ofborg build bazel_6
@ofborg build bazel_5
@ofborg build bazel_4

@ofborg ofborg bot added 10.rebuild-linux: 101-500 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 22, 2023
@boltzmannrain
Copy link
Contributor Author

done via separate PRs, had a really silly patch files issue before here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant