Skip to content

unifdef: fix build with gcc15, cleanup - #445998

Merged
philiptaron merged 2 commits into
NixOS:stagingfrom
ghpzin:pr-unifdef-gcc15
Oct 28, 2025
Merged

philiptaron merged 2 commits into
NixOS:stagingfrom
ghpzin:pr-unifdef-gcc15

Conversation

@ghpzin

@ghpzin ghpzin commented Sep 25, 2025 •

Copy link
Copy Markdown
Contributor

unifdef: fix build with gcc15

Fixes build failure with gcc15:

unifdef.c:205:1: error: 'constexpr' in empty declaration
unifdef.c: In function 'eval_unary':
unifdef.c:1089:27: error: expected identifier or '(' before '=' token
 1089 |                 constexpr = false;
      |                           ^
unifdef.c:1106:27: error: expected identifier or '(' before '=' token
 1106 |                 constexpr = false;
      |                           ^
unifdef.c: In function 'ifeval':
unifdef.c:1173:19: error: expected identifier or '(' before '=' token
 1173 |         constexpr = killconsts ? false : true;
      |                   ^
unifdef.c:1176:27: error: expected specifier-qualifier-list before '?' token
 1176 |         return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
      |                           ^

unifdef: cleanup

  • replace rec with finalAttrs
  • remove with lib; from meta
  • replace sha256 with hash
    nix hash to-sri --type sha256 "00647bp3m9n01ck6ilw6r24fk4mivmimamvm4hxp5p6wxh10zkj3"
    sha256-Q84PAuzc3HI7JHVXVWPdsZLpiMiG02gmC8CmOu46xAA=

Tested build with:

nix-build --expr 'with import ./. {}; unifdef.override { stdenv = gcc15Stdenv; }'

Part of fixes for gcc15 update:
#440456

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Sep 25, 2025
@ghpzin
ghpzin changed the base branch from master to staging September 25, 2025 10:35
github-actions[bot]

This comment was marked as resolved.

@nixpkgs-ci nixpkgs-ci Bot closed this Sep 25, 2025
@nixpkgs-ci nixpkgs-ci Bot reopened this Sep 25, 2025
@github-actions
github-actions Bot dismissed their stale review September 25, 2025 10:36

All good now, thank you!

- add patch from unmerged upstream PR:
https://www.github.com/fanf2/unifdef/pull/19

Fixes build failure with gcc15:
```
unifdef.c:205:1: error: 'constexpr' in empty declaration
unifdef.c: In function 'eval_unary':
unifdef.c:1089:27: error: expected identifier or '(' before '=' token
 1089 |                 constexpr = false;
      |                           ^
unifdef.c:1106:27: error: expected identifier or '(' before '=' token
 1106 |                 constexpr = false;
      |                           ^
unifdef.c: In function 'ifeval':
unifdef.c:1173:19: error: expected identifier or '(' before '=' token
 1173 |         constexpr = killconsts ? false : true;
      |                   ^
unifdef.c:1176:27: error: expected specifier-qualifier-list before '?' token
 1176 |         return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
      |                           ^
```
- replace `rec` with `finalAttrs`
- remove `with lib;` from `meta`
- replace `sha256` with `hash`
nix hash to-sri --type sha256 "00647bp3m9n01ck6ilw6r24fk4mivmimamvm4hxp5p6wxh10zkj3"
sha256-Q84PAuzc3HI7JHVXVWPdsZLpiMiG02gmC8CmOu46xAA=
@ghpzin ghpzin changed the title unifdef: fix build with gcc15 unifdef: fix build with gcc15, cleanup Sep 25, 2025
@ghpzin
ghpzin marked this pull request as ready for review September 25, 2025 14:19
@nix-owners
nix-owners Bot requested a review from orivej September 25, 2025 14:20
@siraben

siraben commented Sep 25, 2025

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 445998
Commit: ff9b3771b3d27596a3917e4a3d6654728707a24a


aarch64-darwin

⏩ 1 package marked as broken and skipped:
  • tests.pkg-config.defaultPkgConfigPackages.tests-combined
❌ 49 packages failed to build:
  • acme-sh
  • age-plugin-tpm
  • cvsq
  • facter
  • gitolite
  • gp-saml-gui
  • gp-saml-gui.dist
  • homepage-dashboard
  • htb-toolkit
  • isabelle
  • isabelle-components.isabelle-linter
  • mullvad
  • munin
  • openconnect
  • openconnect.dev
  • openconnect_openssl
  • openconnect_openssl.dev
  • openvpn
  • php81Extensions.snmp
  • php81Extensions.snmp.dev
  • php82Extensions.snmp
  • php82Extensions.snmp.dev
  • php83Extensions.snmp
  • php83Extensions.snmp.dev
  • php84Extensions.snmp
  • php84Extensions.snmp.dev
  • python312Packages.django-cacheops
  • python312Packages.django-cacheops.dist
  • python312Packages.jaraco-abode
  • python312Packages.jaraco-abode.dist
  • python312Packages.jaraco-net
  • python312Packages.jaraco-net.dist
  • python313Packages.django-cacheops
  • python313Packages.django-cacheops.dist
  • python313Packages.jaraco-abode
  • python313Packages.jaraco-abode.dist
  • python313Packages.jaraco-net
  • python313Packages.jaraco-net.dist
  • swtpm
  • swtpm.man
  • tailscale
  • tailscale.derper
  • testssl
  • tinystatus
  • tlaps
  • trayscale
  • unixbench
  • vpn-slice
  • vpn-slice.dist
✅ 26 packages built:
  • amazon-ssm-agent
  • darwin.AvailabilityVersions
  • darwin.libpcap
  • darwin.network_cmds
  • darwin.network_cmds.man
  • iodine
  • iproute2mac
  • lldpd
  • lldpd.dev
  • lldpd.doc
  • lldpd.man
  • nagiosPlugins.check_interfaces
  • net-snmp
  • net-snmp.bin
  • net-snmp.dev
  • net-snmp.lib
  • net-tools (unixtools.net-tools)
  • prometheus-snmp-exporter
  • tests.pkg-config.defaultPkgConfigPackages.netsnmp
  • unifdef
  • unixtools.arp
  • unixtools.ifconfig
  • unixtools.netstat
  • unixtools.ping
  • unixtools.route
  • vpnc-scripts

Error logs: `aarch64-darwin`
tailscale
ok  	tailscale.com/log/filelogger	0.178s
ok  	tailscale.com/log/sockstatlog	0.254s
ok  	tailscale.com/logpolicy	0.255s
ok  	tailscale.com/logtail	0.248s
ok  	tailscale.com/logtail/filch	0.209s
ok  	tailscale.com/maths	0.190s
ok  	tailscale.com/metrics	0.217s
ok  	tailscale.com/net/art	4.024s
ok  	tailscale.com/net/bakedroots	0.206s
?   	tailscale.com/net/batching	[no test files]
--- FAIL: TestDetectCaptivePortalReturnsFalse (0.66s)
    endpoints.go:86: captivedetection: current DERPMap is empty, using map from dnsfallback
    captivedetection.go:106: [v2] attempting to do captive portal detection on interface en0
    captivedetection.go:150: [v2] 5 available captive portal detection endpoints; trying 5
    endpoints.go:142: [v1] unexpected status code in captive portal response: want=204, got=302
    captivedetection.go:109: DetectCaptivePortal(found=true,ifName=en0)
    captivedetection_test.go:44: DetectCaptivePortal returned true, expected false.
FAIL
FAIL	tailscale.com/net/captivedetection	1.134s
FAIL

@philiptaron

Copy link
Copy Markdown
Contributor

Want to add yourself to maintainers, @ghpzin?

@ghpzin

ghpzin commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

Want to add yourself to maintainers, @ghpzin?

I would not mind as upstream have not had updates in years, so there is not much to do.
But I am not currently in maintainers-list.nix and PR targets staging, so it probably can't be here.

@philiptaron

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 445998 --package tailscale --package unifdef
Commit: ff9b3771b3d27596a3917e4a3d6654728707a24a


x86_64-linux

✅ 3 packages built:
  • tailscale
  • tailscale.derper (tailscale.derper.derper)
  • unifdef

@philiptaron
philiptaron added this pull request to the merge queue Oct 28, 2025
Merged via the queue into NixOS:staging with commit 36bd9f4 Oct 28, 2025
@ghpzin
ghpzin deleted the pr-unifdef-gcc15 branch October 28, 2025 16:48
@fabianhjr fabianhjr mentioned this pull request Dec 1, 2025
4 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants