silverstripe / silverstripe-travis-support

Creates a SilverStripe project "around" a module, based on core version constraints and its composer.json definitions
Other
13 stars 16 forks source link

Composer installs appear to be cached incorrectly #36

Closed kinglozzer closed 8 years ago

kinglozzer commented 8 years ago

Hooray for introducing my own issues! This leads on from https://github.com/silverstripe-labs/silverstripe-travis-support/pull/35.

When running a travis build using the new --prefer-source option, Composer attempts to download the source version of the package and sometimes fails - falling back to the dist version.

Travis build log:

- Installing silverstripe/framework (3.3.x-dev de61551)
    Cloning de6155188552003c294f115588dcdab9a79cef44
    Failed to download silverstripe/framework from source: Failed to execute git checkout 'de6155188552003c294f115588dcdab9a79cef44' -- && git reset --hard 'de6155188552003c294f115588dcdab9a79cef44' --

fatal: Not a git repository (or any of the parent directories): .git

    Now trying to download from dist
  - Installing silverstripe/framework (3.3.x-dev de61551)
    Downloading
    Extracting archive

I’ve got no idea why that would fail, the commit definitely exists and --verbose doesn’t give any more info than the above. You can see from the rest of the log that some packages work and some don’t (it doesn’t seem to be related to whether they’re using tags or commit hashes).

I’ve copied the generated composer.json and run it locally and it works absolutely fine. That, and the Not a git repository error message, makes me think some caching is going on that’s downloading the dist copy when Composer thinks it’s downloading the source copy.

I don’t know if this is an issue with this repo, Travis, Composer, or me 😆.

tractorcow commented 8 years ago

It normally happens when rate limited; You can get around it sometimes by setting up a github api key against your travis repo.

Try doing this on https://travis-ci.org/bigfork/silverstripe-oauth-login/settings

image

And create your token from github. In the top menu to the right, click the tools icon (Account Settings). Click on “Applications” in the sidebar (to the left). In the box with the title “Personal Access Tokens”, press the “Create new token” button.

Nothing is cached because travis ci instances are thrown away, so no caches persist between builds. You can get around it, but we opt to not do so, as we end up with stale builds more often than not...

Anyway, ping me if you get stuck. :)

kinglozzer commented 8 years ago

I’m still struggling 😢. I added the token, but it’s still loading some repos from dist instead of source. I’ve opened an issue on the Composer repo too https://github.com/composer/composer/issues/5546

tractorcow commented 8 years ago

Yeah there's still some problem going on here.

Failed to download silverstripe/framework from source: Failed to execute git checkout '96b061ffffd472f917273b43790f5aaa2f9f89b4' -- && git reset --hard '96b061ffffd472f917273b43790f5aaa2f9f89b4' --

tractorcow commented 8 years ago

Ah, maybe there is an issue with composer... regarding that ticket you raised. Hope it bears some fruit. :)