Skip to content

Installs in sandbox 'forgotten' if final build fails #1375

Closed

Description

@hesselink

If you add-source some packages in a sandbox, and they get installed as dependencies of a package whose build ultimately fails, they are reinstalled afresh the next time you issue an install command. For example:

  • Have packages a and b, where b depends on a.
  • cabal sandbox add-source a/
  • cabal install b/

This installs a and then b. If b has e.g. a type error, you fix it and issue another cabal install b/, a also gets installed again, even though it was already installed and nothing about it changed.

Activity

  1. UnkindPartition commented on Jun 17, 2013

    @UnkindPartition
    Contributor

    Oh yes, I find that annoying too.

  2. 23Skidoo commented on Jun 17, 2013

    @23Skidoo
    Member

    This happens because the code that updates the timestamp file looks approximately like this:

    withUpdateTimestampFile addSourceDeps $
        install ....
    

    and if install throws an exception the timestamp file doesn't get updated since we don't know which add-source dependencies were updated and which weren't. To fix this we'll have to either update the timestamp file in install itself, directly after installing each add-source dep, or somehow pass the information about updated add-source deps back to withUpdateTimestampFile.

  3. bergmark commented on Oct 3, 2013

    @bergmark
    Contributor

    I'd really like to see this fixed! Using sandboxes isn't viable when you have a lot of add-source dependencies right now.

  4. tibbe commented on Nov 4, 2013

    @tibbe
    Contributor

    Lets try to do the update inside install. What do you think @dcoutts?

    I'm bumping the importance of this bug as it seems to be a bit of a showstopper for some.

  5. acfoltzer commented on Jan 31, 2015

    @acfoltzer
    Collaborator

    Is this now on track for 1.24? I have to do a bunch of workarounds currently to avoid lost time due to this, like scripting smaller install plans together to avoid packages that might be temporarily broken during development.

  6. modified the milestones: , cabal-install-1.22 on Apr 23, 2015
  7. ygale commented on Dec 2, 2015

    @ygale
    Contributor

    Recording here the simple workaround that a lot of people already know:

    Unless you really do expect the external source to change often and require rebuilds, use add-source --snapshot. If at some point later you do need it rebuilt, you cad do delete-source and then add-source without --snapshot. If you just need a new version, you can do add-source --snapshot also for the newer version, and the solver will then consider both of them.

  8. modified the milestones: cabal-install 1.24, on Feb 21, 2016
  9. modified the milestone: cabal-install 2.0 on Sep 6, 2016
  10. removed their assignment
    on Sep 13, 2016
  11. 23Skidoo commented on Dec 19, 2017

    @23Skidoo
    Member

    Fixed in fcabd87.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions