-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
emscripten toolchain #16208
emscripten toolchain #16208
Conversation
|
||
meta = { | ||
# Add default meta information | ||
platforms = lib.platforms.all; |
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.
You should also set hydraPlatforms = []; to stop hydra from spawning 3x jobs for each emscripten package.
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.
will add that
added
@Profpatsch, @matthewbauer |
TODOs left until merge request:
compiling xmlmirrorxmlmirror's nix-shell build environment fails currently, no idea what causes this:
vs
emcc 1.35.4
emcc 1.36.4
|
why can't i move the autoreconfHook dependency from em-modules/generic/default.nixnativeBuildInputs = [ emscripten ] ++ nativeBuildInputs into emscripten-packages.nix
error
EDIT: works with this:
|
after fixing some final issues and packaging xmlmirror we now can say: it works! |
You need this part from libz for it to build for some reason on Darwin: |
9637f90
to
d789318
Compare
@matthewbauer |
Here's the error I'm getting from
|
@matthewbauer |
549b0b5
to
2c6c655
Compare
before final merge i would like to introduce: |
e54f913
to
e3d8a59
Compare
@matthewbauer i think it is ready for merge. i really would like to have some feedback before doing so. |
# fake conftest results with emscripten's python magic | ||
EMCONFIGURE_JS=2; | ||
|
||
configurePhase = args.configurePhase or '' |
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.
Those phases will of course be overwritten by existing phases.
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.
you are referring to:
- configurePhase
- buildPhase
- checkPhase
not sure what you mean with that, but this is just a default implementation which should be overriden intentionally by emscriptionPackages.
Looks good to me now. |
e3d8a59
to
fe0ad93
Compare
example usage: - nix-env -I nixpkgs=../somewhere/nixpkgs -f default.nix -iA emscriptenPackages.libxml2 - nix-env -I nixpkgs=../somewhere/nixpkgs -f default.nix -iA emscriptenPackages.json_c - nix-env -I nixpkgs=../somewhere/nixpkgs -f default.nix -iA emscriptenPackages.zlib - nix-env -I nixpkgs=../somewhere/nixpkgs -f default.nix -iA emscriptenPackages.xmlmirror
fe0ad93
to
c514693
Compare
There should be some documentation on this emscripten packages and whether there are any package hooks to using emscripten to be concerned about. My experiments with this shows that when using something like
As usual with emscripten, there are no shared objects, hence there is nothing in However there is a static library: The pkg-config supplied in
Which doesn't mention the static directory at all, which I think means that uses of package config won't result in finding the necessary static library. Overall I'm still not entirely sure how you're meant to build an emscripten package that relies on nixpkgs emscriptenPackages.zlib instead of using the zlib port (which does a remote download, which is bad). I suppose one could use the Further reading has led me to this: emscripten-core/emscripten#2486 Basically any generated package config files when using buildEmscriptenPackage/emscriptenStdenv should follow those standards. |
This issue about the fact that shared objects and static archives being in separate directories is important: #12085 |
Hi. I am not a nix expert, so please forgive if this question does seem too naive. I think it's great somebody started to bring packages for emscripten in. I do however wonder why it does not take the route other cross compiling takes in nixpkgs. Shouldn't "wasm" just be another targetPlatform as described here: https://nixos.org/nixpkgs/manual/#chap-cross ? What would be needed for this? Is this the right place to discuss this? |
@mbodmer you can always start a better approach and create a PR. i'd in fact love that. i don't have the funding to look into a different approach ATM but also note that what we have already works |
status
THIS MAJORED NOW INTO A PULL REQUEST
what is this?
this branch contains a emscripten based toolchain for nix.
nix-env -I nixpkgs=. -f default.nix -iA emscriptenPackages.libz && nix-env -I nixpkgs=. -f default.nix -iA emscriptenPackages.json_c && nix-env -I nixpkgs=. -f default.nix -iA emscriptenPackages.libxml2 && nix-env -I nixpkgs=. -f default.nix -iA emscriptenPackages.xmlmirror