Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

iojs v1.0.3 (new formula) #36039

Closed
wants to merge 1 commit into from
Closed

iojs v1.0.3 (new formula) #36039

wants to merge 1 commit into from

Conversation

DomT4
Copy link
Member

@DomT4 DomT4 commented Jan 19, 2015

Alternative implementation of #35853 for discussion/giggles/etc.

@DomT4 DomT4 mentioned this pull request Jan 19, 2015
in your `$PATH` as there's a limited amount Homebrew can do to isolate
those. If you wish to use those modules you should permanently
prepend your `$PATH` like such:
export PATH=#{HOMEBREW_PREFIX}/share/iojs/bin:#{libexec}/iojs/bin:$PATH
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this line: If you follow that line, you can just do npm install -g blah or similar. We could simplify this, but I wanted to give maintainers and people options for discussion for now, and I wanted to give developers a way to activate the iojs npm without having it absolutely conflict with the Node npm. This reasonably-hideous workaround achieves that.

@DomT4
Copy link
Member Author

DomT4 commented Jan 19, 2015

Further discussion: Yes, for now, I've removed the option to not install npm. Honestly, not installing npm in this particular format & formula is a complete pain in the neck, and the scripts become much less useful without npm around. I'll put it back if there's strong demand for the option from the maintainers or well, anyone really, but at least for testing purposes I think mandating it isn't the most awful thing we could do.

@tdsmith
Copy link
Contributor

tdsmith commented Jan 20, 2015

Can you summarize the major points of difference with the existing PR?

@DomT4
Copy link
Member Author

DomT4 commented Jan 20, 2015

Sure.

  1. The npm option has been cut. It's mandatory. Reasoning is in the post above.

  2. This formula installs iojs and npm into libexec and then moves npm into homebrew_prefix/share/iojs/lib/node_modules and creates exec scripts for npm and iojs into the main homebrew_prefix/bin. This allows it to not conflict with Node whilst being more readily usable and accessible than keg_only or a solid conflicts_with does.

The exec scripts are the kinda nifty part to play with here - the iojs exec script triggers an instruction to iojs so it knows where the node_modules for it are located, and the npm-iojs exec script triggers a temporary jiggle to the $PATH so npm can always find the node symlink from iojs.

  1. The new iojs/npm_modules bin becomes where npm executables are placed, and the overly lengthy caveat that we'd need to trim over time explains how to access those. What we could do, over a longer-term, is write two short bash scripts that would allow users to do gonode or goiojs and it would switch the node symlink and node_path over automatically. This wouldn't be difficult, but it's not without risk, so I considered a smaller step a better way to get there.

  2. As alluded to above, npm install -g example installs example into HOMEBREW_PREFIX/share/iojs/lib/node_modules and symlinks that to HOMEBREW_PREFIX/share/iojs/bin.

@DomT4
Copy link
Member Author

DomT4 commented Jan 20, 2015

On another small note: I know @othiym23 wanted to avoid renaming npm away to something else, and this is a compromise of that. The exec script placed in homebrew_prefix/bin is called npm-iojs but it is really just a glorified symlink for all intents and purposes - It's also something you can easily negate having to use by prepending the $PATH as discussed in the caveats. If you prepend the $PATH you can just do npm install -g example and that would work.

["man1", "man3", "man5", "man7"].each do |man|
mkdir_p HOMEBREW_PREFIX/"share/man/#{man}"
rm_f Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.}*"]
Dir[libexec/"npm/share/man/#{man}/npm*"].each { |f| ln_sf f, HOMEBREW_PREFIX/"share/man/#{man}" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice spot! Will fix as soon as my internet decides it wants to go a little faster than 7KB/s 😿

Alternative implementation of #35853 for discussion/giggles/etc.
@DomT4 DomT4 changed the title iojs v1.0.2 (new formula) iojs v1.0.3 (new formula) Jan 20, 2015
sha256 "c7fe7f71d9920f4cfd930f9022c7dddca7e11a0377fed1ee23e3241c2952db42"

option "with-debug", "Build with debugger hooks"
option "with-completion", "install bash completion for npm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this without-completion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know if that was too clashing against Node, given this deliberately removes the conflict and keg mechanism? (As an experiment. Not saying this is the best way to get it done, just an alternative to the other discussion). I suppose I could do a little if file already exists don't replace it detection dance? Although that could prove troublesome at updates.

@DomT4
Copy link
Member Author

DomT4 commented Jan 20, 2015

Incredibly useful upstream list monitoring what's broken in terms of packages and when they are fixed here. Thanks to @timoxley for setting that up.

@DomT4
Copy link
Member Author

DomT4 commented Jan 24, 2015

Per Mike's comment in the other thread, closing this PR 👍

@DomT4 DomT4 closed this Jan 24, 2015
@DomT4 DomT4 deleted the iojs branch January 24, 2015 23:13
MikeMcQuaid pushed a commit that referenced this pull request Jan 25, 2015
Closes #34658.
Closes #35853.
Closes #35854.
Closes #36039.
Closes #36193.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants