Skip to content
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

FreeBSD build fixes #657

Merged
merged 4 commits into from
Nov 24, 2015
Merged

FreeBSD build fixes #657

merged 4 commits into from
Nov 24, 2015

Conversation

manueljacob
Copy link
Contributor

This is sufficient to fix the Nix build on my FreeBSD 10.2 virtual machine.

Previously, pkg-config was already queried for libsqlite3's and
libcurl's link flags.  However they were not used, but hardcoded
instead.  This commit replaces the hardcoded LDFLAGS by the ones
provided by pkg-config in a similar pattern as already used for
libsodium.
Eventually the nested if statements should be replaced by a more general
condition, but this is sufficient to make it work on FreeBSD.
There is no libdl on FreeBSD.  Instead the symbols are included in libc.
Some evidence that defining it to be 0 is right:
* OS X headers define it to be 0.
* Other code uses 0 instead of SOL_LOCAL to check for peer credentials
  (e.g. FreeBSD's implementation of getpeereid).
@edolstra
Copy link
Member

edolstra commented Oct 7, 2015

This looks pretty similar to #643.

@manueljacob
Copy link
Contributor Author

This is indeed very similar. I didn't notice there was another pull request for this.

@ysangkok ysangkok mentioned this pull request Oct 7, 2015
@tomster
Copy link

tomster commented Oct 7, 2015

FTR i tried this branch in a vanilla FreeBSD 10.2 jail as documented in #643 but after bootstrap.sh and bash configure i get this:

root@nix:~/nix # gmake
  GEN    Makefile.config
  GEN    doc/manual/version.txt
  GEN    doc/manual/manual.xmli
doc/manual/local.mk:21: recipe for target 'doc/manual/manual.xmli' failed
gmake: *** [doc/manual/manual.xmli] Error 1

any idea what's missing here? seems i might be missing a dependency to build the documentation?

@manueljacob
Copy link
Contributor Author

Make sure the following packages are installed:

  • libxslt
  • docbook-xsl-ns

@tomster
Copy link

tomster commented Oct 8, 2015

@manueljacob thanks, that helped. additionally i still needed to install bison, then i was able to build and install successfully.

to retrace my steps and to document the required steps i've created an ansible playbook which reproducibly allows to install nix from git sources https://gist.github.com/tomster/5cfb45030e06ffb7b91a

given that FreeBSD these days comes with pkg pre-installed (which is just a small binary without any dependencies) it might make sense to package nix and users who would want to use it instead of pkg would then just need to do pkg install nix.

at any rate, thanks for your effort, i shall now commence with the nix tutorial :-) (btw. any pointers what to do first would be appreciated :-)

@@ -692,6 +692,10 @@ static PeerInfo getPeerInfo(int remote)

#elif defined(LOCAL_PEERCRED)

#if !defined(SOL_LOCAL)
#define SOL_LOCAL 0
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be

#define  SOL_LOCAL SOL_SOCKET

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that would be wrong, potentially causing the xucred structure to be filled with nonsense (see this libvirt commit). I mentioned more reasons why defining it to be 0 is right in the 7888b2b commit message.

@tomster
Copy link

tomster commented Oct 16, 2015

FYI @garbas and i were tinkering with this yesterday and we've a little progress. our goal was to be able to get nix-env -i hello to work, but we're not quite there yet.

we had to make a few changes to nixpkgs itself, documented here (tomster/nixpkgs@d8d4039)

also, i've updated the playbook to bootstrap building nix: https://gist.github.com/tomster/5cfb45030e06ffb7b91a

has anyone else made any progress on actually using nix on FreeBSD, now that it builds?

@ysangkok
Copy link
Contributor

@tomster , I just tested a build of this patch with your nixpkgs branch. Seems to work fine, hello runs, at least. What needs to be done next?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants