Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Implement installation patching #3182

Closed
celer opened this issue Feb 20, 2013 · 3 comments
Closed

Implement installation patching #3182

celer opened this issue Feb 20, 2013 · 3 comments

Comments

@celer
Copy link

celer commented Feb 20, 2013

So I'd like to suggest a post installation patch functionality.

(there might be a better way to do this, I just don't know what it is)

Recently I struggled with a simple bug in a package that was 3 levels down as dependency.

The bug was in combined-stream which had a dependency chain like so:

request -> form-data -> combined-stream

So to resolve the bug meant I had to work up the tree, and each package had various challenges.

First I had to get the original issue fixed:
felixge/node-combined-stream#4

Then resulting in discovering that form-data had a hard coded version of node-combined-stream, so that had to be fixed.

Then I found out that request bundled its dependencies
request/request#431

This fix took me quite a while to get implemented as I needed to work with each package maintainer, to get the simple one line fix in place.

It would be awesome if post installation patches could be specified for a specific package based upon an included patch or pull request, so for example in my package.json:

patch: {
   'combined-stream@0.0.3': [ 'https://github.com/felixge/node-combined-stream/pull/4', 'patch.diff']
}

Which would apply the specified merge requests / patches post installation of a package when the matching version if the package is installed as dependency anywhere in the tree. Perhaps even allow the tree to be specified:

patch: { 
 'request/form-data/combined-stream@0.0.3':...
}

Initially I wrote some post install scripts to do this but I wasn't ever able to get it working exactly like I wanted and had issues with it implementing the changes I was after.

@luk-
Copy link
Contributor

luk- commented Feb 21, 2013

When I run into a dependency issue like the one you're describing I usually fork the repo, fix the bug, and point my package.json to it until the upstream is fixed and published. This is an interesting idea but I wonder if it would make things super confusing (with a lot of patching going on).

@edef1c
Copy link
Contributor

edef1c commented Feb 25, 2013

I don't think this'll happen. Try @st-luke's approach.

@celer
Copy link
Author

celer commented Feb 25, 2013

So originally I was hoping to use @st-luke approach, but then I discovered I was gonna have to fork a lot of repos to make it work. I should have tried that to see how it was living with that fix.

Thanks

@celer celer closed this as completed Feb 25, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants