Skip to content

netbsd.make: fix broken build for linux - #565687

Open
ArtifyCZ wants to merge 2 commits into
NixOS:masterfrom
ArtifyCZ:fix-netbsd-make
Open

ArtifyCZ wants to merge 2 commits into
NixOS:masterfrom
ArtifyCZ:fix-netbsd-make

Conversation

@ArtifyCZ

@ArtifyCZ ArtifyCZ commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Both latest aarch64 and x86_64 Linux builds failed:

aarch64 - https://hydra.nixos.org/build/345307975
x86_64 - https://hydra.nixos.org/build/345307974

It also probably wouldn't hurt to finally update the netbsd package set to the latest major version in the near future (#456489)

Things done

@ArtifyCZ
ArtifyCZ marked this pull request as draft September 22, 2026 01:00
@ArtifyCZ
ArtifyCZ marked this pull request as ready for review September 22, 2026 01:04
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! labels Sep 22, 2026
@ArtifyCZ

Copy link
Copy Markdown
Member Author

@iedame This PR actually could fix the build also for aarch64-darwin, not just aarch64-linux and x86_64-linux.

Specifically, the error reported in Hydra logs looks like one of the issues I solved while fixing the builds for Linux.

The error is about a not declared stresep function, used in meta.c in a macro called strsep. This macro is defined only if there isn't HAVE_STRSEP variable present. I defined that variable through flags and made it use the existing strsep function.

@iedame

iedame commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for the ping! I'm running nixpkgs-review-gha for all platforms, and the results should be posted soon.

@iedame

iedame commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (d5406bd)

Command: nixpkgs-review pr 565687
Commit: 818a5281d5399eae0e12a0b952729da31c72ae38 (subsequent changes)
Merge: 159bca743eab986c5fe04430444df3f3c65e8bcf

Logs: https://github.com/iedame/nixpkgs-review-gha/actions/runs/36038526908/attempts/1


x86_64-linux

✅ 1 package built:
  • netbsd.make

aarch64-linux

✅ 1 package built:
  • netbsd.make

x86_64-darwin

✅ No rebuilds


aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • netbsd.make

@ArtifyCZ
ArtifyCZ requested a review from iedame September 25, 2026 02:58
@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Sep 25, 2026

@iedame iedame left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

diff LGTM, builds correctly

@ArtifyCZ

Copy link
Copy Markdown
Member Author

@iedame A link to this PR is missing in the x86_64-linux tracking issue 😅

@iedame

iedame commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@iedame A link to this PR is missing in the x86_64-linux tracking issue 😅

* [Tracking: x86_64-linux packages that have never built successfully on Hydra #566956](https://github.com/NixOS/nixpkgs/issues/566956)

Thank you for letting me know, updated some links!

@ArtifyCZ ArtifyCZ added the 0.kind: build failure A package fails to build label Sep 28, 2026
@SuperSandro2000

Copy link
Copy Markdown
Member

Why do we need netbsd make on linux even?

@ArtifyCZ

Copy link
Copy Markdown
Member Author

I made this PR because I saw this package netbsd.make failing in Hydra (in linked tracking issues, to be exact)

Why do we need netbsd make on linux even?

BSD Make has its own quirks and sometimes a bit different syntax from GNU Make. Also, there are multiple NetBSD, FreeBSD, and OpenBSD packages.

I think it doesn't make much sense to mark just Make incompatible with Linux, but rather the whole package set, if we were to limit the platforms. I think such step would deserve a bigger discussion than just in a single PR.

Even if it might not make much sense to use on Linux, it might have some value on macOS/Darwin.

Note that this PR fixes broken build also for aarch64-darwin, see the nixpkgs-review message.

@SuperSandro2000

Copy link
Copy Markdown
Member

@Ericson2314 can you help here?

@iedame

iedame commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

I mean, I do question its usefulness because it has never built correctly and no one has complained so far.

There is a PR from 2019 fixing the darwin build, but I assume that was for x86_64-darwin: #59278

I'm not familiar with the *BSD ecosystems, so as long as it's building correctly or the platforms are properly restricted, I'd say it's reasonable. Is anyone more familiar with these packages who could give some input?

We have hundreds of packages that have been failing continuously for years on darwin, which is more expensive to build:

So all things considered, if there is a use case for this, why not?

@ArtifyCZ

Copy link
Copy Markdown
Member Author

@iedame

I mean, I do question its usefulness because it has never built correctly and no one has complained so far.

I dunno; some codebases do use BSD Make, though, especially BSD codebases, and someone might desire to use such tools.

Anyway, as I said, I think the discussion should be whether to keep *BSD package sets compatible with Linux (meta.platforms or meta.badPlatforms), not whether to keep this particular package.

Perhaps I could create an issue for the discussion on *BSD packages, and after some time we would decide what to do with them?

There is a PR from 2019 fixing the darwin build, but I assume that was for x86_64-darwin: #59278

I didn't notice that, but it was solving a completely different issue.

I am solving an issue with a strsep macro that just expands to a call to sstrsep (or how was that function called), but that function does not exist for us; on the other hand, we do have a strsep function, and it could use that one therefore. It defines the macro only when HAVE_STRSEP is not defined, which I am defining through flags.

appendToVar NIX_CFLAGS_COMPILE "-DHAVE_STRSEP"

I'm not familiar with the *BSD ecosystems, so as long as it's building correctly or the platforms are properly restricted, I'd say it's reasonable. Is anyone more familiar with these packages who could give some input?

I am not much familiar with the *BSD ecosystems either; I also think every package should either build or have restricted platforms.

@alyssais is written as the only maintainer, but she said she wasn't really maintaining it.

I would consider the whole netbsd package set unmaintained therefore.

We have hundreds of packages that have been failing continuously for years on darwin, which is more expensive to build:

I don't think this package is mentioned in either of these issues? 😅

So all things considered, if there is a use case for this, why not?

I think the whole netbsd package set might be really useful when using Nix on a BSD system. Also, like I said, if we are to mark these packages as incompatible with Linux and Darwin, I think we should have a discussion on this topic in a dedicated issue, a thread, or something similar.

@Ericson2314

Copy link
Copy Markdown
Member

@SuperSandro2000 there is also "make minimal" but in general we want the build tools available on Linux for cross.

@ArtifyCZ Can you see about upstreaming this fix? It is best to not accumulate patches in Nixpkgs. I suspect upstream will want the conditions to be more precise than "not Linux", which isn't self-documenting, and that's good too.

Also, btw, I have code bumping to the latest NetBSD version. I'll go get that ready.

NetBSD 9.5 is the latest and also the final release from netbsd-9 stable
branch. We should probably do a follow up and upgrade to a newer branch
(netbsd-10 or netbsd-11).

- https://netbsd.org/releases/formal-9/NetBSD-9.5.html
@ArtifyCZ

ArtifyCZ commented Oct 4, 2026 •

Copy link
Copy Markdown
Member Author
  • Rebased onto the current nixpkgs master
  • Replaced linux with __linux__ in the patch for consistency with the NetBSD codebase
  • Added a separate commit that updates the whole package set to NetBSD 9.5 (latest and final release from the netbsd-9 stable branch)

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Oct 4, 2026
@ArtifyCZ

ArtifyCZ commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

@Ericson2314 I might try to upstream it, but I think we should keep the patch for now. I also updated to the latest and the final NetBSD release 9.5 in the netbsd-9 stable branch, though we probably should do a follow up and upgrade to a newer stable branch (netbsd-10 or netbsd-11).

@ArtifyCZ

ArtifyCZ commented Oct 5, 2026 •

Copy link
Copy Markdown
Member Author

It seems the correct fix could probably be to undeclare MAKE_NATIVE for non-BSD platforms (or even non-NetBSD BSDs). Then there's no need for a patch to build it.

The reason I wasn't really considering that was because it is declared unconditionally by the Make's Makefile (in CFLAGS).

It seems the update (probably) broke the build for macOS, though. Thankfully, I have a MacBook and it is building there right now (just build of dependencies takes a while, e.g., CVS export).

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 15, 2026
@iamanaws iamanaws added the 6.topic: bsd Running or building packages on BSD label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: build failure A package fails to build 2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: bsd Running or building packages on BSD 7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages 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