Skip to content
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

Overriding "host" to point to alternative binary repository #74

Closed
springmeyer opened this issue Apr 29, 2014 · 9 comments
Closed

Overriding "host" to point to alternative binary repository #74

springmeyer opened this issue Apr 29, 2014 · 9 comments

Comments

@springmeyer
Copy link
Contributor

Logging this idea. Not positive its a good idea and I may not move on it, but...

Say you want to support much older linux distros with custom binaries. As a developer of an app that depends on node-pre-gyp packaged modules you might want to keep 99% of what node-pre-gyp provides but just request that binaries be fetched from an alternative endpoint that you maintain. If we were to support this then an npm config style override might be possible:

npm config set node-pre-gyp_mapnik_host https://node-mapnik-alternative.s3-us-west-1.amazonaws.com

Then instead of https://node-mapnik.s3-us-west-1.amazonaws.com being used from https://github.com/mapnik/node-mapnik/blob/c36d90b237e76e013bcd2c2e15d11ad304658a9a/package.json#L13, the alternative host would be used:

npm install mapnik
node-pre-gyp http GET https://node-mapnik-alternative.s3-us-west-1.amazonaws.com/v1.4.2/mapnik-v1.4.2-node-v11-darwin-x64.tar.gz
@springmeyer
Copy link
Contributor Author

proof of concept in 21b6559 shows that npm config options magically show up in the process.env for npm (as long as node-pre-gyp is called by npm and not directly)

@mojodna
Copy link

mojodna commented Apr 30, 2014

Maybe just node-pre-gyp_host (i.e. no mapnik, to match the options in package.json)?

Being able to override remote_path and package_name would make sense if host is to be included.

@springmeyer
Copy link
Contributor Author

I meant to do something like npm_config_node_pre_gyp+{module_name}+_host in the code rather than hardcoding mapnik.

I can't see how node-pre-gyp_host would work very well because it would override the host for all modules packaged with node-pre-gyp so for a case like TM2 which also depends on carmen-cache and sqlite3 then you'd break those binary installations unless you also hosted binaries for them.

@mojodna
Copy link

mojodna commented Apr 30, 2014

Excellent point.

bukzor pushed a commit to bukzor/node-pre-gyp that referenced this issue Jul 26, 2014
@springmeyer
Copy link
Contributor Author

@mojodna - still seeing this as useful?

@mojodna
Copy link

mojodna commented Oct 17, 2014

In theory maybe (custom builds), but it's not something I need at this point.

@springmeyer
Copy link
Contributor Author

Thanks! I see this as potentially useful in theory too. Let's re-open when its needed/useful in practice.

@fmarmar
Copy link

fmarmar commented Sep 24, 2019

This should be a must. This morning our entire ci system was down because we couldn't download or build a binary needed by a transitive dependency.

@springmeyer
Copy link
Contributor Author

@fmarmar I think this may be supported after #459

However the breakage this morning impacted everyone using node-tar, so not just node-pre-gyp. And an alliterative repository would not have helped since the breakage was do to the inability to unpack the tar: #477 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants