You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though prebuild-install seems to have a similar option set compared to node-pre-gyp, mirroring is much harder to achieve and requires proper planning from the package maintainer.
Requirements for mirroring a binary that relies on node-pre-gyp:
(consumer) Mirror the <package.json>.binary.host
(consumer) Configure the npm <package>_binary_host_mirror variable to point to the mirror
Requirements for mirroring a binary that relies on prebuild-install with a custom host:
(package maintainer) Need to make sure that <package.json>.binary.remote_path ends with the hardcoded /{tag_prefix}{version}/ pattern. In case remote_path does not already include {tag_prefix}, prebuild-install must be invoked with --tag-prefix=
(consumer) Mirror the <package.json>.binary.host
(consumer) In case interoperability with node-pre-gyp is needed (e.g. case of realm library)
use the <package>_binary_host npm variable, and keep <package>_binary_host_mirror unchanged
configure <package>_binary_host npm variable to include whatever is needed so that the concatenation of <package>_binary_host + /{tag_prefix}{version}/ (taking into consideration that {tag_prefix} is controlled by package maintainer) matches the HTTP mirror
Context
prebuild-install/util.js
Lines 46 to 60 in 8250adf
Issue
Even though prebuild-install seems to have a similar option set compared to node-pre-gyp, mirroring is much harder to achieve and requires proper planning from the package maintainer.
Requirements for mirroring a binary that relies on node-pre-gyp:
<package.json>.binary.host
<package>_binary_host_mirror
variable to point to the mirrorRequirements for mirroring a binary that relies on prebuild-install with a custom host:
<package.json>.binary.remote_path
ends with the hardcoded/{tag_prefix}{version}/
pattern. In caseremote_path
does not already include{tag_prefix}
, prebuild-install must be invoked with--tag-prefix=
<package.json>.binary.host
<package>_binary_host
npm variable, and keep<package>_binary_host_mirror
unchanged<package>_binary_host
npm variable to include whatever is needed so that the concatenation of<package>_binary_host
+/{tag_prefix}{version}/
(taking into consideration that{tag_prefix}
is controlled by package maintainer) matches the HTTP mirrorAn example of such difficulty can be seen at realm/realm-js#4667 (comment)
Is there a chance to simplify binary mirroring?
The text was updated successfully, but these errors were encountered: