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
MacOS support for gn and v8_6_x #30419
Conversation
@@ -1,4 +1,4 @@ | |||
{ stdenv, lib, fetchgit, fetchFromGitHub, gn, ninja, python, glib, pkgconfig | |||
{ stdenv, lib, cctools, fetchgit, fetchFromGitHub, gn, ninja, python, glib, pkgconfig |
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.
Curious what you need cctools
for here, since most of its tools should be in scope already from the stdenv
. Not saying you don't but it surprises me!
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.
It contains libtool
which interestingly isn't in scope otherwise.
Maybe I should name the argument here accordingly and do the rename in all-packages.nix
!?
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.
I overhear people talk about this Darwin vs GNU libtool a lot (or is it just a really old version?). Maybe there is an attributes already?
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.
so after you've mentioned it I've tried again with GNU libtool, this is how the build fails then:
[27/1119] LIBTOOL-STATIC obj/build/config/sanitizers/liboptions_sources.a
FAILED: obj/build/config/sanitizers/liboptions_sources.a
rm -f obj/build/config/sanitizers/liboptions_sources.a && TOOL_VERSION=1508177652 python ../../build/toolchain/mac/filter_libtool.py libtool -static -o obj/build/config/sanitizers/liboptions_sources.a obj/build/config/sanitizers/options_sources/sanitizer_options.o
Usage: /nix/store/y9f4wn79hrhdly3yb5766byrd7h398yy-libtool-2.4.6/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: unrecognised option: '-static'
IMHO this is because V8's build system assumes it's using darwin's libtool which behaves differently. As it probably doesn't make sense to patch V8's build system to use GNU's libtool (actually I don't now if that's feasible at all) I'd vote to just stick with darwin's version!?
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.
Oh sure, I meant maybe there was like a darwin.libtool
or something, not that you should shoehorn in GNU's libtool.
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.
I've changed it to libtool
in the argument list and do the aliasing in all-packages.nix
file
@@ -11,6 +11,9 @@ let | |||
else if stdenv.is64bit | |||
then"x64" | |||
else "ia32"; | |||
|
|||
librarySuffix = if stdenv.isDarwin then "dylib" else "so"; |
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.
@Ericson2314 was kind enough to put this knowledge into the stdenv for us! Try stdenv.hostPlatform.extensions.sharedLibrary
. Note that that one gives you the period as well.
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.
Ahh, thanks for pointing this out :) wasn't yet aware
@@ -0,0 +1,786 @@ | |||
diff -uNr a.orig/third_party/apple_apsl/CFBase.h a/third_party/apple_apsl/CFBase.h |
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.
Is it possible to use fetchpatch
here? This patch is quite big.
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.
well, generally yes.
After all the patch is actually sources from Google's third_party repository. The problem with the repository is that it's currently ~2,5GB in size.
So I see three, maybe four options:
- just clone the repository and ignore the traffic
- use patch included with nixpkgs (like currently done)
- host patch somewhere else and use
fetchpatch
(question is where to host) - create new github repo and put that stuff there
Problem with the latter two is that I'd have to put that stuff somewhere and link to there. I don't expect many changes to those, yet I'd have to update the resources ... or someone else host them at yet another place
I'm uncertain what the best option is ...
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.
Do they support a svn checkout of just the subdirectory? I looked to me like svn.
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.
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.
neat ... I've changed it to fetchurl
from that url. Thanks :)
Is this good now? |
unfortunately not, initially I didn't notice the build failed ... and lately haven't got time to get it fixed. The problem is the sha256 of the apple_apsl dependency, which is now downloaded from dynamic svn tarball as suggested by @Mic92 above. Yet the sha256 differs every now and then as the tarball is created with "current" timestamps, not original ones. Hence it's different even though the content is unchanged. A solution might be to just fetch the content of those two or three files needed. |
Hi! Sorry I didn't see this and part of this was merged in 04e13de. Definitely still want to merge the remaining parts of this though. |
Are there any updates on this pull request, please? |
Thank you for your contributions.
|
Motivation for this change
With #29726 I introduced a new package v8_6_x which repackaged V8 on GN build system, yet for Linux only. This PR adds support for MacOS/darwin
Also updates gn to current Git master and V8 6.2.414.30
The added patch file
pkgs/development/tools/build-managers/gn/apple_apsl.patch
actually adds "sources" needed for the MacOS build. I preferred adding a patch since it only needs a very small number of files, which are otherwise part of "third party" Git repository with 2,5GB download size. Downloading that for just a few kB didn't feel right to me.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)