Skip to content

new-build can't "undo" a build flag and build without the flag #3681

Closed

Description

@mightybyte

Steps to reproduce:

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

Activity

  1. dcoutts commented on Aug 8, 2016

    @dcoutts
    Contributor

    Worth noting that it's a manual flag:

    Flag openssl
      Description: Enable https support using the HsOpenSSL library.
      Default: False
      Manual: True
    
  2. mightybyte commented on Aug 8, 2016

    @mightybyte
    CollaboratorAuthor

    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.

  3. dcoutts commented on Aug 8, 2016

    @dcoutts
    Contributor

    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).

  4. mightybyte commented on Aug 8, 2016

    @mightybyte
    CollaboratorAuthor

    @dcoutts Yeah, I get that. But this seems to be a situation where that model is insufficient.

  5. ezyang commented on Aug 8, 2016

    @ezyang
    Contributor

    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?

  6. added
    cabal-install: v2-build system
    on Aug 15, 2016
  7. ezyang commented on Aug 16, 2016

    @ezyang
    Contributor

    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?

  8. mightybyte commented on Aug 17, 2016

    @mightybyte
    CollaboratorAuthor

    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.

  9. ezyang commented on Aug 24, 2016

    @ezyang
    Contributor

    I think your new problem is another variant of #3719.

  10. mightybyte commented on Aug 29, 2016

    @mightybyte
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: info-neededcabal-install: v2-build systemtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions