-
Notifications
You must be signed in to change notification settings - Fork 100
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
Help with a strange native package — @mapbox/mapbox-gl-native-5.0.2 #190
Comments
I guess you want to include Sadly, this what I have seen for several packages that require native dependencies -- since NPM does not support them out of the box, people invent their own ways and delivery mechanisms to provide them. As you may probably already know, in pure build environments in Nix (on Linux) network access is restricted, except for so-called fixed output derivations in which output hashes must be known in advance (which is used for functions, such as To fix this problem, there are two things you can do. For both options, you must first create an override expression to adapt the build of your project (in the README.md of node2nix you can find various examples). Then you can either "cheat", by disabling sandboxing, by providing the following argument as an override to the __noChroot = true; the alternative is patching the build, e.g. by executing sed instructions to change the problematic packages, so that it no longer downloads the binary. The basic idea is that you download and provide this binary yourself by using the Nix expression language and use patch instructions to inject it into the dependency tree yourself. The builder environment should also support the I haven't investigated your package specifically, but I have also noticed that some of these packages (that try to download binaries) might have a fall back to compiling the binaries from sources. Maybe that's also possible with one of your dependencies. I hope these pointers help. Patching the modules before the installation is a bit tricky, but that's works the best to give an optimal deployment experience with Nix. |
That will be most likely needed, but that alone doesn’t work.
Yes, that’s the case. :/
Ohhh, and then the builder will have network access? :o Whoa, I didn’t know that, eerie.
I would most like to do this, but I don’t know enough about Node packaging.
Yes, thanks a lot! What I did temporarily was extraction of |
@michalrus ah ok, at least you know where to get the binary. Then the only challenge is to make sure that it's in the right place, and (maybe) force the script to not download it. To debug these kinds of scenarios |
But node2nix does seem to support prebuildify based native packages. For example I don't have any problem using node2nix with
And because these are under the |
I just realised that those files are there because they were distributed as part of the npm package repository. They were using |
[Help with a strange native package — @mapbox/mapbox-gl-native-5.0.2 #190](svanderburg/node2nix#190)
[Help with a strange native package — @mapbox/mapbox-gl-native-5.0.2 #190](svanderburg/node2nix#190)
Hello!
Could you give some pointers on how to nix
@mapbox/mapbox-gl-native-5.0.2
? https://www.npmjs.com/package/@mapbox/mapbox-gl-native/v/5.0.2It seems to be using
node-pre-gyp
to download pre-built binaries from AWS.On the other hand, when I try to build it from source ( https://github.com/mapbox/mapbox-gl-native/tree/node-v5.0.2 ), it still complains about lack of internet access…
Perhaps this one needs something in between?
Thanks a lot!
The text was updated successfully, but these errors were encountered: