On 7/1/26 10:30, Stuart Henderson wrote:
> On 2026/07/01 01:51, David Uhden Collado wrote:
>> What might be more useful long term is a proper ports module for
>> Node-based ports, similar to the existing port-modules(5) mechanism.
>> The ports framework already has optional modules pulled in through
>> MODULES, and non-core modules are normally looked up by pkgpath and
>> a .port.mk file:
>>
>> https://man.openbsd.org/port-modules.5
>>
>> Something like this:
>>
>> MODULES += lang/node
>>
>> could provide a standard way to declare, fetch, cache, and hash npm
>> dependencies from package-lock.json, so Node-based ports do not all
>> need to reinvent that logic.
> 
> There is various work towards this in
> https://github.com/opencrew-tech/openbsd-electron
> 
> It is super tricky because many of these involve native code downloads
> and dep sets which differ depending on arch.
> 
> 

Atm, this repo is untested. I think it's broken.

I have a few wasm issues in node v8 for which I have patches.
But I also have random stack exhaustion in v8 wasm using berry.
Node 22 should still work.

About offline, both pre-made cache and cache import could fit.
I'm fine with the different patches for the cache import feature.
They could be improved later. I think the mod*-gen-modules are handy.

The problem is native stuff in dependencies.
I tried to share pre-installed packages and use overrides with links.
For electron this is almost ok as it will copy into its .asar
But for classic node, this is fragile and cumbersome.
Also, some package managers require messy patches to make this work.
Actually, I don't remember how, why I ended up in this scenario.

A rework is needed to use system pre-built packages instead of links.
Then we won't have runtime dependencies to manage.
We get closer to an official build and avoid patches to manage links.

There is also the install step which looks too complex.

-- 
Fabien Romano

Reply via email to