-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
Fix FreeBSD support #81459
Fix FreeBSD support #81459
Conversation
Able to bootstrap stdenv on FreeBSD by compiling various dependencies using built-in FreeBSD tools so mostly works now
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/error-installing-python-3-7-nixpkgs-on-freebsd/6136/1 |
Hi. So all what I need to test this, is the nix port you referenced? |
@yater do you still have a machine for me to test? |
This is cool! I'd like to get to a pure bootstrap from binary bootstrap tools, but we can start here. Once something is up and running on FreeBSD, it is easier to improve it. |
Could somebody help me out how to boot freebsd in qemu with functional network? I tried:
I see an ip address in freebsd configured. However I cannot reach the VM. |
Hello, Maybe it's not related at all, but I noticed that my windows 10 VM, using virtio for network is not working anymore since my upgrade to 20.03 channel. As a matter of fact, packets emitted from the host to the VM are correctly received on the VM, but packets from the VM to the host are not received and don't appear with tcpdump on the host. By switching the virtual network card model to e1000e, networking is working properly again. Could-you try setting the model to e1000e, maybe "virtio" is not working for you also, or there is a problem between the virtio modules on the VM and the host. If no model is working for you, your network configuration may lack something... Regards. |
I just got it working using the following setup
The FreeBSD Image I got from https://download.freebsd.org/ftp/snapshots/VM-IMAGES/13.0-CURRENT/amd64/Latest/ |
Also got the nix port installed now. |
I am currently on
I will have a deeper look later. |
Seems like following is the culprit:
Did you try building it in multi-user/daemon mode ? or single-user ? I guess you are not able to build |
Hi! Are there any news on that front? :) |
It fails both in single-user mode and with nix-daemon:
|
This is interesting. I'm testing it in |
I am using the official qemu image without any non-standard modifications. |
@Kleidukos You may also be interested in #82131, which we can use to make a pure freebsd stdenv by cross-building the bootstrap tools. There is plenty to be done for #82131, and no need to set up and qemu or other things to start (let's get things building and then worry about whether they actually run!) so I hope it is relatively easy to contribute to---I certainly can use all the help I can get! |
Now that nix is in ports, can someone else have a look at this again? |
I would like to help... what it needs to be done? |
By the way, there is a #freebsd-nix channel on freenode. |
Some maintainer should review/test the patch proposed here. |
I tested a trivial program that called kill(-1, SIGKILL), which was run as the only process for an unpriveleged user, on Linux and FreeBSD. On Linux, kill reported success, while on FreeBSD it failed with EPERM. POSIX says: > If pid is -1, sig shall be sent to all processes (excluding an > unspecified set of system processes) for which the process has > permission to send that signal. and > The kill() function is successful if the process has permission to > send sig to any of the processes specified by pid. If kill() fails, > no signal shall be sent. and > [EPERM] > The process does not have permission to send the signal to any > receiving process. My reading of this is that kill(-1, ...) may fail with EPERM when there are no other processes to kill (since the current process is ignored). Since kill(-1, ...) only attempts to kill processes the user has permission to kill, it can't mean that we tried to do something we didn't have permission to kill, so it should be fine to interpret EPERM the same as success here for any POSIX-compliant system. This fixes an issue that Mic92 encountered[1] when he tried to review a Nixpkgs PR on FreeBSD. [1]: NixOS/nixpkgs#81459 (comment)
Fix for @Mic92’s Nix issue: NixOS/nix#4530 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested nix-build -A hello && result/bin/hello
; works fine.
Will need to be rebased and have some minor conflicts fixed.
Rebased, fixed up, and pushed. (Couldn’t do that on the PR since the branch disappeared.) Thanks @wahjava! |
Motivation for this change
I'm trying to make
nixpkgs
work on FreeBSD, similar tonix-darwin
. For that, I attempted to fix FreeBSD stdenv. I'm not super familiar withstdenv
, or internals ofnixpkgs
, so I would appreciate review.Following is the output from
FreeBSD 12.1 amd64
trying to buildcurl
:https://pastebin.com/0b7cJeHF
For those interested in trying out
nix
on FreeBSD, there is a FreeBSD port in progress, https://github.com/0mp/freebsd-ports-nix which is how I got it running.Thanks in advance.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)