You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
new-build can't "undo" a build flag and build without the flag #3681
git clone https://github.com/snapframework/snap-server.git
cd snap-server
cabal new-build -fopenssl
...some time goes by
...you come back to working on this package, but haven't changed any code
rm -fr dist-newstyle
cabal new-build
Expected behavior: cabal builds the package without the -fopenssl flag
Actual behavior: cabal tells me that the package is already built, or if it does build the package, it also builds HsOpenSSL which I didn't want to bother with.
At this point I straight-up could not figure out how to get new-build to build the package without the flag. I guess I could have hunted it down in the cache and deleted it, but that's clearly not an acceptable solution.
I think you should be able to reproduce this with any package and flag. It was just particularly obvious to me in this particular case because building HsOpenSSL is finicky on Mac.
This is with cabal-install-1.25.0.0. I think built from commit a92bfc8
Note that this seems like mostly a command-line UI question to me. How do you tell cabal when you want to use an already-built set of flags vs when you want to explicitly tell it to build a new set of flags? But I definitely consider it a bug because the lack of this UI capability was preventing me from doing something that I needed to do.
The intention is that this is a stateless UI, so there isn't a notion of a new set vs an existing set, it's just "build this with these flags as if from scratch" (but it caches a fair bit to avoid redoing unnecessary work).
Does this workaround work? Add this to your cabal.project.local:
package snap-server
flags: -openssl
This just sounds like an outright bug. Just to confirm, if you build snap-server completely from scratch, e.g., a fresh checkout and fresh HOME directory with no flags, it does NOT build HsOpenSSL?
I haven't had much time to look at it either, but when I did look at it I also was having trouble with the repro. It seems I may have encountered another bug. Installing HsOpenSSL on Mac requires specifying --extra-include-dirs. That works fine with cabal install, but it doesn't seem to be working with new-build.
Activity
dcoutts commentedon Aug 8, 2016
Worth noting that it's a manual flag:
mightybyte commentedon Aug 8, 2016
Note that this seems like mostly a command-line UI question to me. How do you tell cabal when you want to use an already-built set of flags vs when you want to explicitly tell it to build a new set of flags? But I definitely consider it a bug because the lack of this UI capability was preventing me from doing something that I needed to do.
dcoutts commentedon Aug 8, 2016
The intention is that this is a stateless UI, so there isn't a notion of a new set vs an existing set, it's just "build this with these flags as if from scratch" (but it caches a fair bit to avoid redoing unnecessary work).
mightybyte commentedon Aug 8, 2016
@dcoutts Yeah, I get that. But this seems to be a situation where that model is insufficient.
ezyang commentedon Aug 8, 2016
Does this workaround work? Add this to your
cabal.project.local:This just sounds like an outright bug. Just to confirm, if you build
snap-servercompletely from scratch, e.g., a fresh checkout and fresh HOME directory with no flags, it does NOT build HsOpenSSL?ezyang commentedon Aug 16, 2016
I did exactly the instructions in the ticket and couldn't repro. My commit is 3e3f3aa. @mightybyte do you have any other ideas about how to repro?
mightybyte commentedon Aug 17, 2016
I haven't had much time to look at it either, but when I did look at it I also was having trouble with the repro. It seems I may have encountered another bug. Installing HsOpenSSL on Mac requires specifying --extra-include-dirs. That works fine with cabal install, but it doesn't seem to be working with new-build.
ezyang commentedon Aug 24, 2016
I think your new problem is another variant of #3719.
mightybyte commentedon Aug 29, 2016
Ok, I agree with your assessment of #3719 for my --extra-include-dirs problem. I'll close this for now since I'm not sure what is up with my repro.