-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Add :node special dependency #1408
Conversation
torifat
commented
Oct 30, 2016
•
edited
Loading
edited
@@ -17,3 +17,4 @@ | |||
TuntapDependency = TuntapRequirement | |||
X11Dependency = X11Requirement | |||
ConflictsWithBinaryOsxfuse = NonBinaryOsxfuseRequirement | |||
NodeRequirement = NodeRequirement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to add a compatibility layer for a new requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for pointing it out 😄
fatal true | ||
default_formula "node" | ||
satisfy { which("node") } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to a separate node_requirement.rb
file and, like the JavaRequirement
, support using a version
argument. This should perhaps be compulsory like the `RubyRequirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should perhaps be compulsory like the
RubyRequirement
.
I wouldn't recommend this, personally.
1ec0125
to
e9789e3
Compare
a28308c
to
4587305
Compare
@MikeMcQuaid I'm not good at Ruby. Can you please guide me here? I have implemented the version checking and it's working. But, |
Are you pouring the bottle of a formula to check? If so, that's expected and correct behaviour. To avoid the |
@DomT4 ah, thanks. So, the current code should work fine. Though I forgot to remove Update: It's working 😄 Thanks again. |
Any idea why this test fails only in Jenkins?
|
4bbeec1
to
8b70786
Compare
8b70786
to
937da25
Compare
@MikeMcQuaid Can you have a look here, please? |
Likely because there's no Node installed there. You may need to do some mocking. As @DomT4 mentions above some things that are worth considering on this once it's 💚:
|
But, I have mocked https://github.com/Homebrew/brew/pull/1408/files#diff-595241f18c3635cda19d357a78dc5c52R6
|
This works most of the time, the main exception is when using native modules, where it only works if you install the package on a version of Node.js that's binary (ABI) compatible with the version you use at runtime. In that case, I think generally some package installed using npm 6.x should run on any other 6.x version of npm. The vast majority of npm packages are non-native packages that just contain JavaScript code so it doesn't matter which version of Node.js you used to install them. Also iojs is completely unsupported now, so it's not worth worrying about it. |
Ok. We'll need to figure out a way to encode that into this requirement.
Good to know.
The voice of a non-packager 😉. As we're just looking for a |
@MikeMcQuaid There's no version conflict too: And, finally I mocked https://github.com/Homebrew/brew/pull/1408/files#diff-595241f18c3635cda19d357a78dc5c52R6 |
Let's not worry about that until the PR handles the other issues above. When it's working there I'll help fix the issues. |
Are we sure we want yet another one of these special requirements given the difficulties we've had with the others? |
@ilovezfs I think this may be one where we can handle bottles sensible due to this being interpreted with vendored dependencies rather than using linkage. This PR is still a bit off, though, and there's a bunch of questions to be answered and implemented. |
@MikeMcQuaid I tried to answer all the questions you asked and also pursed @Daniel15 to answer too.
Any suggestions regarding how we can do that?
I'm not sure which questions are still unanswered. |
We'll need confirmation that it does work and has been tested with a couple of different
I'm not sure. Are you saying both the Node and NPM version matter at runtime? |
I can do that for a few popular formulae.
Only IMO |
Thanks! Report back in here and try with
Can you elaborate on "mostly"?
Check out the e.g. |
Is something blocking further progress of this MR? |
wonder if there is any progress |
There's no news or progress. If there was it'd be posted on here. If anyone would like to try and create their own PR: please do. |
Why is this taking so long? Right now yarn from homebrew is broken for lots and lots of people who use nvm. Simply check if node or nvm is installed and skip as necessary. Even if it doesn't handle every case, surely it will improve from what's out there now... |
Sorry I don't understand. The requirement system is only intended to provide non-mandatory flexibility. The default formula should always be sufficient to build any formulae, so the urgency here is pretty low unless you're doing something peculiar. |
Having used |
Because it's neither the maintainers nor contributors paid employment to work on Homebrew or submit a PR to fix this. This PR has changes requested that need addressed and it's failing CI. If you'd like to create your own competing PR, we'd welcome it. This document should help and we're happy to walk you through anything else. Thanks!
If it were a simple problem to solve, it would have been solved already. |
So are you saying there is a way right now to install yarn via homebrew without installing a second copy of node (when using nvm)? |
@sjmueller I no longer have a Mac so I can't test this, but the |
Yes this flag works, but the next time you do a |
@sjmueller as @DomT4 said above, "the most 'broken' I ever found things was the minor irritation of having two Nodes installed." |
@sjmueller two current options:
|
If you don't want to use Homebrew to install Yarn, there's an installation
shell script you can use.
I don't think it's bad to have two Node.js versions installed though,
particularly if you just use nvm for your own apps and the "system" /
Homebrew-installed Node.js for utilities. In the end, I don't think it
really matters which Node.js version is used for Yarn, as long as it works
properly?
Sent from my phone.
…On Jan 13, 2017 6:51 AM, "Mike McQuaid" ***@***.***> wrote:
@sjmueller <https://github.com/sjmueller> two current options:
1. Stop caring about having two nodes on your system
2. Install Yarn through NPM or other means
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1408 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFnHczsjomD3GZDIqRpPT1x8Ltn5ge-ks5rR493gaJpZM4KkYPk>
.
|
Sorry, I'm migrating to another country. So, currently not getting enough time to work on this. Anyone interested should take the lead. |
If the primary reason most people want this is to avoid dual installations that's a slippery slope towards: depends_on :rust
depends_on :go
depends_on :node
depends_on :swift
depends_on :mono
depends_on :maven
depends_on :opam And so on. I can see an argument for it but I also see endless new possibilities for people to break their local builds in interesting ways and then expect Homebrew to know how to fix those use cases, and quickly. Homebrew has already seen quite a bit of that with the I think it would be useful if the argument gets fleshed out a bit more than "Having two of these is annoying", especially when a plain Homebrew |
In my experience it's been quite a hassle having two versions of node competing on the same system. When something goes wrong, which version is running? Did this particular terminal instance use a different node because a path variable was changed? If I'm hunting down a global dependency that I linked locally, am I looking in the right dir? Much easier to troubleshoot when nvm is given autonomy to manage node versions, resulting in a single source of truth. |
@sjmueller A solution has been provided for that. Let's keep the discussion off this PR now, thanks,. |
Would it also be possible to make this work for folks who use |
A requirement won't care where it's coming from as long as the |
@DomT4 Wait, I'm confused. So you're not volunteering to implement |
@ilovezfs All of those being a thing might actually be enough to push me to find an alternative package manager, and I used to help maintain this one 😆. |
I think you and |
Come on now, I didn't say I hated myself and felt the deep need for self-punishment 😉. (Mike's going to tell us off for dragging this off-topic any second, heh). |
Closing as this has stalled. |
|