Skip to content

dante: fix build with clang 16#262580

Merged
toonn merged 1 commit intoNixOS:masterfrom
reckenrode:dante-fix
Nov 3, 2023
Merged

dante: fix build with clang 16#262580
toonn merged 1 commit intoNixOS:masterfrom
reckenrode:dante-fix

Conversation

@reckenrode
Copy link
Copy Markdown
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.
@ofborg ofborg bot requested a review from Shados October 21, 2023 20:26
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 21, 2023
@Shados
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants