tadzik / rakudobrew

Perl 6 installation manager
MIT License
185 stars 42 forks source link

try to match panda's version to the current rakudo #84

Closed garu closed 8 years ago

garu commented 8 years ago

Hi! First of all let me thank you for rakudobrew: it's a great tool and the one thing I missed to start really digging into perl 6!

It got my attention that, when installing panda via build-panda or build panda, rakudobrew was not taking into account whether panda had a matching version for the rakudo it was built for. As a result, it was doing weird things like installing panda HEAD for a very old rakudo build (like pre v6.c).

This is a simple patch that attempts to fix this issue. It works the following way:

If the user has provided a version for panda (e.g. "rakudobrew build-panda 2016.01") then it honors said version and croaks if it can't find it.

However, if the user has NOT provided a version for panda (e.g. "rakudobrew build-panda") then it first tries to checkout a panda version that matches the current rakudo version being used. If it can't find a match, it fallbacks to panda's HEAD (with a mention on the logs). The user can still update its panda by simply doing a "rakudobrew build-panda HEAD".

I think this might help people trying to work with many different rakudo versions. It's specially interesting for Travis-CI, where you can now write on the install section:

rakudobrew build-panda

instead of:

rakudobrew build-panda $([ "$TRAVIS_PERL6_VERSION" == "latest" ] && echo "" || echo $TRAVIS_PERL6_VERSION)

Hope this is helpful! And thanks again for all the great work in rakudobrew :)

Cheers!

tadzik commented 8 years ago

Awesome improvement, thanks a lot, and sorry to neglect this PR for so long :)