kylef / heroku-buildpack-swift

Heroku build pack for Swift
BSD 3-Clause "New" or "Revised" License
508 stars 0 forks source link

Deploy failing, git 2.0 or higher required #11

Closed rosslebeau closed 7 years ago

rosslebeau commented 8 years ago

I pushed this morning and everything worked fine. I just tried to push again after changing only some html, and got this error:

remote: Cloning https://github.com/PlanTeam/BSON.git
remote: /usr/bin/git clone --recursive --depth 10 https://github.com/PlanTeam/BSON.git /tmp/build_0826ab0073ff8007fc2b2472e23a5430/Packages/BSON
remote: Cloning into '/tmp/build_0826ab0073ff8007fc2b2472e23a5430/Packages/BSON'...
remote: No submodule mapping found in .gitmodules for path 'docs'
remote: 
remote: swift-build: error: Git 2.0 or higher is required. Please update git and retry.
remote: 
remote:  !     Push rejected, failed to compile Swift app

I tried cleaning the heroku cache, and I couldnt find any way to view or update the version of git on heroku. I know its not local because my version of git is git version 2.7.3 Any ideas?

kylef commented 8 years ago

It would seem that Heroku has git 1.7.0. Did you recently switch version of Swift you are using? I'm wondering if this requirement is new.

$ heroku run git --version
Running git --version on redacted... up, run.5308
git version 1.7.0

I think what we will have to do, is manually install git in the build pack to get a later version.

rosslebeau commented 8 years ago

I did not change the Swift version. I swear the only thing I changed was some html 😀 I'm using DEVELOPMENT-SNAPSHOT-2016-05-03-a.

Also super weird, I see this:

$ heroku run git --version
Running git --version on bytefish... up, run.2046
git version 1.9.1

It's old AND inconsistent...

kylef commented 8 years ago

@rosslebeau I think you may be on a higher version of Heroku's stack. You can check via:

$ heroku apps:info | grep Stack
Stack:         cedar

Heroku did have some "mysterious" emergency platform maintenance earlier today. I wonder if they had to downgrade git for some reason. https://status.heroku.com/incidents/893

rosslebeau commented 8 years ago

Crap this is in their docs: https://devcenter.heroku.com/articles/cedar-ubuntu-packages

I'm running cedar-14 (the only non-deprecated option), which specifies git 1.9.1.

I wonder why this worked before...

kylef commented 8 years ago

Looking trough the code for Swift Package Manager, the error for git 2.0 is only thrown if there was a problem cloning your repository (https://github.com/apple/swift-package-manager/blob/405c29686f4a5d8213c883df0e157d53d7dbb084/Sources/Get/Git.swift#L37).

You can see the actual git error before the version error:

remote: /usr/bin/git clone --recursive --depth 10 https://github.com/PlanTeam/BSON.git /tmp/build_0826ab0073ff8007fc2b2472e23a5430/Packages/BSON
remote: Cloning into '/tmp/build_0826ab0073ff8007fc2b2472e23a5430/Packages/BSON'...
remote: No submodule mapping found in .gitmodules for path 'docs'

It seems git is actually throwing this error because there is an empty .gitmodules file in the repository. Newer versions of git will not throw this error when there is an empty .gitmodules file and the --recursive clone option is used.