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

dante: fix build with clang 16 #262580

Merged
merged 1 commit into from
Nov 3, 2023
Merged

dante: fix build with clang 16 #262580

merged 1 commit into from
Nov 3, 2023

Conversation

reckenrode
Copy link
Contributor

Description of changes

Fix two configure checks that fail on clang 16 due to unexpected errors:

  • Undefined type uint8_t by including stdint.h; and
  • Unused sa_len_ptr by incrementing the target of the pointer.

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.

Fix two configure checks that fail on clang 16 due to unexpected errors:

* Undefined type `uint8_t` by including `stdint.h`; and
* Unused `sa_len_ptr` by incrementing the target of the pointer.
@Shados
Copy link
Member

Shados commented Oct 23, 2023

How are you building this against clang 16? I can successfully build pkgs.dante.override { stdenv = pkgs.clang16Stdenv; } on the parent of your commit (b9e9e44) just fine. Is the build issue somehow Darwin-specific...?

@reckenrode
Copy link
Contributor Author

How are you building this against clang 16? I can successfully build pkgs.dante.override { stdenv = pkgs.clang16Stdenv; } on the parent of your commit (b9e9e44) just fine. Is the build issue somehow Darwin-specific...?

I’m using staging after cad1b25 was merged, updating the default LLVM to 16. The configure test fails on Darwin with the following error (from config.log):

configure:17243: checking for sa_len type
configure:17266: clang -c -g -O2 -pipe -Wall -Werror -DDEBUG=0 -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c:88:10: error: variable 'sa_len_ptr' set but not used [-Werror,-Wunused-but-set-variable]
uint8_t *sa_len_ptr;
         ^
1 error generated.

 ...

configure:17266: clang -c -g -O2 -pipe -Wall -Werror -DDEBUG=0 -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c:88:16: error: variable 'sa_len_ptr' set but not used [-Werror,-Wunused-but-set-variable]
unsigned char *sa_len_ptr;
               ^
1 error generated.

Copy link
Contributor

@toonn toonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On b9e9e44 I do get a reproducable failure when trying to build dante.override { inherit (llvmPackages_16) stdenv; }:

checking for sa_len type... no
configure: WARNING: unable to obtain sa_len type, exiting
error: builder for '/nix/store/h9vpcpw4a6pb74hcv1dk5y17z9jy1877-dante-1.4.3.drv' failed with exit code 1;

With this PR it's fixed both with and without stdenv override.

@toonn toonn merged commit 81093a6 into NixOS:master Nov 3, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants