-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Haskell#cabal_install more robust deps resolution #49158
Conversation
Can you link to an explanation of what this does? Thanks @ilovezfs! |
8f9eac0
to
8404a28
Compare
8404a28
to
efc729a
Compare
Are there any downsides to this being the global default? |
In general, I don't think so. The symptom would be that it takes "too long" or literally takes forever, but the build would timeout in that case during dependency resolution, so it's not like there's a mystery where the problem is. The concern would be that this could potentially mask upstream issues where upstream really "should" change configuration to make it so that it can succeed with the default max-backjumps, which is currently 2000, but that probably goes in the saving-the-world-from-itself category, since Hackage will always be a nightmare regardless of what actions Homebrew takes. It should be trivial to make it per formula now or later if global isn't the way you'd like to go. |
@ilovezfs Read those, still don't understand what a backjump is 😀. Can you elaborate in stupid-human speak?
Is this an option for us, somehow? |
@MikeMcQuaid Wiki can do a better job than me, I think
Yes, indeed. Basically, brew would internally need to use the newfangled tool called "stack," which lets you do magical things like stack --resolver=lts-5.3, which causes it to use the consistent package set here: I also found a second solution to the git-annex build-failure, which is that passing |
@ilovezfs Great, thanks. I think I'm 🆗 with this solution as-is but it would be great to try and use this |
Does that mean that a user building locally from source could potentially end up with a stuck build that gives no indication on why it won't terminate? (Or are you referring to some |
There are cases where the algorithm will never stop. |
Could we maybe set the number to something very large instead? |
@MikeMcQuaid The default is 2000. In the case of the current git-annex failure, it required 43,478. So maybe set it to that, and readjust it up in the future if needed? |
@MikeMcQuaid Another option is to do something like this:
I think it'd have to use popen if we wanted to match specifically for the backjumps error, and only retry on that. |
@ilovezfs Bumping it to 100,000 seems reasonable to me. |
@MikeMcQuaid Does a magical number like that belong inline, in Library/Homebrew/config.rb, or somewhere else? |
@ilovezfs Inline is fine; just add a wee comment justifying it. |
efc729a
to
d238841
Compare
@MikeMcQuaid I refreshed the PR with 10^5 and a comment.
Scottish shibboleth? :) |
d238841
to
ca351ac
Compare
@ilovezfs Thanks for adjusting that to a higher but still finite number of backjumps! If that solves the observed issue, I'm happy with this fix. 👍 |
ca351ac
to
6d9f5dd
Compare
@UniqMartin Your wish is my command! |
A few notes for this and/or future submissions (as you're a prolific contributor by now):
Thanks for considering these points. And thanks for the many good contributions in the recent past! |
My apologies. Of course I review them locally first. Some typos have a way of escaping my notice until I see the text formatted on GitHub for some reason. I assumed that the CI immediately canceled a prior job for the same PR.
I've deliberately been making the PR titles use more expansive and alternate language, and keeping the commit subject titles < 50 and more narrow. So thanks for piping up because that's not been an accident. |
No. General-user security trumps power-user convenience every day and twice on Sunday. The primary FAQ for the |
👏 |
@MikeMcQuaid Perfect. |
Homebrew also recommends messing with SIP, although it's quickly re-enabled: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md. You could argue that there's also general user security problem there — what if the user forget to re-enable it? Also, as I said, they are just doing users (who do run into the edge case — hopefully not too many) a favor by mentioning it in the FAQ. Otherwise it's just one issue hanging open, and people will search about it and end up with the same solution. Except more time is wasted. |
@zmwangx I'm well aware: |
@MikeMcQuaid That's a very good idea. People often still ask about it in IRC channel and think it's something they should/may need to do now/on update/at-some-point because of that FAQ. |
Okay, objection attempt invalided I guess. Anyway, I still think it's way too paranoid. I agree that a formula should be rejected if it outright doesn't work with SIP on. But if it works 100% of the time for 95% of users, and requires a tweak 0.5% of the time for the remaining 5%, what's the point of making 95% people's lives harder? This is probably going to end in one of the following ways:
Which outcome would you like to see? I'd go for 2, or 1 at least. |
@zmwangx None of the above. I'd like to see them remove the entry and fix any and all reliance on SIP ever being disabled by anyone at any time, whether due to DYLD_LIBRARY_PATH or any other reason. As for Homebrew Cask, it has the same standards with respect to SIP. |
Agreed with @ilovezfs. This is well within their power to change; it's effectively an OS X breaking API change that they are asking people to disable security features to work around. |
Except it's not going to happen easily. According to their FAQ,
That's basically saying "we need help or it'll stay that way". If you really care so much about SIP (I don't) and you know a fix, it's well within your power to submit a patch, as always. Also, this is not an ideal world. Even Apple vendors binaries that only work when SIP is disabled, e.g.,
|
It is. I already help Stack by maintaining Homebrew which maintains their software, though, and I don't have time to dig that deep on the implementation of a project I don't use, unfortunately. |
EOF |
Yeah, but then the stack project also has more important goals than hack around runtime protections that only a tiny fraction of users may ever bump into. What's so wrong about the workaround "disable SIP if you are okay with it" to an issue in which no one wants to invest time? |
I don't think Stack/Homebrew end-users are always in a good situation to weigh up the risks. If they need to use Stack and it isn't working and a guide says "follow these instructions to make it work": a lot of people (myself included) may just follow the steps without thinking too much about the consequences. |
Yep, no doubt many people aren't interested in the details of SIP stuff and just want to have the issue at hand fixed. But are there actually consequences? Prior to El Capitan people lived peacefully with their Macs for many years... Many still do without SIP, and Homebrew does support those systems at least for now. It's not like you'll suddenly be pwned if you turn it off. To me, SIP is a nice-to-have, especially for technically-challenged general public without safe browsing habits, but policing packages that are slightly incompatible seems too much to me.
I think that's a good analogy. I'm sure there are many formulae in Homebrew that are slightly broken against OS X's APIs in certain edge cases, but they're included none the less because (1) they build; (2) they work at least most of the time. |
@zmwangx You're perfectly capable of researching the answer to that question yourself in a non-rhetorical fashion, and I'm sure your department has several relevant courses on computer security if it's a topic that interests you. |
Yup. I think that's fair. We can handle individual cases as we encounter them but Apple seems to have ironed out some of the earlier problems we had with SIP, and a lot of the people who were going to update to El Cap already have at this point. I'll remove it shortly. This thread managed to triple the size of my GitHub inbox when I finally got around to checking it this afternoon, heh. |
@DomT4 Thanks! |
They've compromised fairly well on this: commercialhaskell/stack#1799 |
@MikeMcQuaid @zmwangx FYI: #49387 making stack lts cabal.config an option |
Thanks again @ilovezfs! |
This could be made adjustable on a per formula basis, but since nothing in Language::Haskell::Cabal currently ensures only LTS configurations are used, always setting -1 (unlimited) makes sense.