mafia icon indicating copy to clipboard operation
mafia copied to clipboard

`mafia install` accepts Cabal version constraints (for better or worse)

Open damncabbage opened this issue 9 years ago • 2 comments

The following commands all work to install purescript version 0.8.5.0:

  • env MAFIA_HAPPY=true MAFIA_ALEX=true support/purs/bin/mafia install purescript
  • env MAFIA_HAPPY=true MAFIA_ALEX=true support/purs/bin/mafia install 'purescript == 0.8.5.0'
  • env MAFIA_HAPPY=true MAFIA_ALEX=true support/purs/bin/mafia install purescript-0.8.5.0
  • env MAFIA_HAPPY=true MAFIA_ALEX=true support/purs/bin/mafia install 'purescript == 0.8.5.*'

Two things:

  • It appears that the purescript == ...-style version constraints are getting passed through to Cabal, intentionally or otherwise.
  • Running the above in that order locally on my machine caused a rebuild between purescript-0.8.5.0 and purescript == 0.8.5.* despite them both resolving to the same version and there being no newer release of purescript.

With that aforementioned sequence, the following symlinks appear in ~/.ambiata/mafia/bin/:

purescript -> /Users/rhoward/.ambiata/mafia/packages/1/7.10.2/purescript-0.8.5.0-ab4bc21f6a195351e4fa59c180b26d530b9b726b
purescript == 0.8.5.* -> /Users/rhoward/.ambiata/mafia/packages/1/7.10.2/purescript-0.8.5.0-ab4bc21f6a195351e4fa59c180b26d530b9b726b
purescript == 0.8.5.0 -> /Users/rhoward/.ambiata/mafia/packages/1/7.10.2/purescript-0.8.5.0-f2f4205df16974a148c98d17e8af03267fc94500
purescript-0.8.5.0 -> /Users/rhoward/.ambiata/mafia/packages/1/7.10.2/purescript-0.8.5.0-f2f4205df16974a148c98d17e8af03267fc94500

(Yes, those are directory names with spaces in them.)

damncabbage avatar May 12 '16 05:05 damncabbage

nice

good buddy plink makes the mess https://github.com/ambiata/mafia/blob/master/src/Mafia/Bin.hs#L85

not sure if we understand InstallPackage as anything besides 'a string that cabal accepts'. might want to use a more constrained parser here https://github.com/ambiata/mafia/blob/master/main/mafia.hs#L190

thumphries avatar May 12 '16 06:05 thumphries

not sure if we understand InstallPackage as anything besides 'a string that cabal accepts'. might want to use a more constrained parser here https://github.com/ambiata/mafia/blob/master/main/mafia.hs#L190

Yeah this is awful, my bad :(

jacobstanley avatar May 12 '16 06:05 jacobstanley