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
Use extra-prog-path in running build-type configure #2840
Conversation
LGTM, but you need to pass the tests ;) remove action-required when fixed. |
Please squash into a single commit before merge! Having individual commits that don't build is somewhere between annoying and painful if one ever needs to do "git bitsect". |
@ezyang is that standard cabal practice here? I think i've seen branches that had unsquished bits. |
(also, I guess you can remove the action-required tag -- I don't have the rights to do so) |
Even if it isn't standard practice I'll argue that it should be done in this particular case, regardless. Basically: Having a commit like "whoops, ..." separate from the "main" commit adds nothing of any value to anyone who's going to be looking back through the history or using "git annotate". The commit history should be meaningful to humans. Of course, if there are logically separate commits which each add value on their own, then they shouldn't just be blindly squashed. What I'm basically saying is that the commits should be "curated" such that they form a logical progression for human reviewer, each one of them builds individually and they don't needlessly clutter up history with "wip" or "whoops" or "blah" commits. Believe me, you wouldn't ever want to see the un-curated commit history of any of my feature branches -- they usually go into the tens or hundres of "wip" commits :). This also means that you can commit willy-nilly to your topic branch while you're working on it and clean up one you're ready for final review+merge. This has been standard practice on every single git-based project I've ever worked on and it works really well. (Especially since GitHub actually supports rebase+force-push to a pull request branch quite well.) |
Not in general case, but sometimes I ask people to squish/rebase to make code easier to review. And @BardurArantsson is right about
I agree, but unfortunately it's the reality that one has to live with. Use |
This one should be squashed. There's ~no reason not to, it's really small. With larger sets I'm more sympathetic to not squashing. |
Sorry, didn't want to derail. I'll be quiet after this post. @ezyang : Agreed about larger sets. My criterion is spelled out here
... and it's one that I think makes pretty good sense even though it usually requires a judgement call about "adds value" and "logically separate". |
Ok, let's sort out this last issue and I'm happy to squash -- just wanted to know what the standard practice is here (I know some people run relatively squash-free repos on principle, etc). So on this last issue, I'm trying to figure out what is being recommended. You're suggesting I don't step on the whole env, but only the PATH and CFLAGS variables I guess? Note that we still will have certain clunkiness here. We want to change the PATH and CFLAGS variables, not just step on them willy-nilly. With PATH there's a helper function used elsewhere, but CFLAGS we still have to fish it out of the env and alter it -- it is just the case that we won't clobber the parts of the env that stay the same -- so the net effect is maybe slightly more "precise" code but the cost will imho be further verbosity and less of a "wholemeal" character. That said, I'll go ahead and refactor the commit as so. We can review it on this branch, and then I guess I'll need to make a new PR when I squash? |
No, you can just do |
e5e8a23
to
3117db5
Compare
Ok, refactored and squashed. The refactor ended up reducing the linecount, so actually does feel cleaner overall :-) |
env | ||
let extraPath = fromNubList $ configProgramPathExtra flags | ||
let cflagsEnv = maybe (unwords ccFlags) (++ (" " ++ unwords ccFlags)) $ lookup "CFLAGS" env | ||
pathEnv = maybe (intercalate ";" extraPath) ((intercalate ";" extraPath ++ ";")++) $ lookup "PATH" env |
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.
I think you need to use searchPathSeparator
here instead of ";"
.
LGTM. Probably could be simplified still further by extending |
Use extra-prog-path in running build-type configure
Merged, thanks! |
Before this patch, configure scripts were always run just using whatever "sh" was lying around instead of using the searchpath setup -- hence e.g. on windows even with the searchpath set to point to a msys sh, the cygwin would get chosen, causing a mess. Also, the configure scripts weren't being run with an augmented path, so they wouldn't manage to necessarily find the proper compiler toolchain for testing with autoconf. That is also corrected with this patch.
Also note that by putting the proper msys path in place, this means we get the proper uname for msys, which means that even in a generally cygwin system, a "config.guess" script should now properly detect msys for the build process.
I've verified that on a raw windows shell, without msys in my path, but with the proper pointers provided using extra-prog-path in my cabal/config, I can now configure and build the network library.
This should work even in a cygwin shell, but I haven't tried yet :-)