Skip to content

bfr: fix broken build because of stricter GCC default checks - #410835

Merged
Aleksanaa merged 1 commit into
NixOS:masterfrom
mfrischknecht:bfr
Jun 1, 2025
Merged

Aleksanaa merged 1 commit into
NixOS:masterfrom
mfrischknecht:bfr

Conversation

@mfrischknecht

Copy link
Copy Markdown
Contributor

GCC now complains if main has no explicitly declared return type. Because bfr's configure script uses a very minimal C application to check whether GCC works at all (literally: main(){return(0);}), this caused configure failures.

Another issue with the configure script is that it logs the compiler errors for its checks to configure.log (and not to stdout or stderr), which means that the root cause wasn't logged during the failed nix build.

I added a patch that rewires the compiler error file descriptor so that it will simply log to stderr and another patch that fixes the missing return type in the C example.

Unfortunately, it looks like the server isn't serving the source files anymore (and finding an official upstream repo which I could send a PR to seems... non-trivial).

Part of #ZurichZHF
Works towards #403336

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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.

Add a 👍 reaction to pull requests you find important.

GCC now complains if `main` has no explicitly declared return type.
Because `bfr`s `configure` script uses a very minimal C application
to check whether GCC works _at all_ (literally: `main(){return(0);}`),
this caused configure failures.

Another issue with the `configure` script is that it logs the compiler
errors for its checks to `configure.log` (and not to stdout or stderr),
which means that the root cause wasn't logged during the failed nix
build.

I added a patch that rewires the compiler error file descriptor so
that it will simply log to stderr and another patch that fixes the
missing return type in the C example.

Unfortunately, it looks like the server isn't serving the source
files anymore (and finding an official upstream repo which I could
send a PR to seems... non-trivial).
@mfrischknecht

Copy link
Copy Markdown
Contributor Author

@pSub You're flagged as the maintainer for this...

Do you know if the source website (http://www.sourcefiles.org/) is still in the same hands?
It doesn't serve the source code specified in this Nix package anymore, and according to archive.org, the website has undergone quite a substantial change sometime around 2020...

@Sigmanificient Sigmanificient mentioned this pull request May 25, 2025
27 of 28 tasks
@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 25, 2025
@nix-owners
nix-owners Bot requested a review from pSub May 25, 2025 16:10
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 26, 2025
@Aleksanaa
Aleksanaa merged commit 8f7c8a9 into NixOS:master Jun 1, 2025
@nixpkgs-ci

nixpkgs-ci Bot commented Jun 1, 2025

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-25.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jun 1, 2025
@mfrischknecht
mfrischknecht deleted the bfr branch June 1, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants