-
Notifications
You must be signed in to change notification settings - Fork 586
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
Binary mirroring not working since node-pre-gyp to prebuild-install migration #4667
Comments
Thanks for the report @Fiouz. This isn't something I'm familiar with but it sounds like you probably have some in depth knowledge of working with this setup – do you have any idea of what we might need to change to make this work, or an example of another npm module which uses |
From what I can gather, we need the following branches to behave the same:
After some quick testing, it seems possible by combining a change on the project, and a change on the build machine:
|
Thanks for the research @Fiouz! I've created a branch of Realm JS with the change you suggested, named |
Yes, it works thank you. As you may already feel, such setup looks janky, so I raised prebuild/prebuild-install#183 to have the point of view of prebuild-install maintainers. |
OK great, I'll run this past the team to check they are happy with this change as I don't have much experience with this part of the build. If they are then we can merge it in |
@Fiouz We have just released Realm JS 10.9.3 which should fix this issue, please let us know if you are still having problems. |
Thank you @tomduncalf, it is indeed working with |
We are actively working on getting a new beta release out now. We have some test failures we are investigating but hopefully we can resolve these soon. I can't commit to a timeline but we will get it out as soon as possible! |
How frequently does the bug occur?
All the time
Description
Context
npm config set realm_binary_host_mirror https://corporate.mirror.lan/repository/static.realm.io
, according to https://github.com/mapbox/node-pre-gyp/blob/v1.0.9/README.md#download-binary-files-from-a-mirror (for older versions of realm) / https://github.com/prebuild/prebuild-install/blob/v7.1.1/README.md#custom-binaries (for newer versions of realm)Command
Expected behavior
npm install
should success, and since our build machines are not able to compile native components, success would imply that the binary was successfully downloaded from the configured HTTP mirror.Since the mirror setting between
node-pre-gyp
andprebuild-install
has the same spelling, we expect a working mirroring for older versions to also work for newer versions of realm.See also: #2501
Actual behavior
When
prebuild-install
constructs the mirror URL, the URL has a different shape compared to the "original" URL, making it unable to download anything from the mirror.Generated URL for mirroring:
Original URL (without mirroring):
(URL obtained by manually executing the
prebuild-install --verbose
command from thenode_modules/realm
directory)This only affects latest versions, previous versions that relied on
node-pre-gyp
(e.g.6.1.8
) are properly mirrored, i.e. the following works fine with binary mirroring enabled:Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
realm_binary_host_mirror
npm variable with the relevant mirror URL (npm config set realm_binary_host_mirror https://mirror.host/static.realm.io
)Since it may be impractical to setup an HTTP mirror just for the sake of reproducing the issue, you can just use the official URL as a mirror URL, and see that this results in a broken URL, as shown in the above reported failure log:
<npm_config_cache>/_prebuilds
npm --loglevel=verbose install [email protected]
, and see that it failsnpm --loglevel=verbose install [email protected]
, and see that it succeedsNote: details about mirroring the npm registry, and making it work with custom X.509 certificates are omitted from the reproduction steps for brevity
Version
10.20.0-beta.5
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Windows / Linux
Build environment
[email protected]
[email protected]
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: