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
Installs in sandbox 'forgotten' if final build fails #1375
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.
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.
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.
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.
Activity
UnkindPartition commentedon Jun 17, 2013
Oh yes, I find that annoying too.
23Skidoo commentedon Jun 17, 2013
This happens because the code that updates the timestamp file looks approximately like this:
and if
installthrows 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 ininstallitself, directly after installing each add-source dep, or somehow pass the information about updated add-source deps back towithUpdateTimestampFile.bergmark commentedon Oct 3, 2013
I'd really like to see this fixed! Using sandboxes isn't viable when you have a lot of add-source dependencies right now.
tibbe commentedon Nov 4, 2013
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.
acfoltzer commentedon Jan 31, 2015
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.
ygale commentedon Dec 2, 2015
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 dodelete-sourceand thenadd-sourcewithout--snapshot. If you just need a new version, you can doadd-source --snapshotalso for the newer version, and the solver will then consider both of them.Fix how the timestamps of add-source packages are updated.
Fix how the timestamps of add-source packages are updated.
Fix how the timestamps of add-source packages are updated.
23Skidoo commentedon Dec 19, 2017
Fixed in fcabd87.