| 21 Oct 2023 |
Marie | In reply to @lily:lily.flowers i gotta deal with $dayjob rn, but i'll post stuff later if you wanna look meow | 12:08:00 |
Lily Foster | In reply to @marie:marie.cologne meow thank you for reminder, i,,, uh, forgot | 12:08:20 |
Lily Foster | i'm on mobile but i'll post tonight (and am setting a reminder in my phone) when i'm at my laptop again | 12:08:37 |
Marie | okay, no worries :3 | 12:08:55 |
| @vid:matrix.org left the room. | 14:59:41 |
| 22 Oct 2023 |
| daniel joined the room. | 13:57:02 |
daniel | Hi! I'm experiencing some node-gyp errors when building a package with buildNpmPackage.
Specifically, I get the error npm ERR! gyp: binding.gyp not found (cwd: /build/1501d1ijr2j8h40cgy6b8wwaz88hi53l-source/node_modules/@maplibre/maplibre-gl-native) while trying to load binding.gyp. Is anyone familiar with a way to migitate this, or is it possibly an upstream issue?
| 14:01:56 |
Cobalt | Anything node-gyp related tends to be a missing dependency. `maplibre-gl-native` sounds like something that needs OpenGL. | 14:04:42 |
Cobalt | Have you checked if the package requires another native library? This dependency may need to be added to `buildInputs` (or other inputs, depending on the usage) | 14:05:54 |
daniel | I get it working in my dev shell when running npm run build. I see that the maplibre-gl-native package doesn't bundle binding.gyp like usual, and uses node-pre-gyp instead to fetch it from GitHub. | 14:05:59 |
Cobalt | Ah, nix build/ nix-build iirc don't allow direct internet access for npm. | 14:07:13 |
Cobalt | In general it's not a good idea but you may be able to get around it by deactivating the sandbox for this specific build: `nix build --option sandbox=false ...`
See also this related discussion: https://discourse.nixos.org/t/how-do-i-access-internet-inside-nix-build/7671/2 | 14:13:28 |
Cobalt | * In general it's not a good idea, but you may be able to get around it by deactivating the sandbox for this specific build: `nix build --option sandbox=false ...`
See also this related discussion: https://discourse.nixos.org/t/how-do-i-access-internet-inside-nix-build/7671/2 | 14:14:14 |
daniel | I believe npm runs in offline mode for the builder, so no luck, but thanks! 😥 | 14:19:11 |
Lily Foster | A node-gyp package doesn't provide a bindings.gyp and expects them to be downloaded from the internet...??! | 14:52:53 |
Lily Foster | node-pre-gyp is for downloading prebuilt binaries | 14:54:07 |
Lily Foster | not the files to build the binaries. afaik | 14:54:14 |
Lily Foster | and is supposed to fail gracefully in the absence of a binary being available? | 14:54:24 |
Lily Foster | Can you share your full build log? | 14:54:35 |
Lily Foster | they removed the ability for it to build at all, so the fallback fails 🙃 https://github.com/mapbox/mapbox-gl-native/pull/15748 | 14:55:29 |
Lily Foster | why is node.js ecosystem such an ecological disaster | 14:55:39 |
Lily Foster | this pr would fix it; https://github.com/maplibre/maplibre-native/pull/535 | 14:56:00 |
Lily Foster | * this pr would fix it: https://github.com/maplibre/maplibre-native/pull/535 | 14:56:03 |
Lily Foster | i'm not sure what a good option is to work around that for now though :( | 14:57:13 |
Lily Foster | ideally you can just patch the package.json in the dependency, but we don't have the machinery yet to patch npm dependencies like that... | 14:57:38 |
Lily Foster | (more details at https://github.com/maplibre/maplibre-native/issues/851 too) | 14:58:15 |
Lily Foster | what you are trying to package that is using maplibre-native? | 14:58:33 |
daniel | Just an application I'm building myself. I found the same references you linked, so I think I will have to discuss it with the maintainers | 15:00:39 |
daniel | Seems awful to patch by hand | 15:00:51 |
Lily Foster | i'm really not sure how you would patch by hand tbh :( | 15:02:08 |