Page MenuHomePhabricator

[keyserver] Make opaque-ke-napi build on Windows
ClosedPublic

Authored by michal on Jan 3 2023, 5:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 12:44 AM
Unknown Object (File)
Sun, Apr 21, 12:44 AM
Unknown Object (File)
Sun, Apr 21, 12:43 AM
Unknown Object (File)
Sun, Apr 21, 12:41 AM
Unknown Object (File)
Apr 2 2024, 12:35 AM
Unknown Object (File)
Apr 2 2024, 12:35 AM
Unknown Object (File)
Mar 18 2024, 6:17 AM
Unknown Object (File)
Mar 6 2024, 3:46 AM
Subscribers

Details

Summary

We want to be able to build the desktop app on Windows but currently opaque-ke-napi fails.
As far as I've investigated the issue happens because when you run napi build it searches for node_modules/@napi-rs/cli/index.js. It can't find it on windows because of some symlink weirdness
(we are using yarn workspaces so we are running this in node_modules/native folder that's symlinked to the real folder).

This diff uses the nohoist option to keep @napi-rs/cli inside native/node-modules (otherwise it's hoisted to the root node_modules). The biggest problem with this approach is that if we ever use @napi-rs/cli in some other package it wouldn't be shared.

Test Plan
  • yarn cleaninstall on macOS laptop works
  • CI on phab works
  • yarn cleaninstall on Windows laptop and on GitHub Windows Runner (in a forked repo) works

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Alternatively, we could do something similar to D6142 (make a bash script and skip napi build step if it's Windows).

keyserver/addons/opaque-ke-napi/package.json
7 ↗(On Diff #20516)

We need to make this package private to use the workspaces option.

michal requested review of this revision.Jan 3 2023, 5:50 AM

Doesn't seem great but I'm not sure of a better option. The nohoist shouldn't have any additional performance cost since this is the only place we use it

This revision is now accepted and ready to land.Jan 3 2023, 10:43 AM