# [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it

5 messages from 2016-09-21 to 2016-09-22. Participants: larsxschneider@gmail.com, stefan.naewe@atlas-elektronik.com, Lars Schneider, Junio C Hamano.
Thread: https://gitlist.dev/t/44123

## larsxschneider@gmail.com, 2016-09-21 08:45

Subject: [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it
Message-ID: <20160921084518.13091-1-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/20160921084518.13091-1-larsxschneider%40gmail.com

```
From: Lars Schneider <larsxschneider@gmail.com>

The TravisCI macOS build is broken because homebrew (a macOS depedency
manager) changed its internal directory structure [1]. This is a problem
because we modify the Perforce dependencies in the homebrew repository
before installing them.

Fix it by asking homebrew for its path instead of hardcoding it.

[1] https://github.com/Homebrew/brew/commit/0a09ae30f8b6117ad699b4a0439010738989c547

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---

Hi Junio,

the problem affects all branches (pu, next, master, maint):
https://travis-ci.org/git/git/branches

Is it possible for this fix to graduate more quickly?

Thanks,
Lars

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 477c3d2..37a1e1f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -78,7 +78,7 @@ before_install:
         FORMULA=$1
         SHA=$(brew fetch --force $FORMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 2)
         sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
-          /usr/local/Library/Taps/homebrew/homebrew-binary/$FORMULA.rb
+          "$(brew --repository homebrew/homebrew-binary)/$FORMULA.rb"
       }
       brew update --quiet
       brew tap homebrew/binary --quiet
--
2.10.0


```

## stefan.naewe@atlas-elektronik.com, 2016-09-21 09:31

Subject: Re: [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it
Message-ID: <83e3049c-34ea-4440-7b4d-061cb98ba2dd@atlas-elektronik.com>
URL: https://gitlist.dev/e/83e3049c-34ea-4440-7b4d-061cb98ba2dd%40atlas-elektronik.com
In-Reply-To: <20160921084518.13091-1-larsxschneider@gmail.com>

```
In the Subject: s/the //

Am 21.09.2016 um 10:45 schrieb larsxschneider@gmail.com:
> From: Lars Schneider <larsxschneider@gmail.com>
> 
> The TravisCI macOS build is broken because homebrew (a macOS depedency

s/depedency/dependency/

> manager) changed its internal directory structure [1]. This is a problem
> because we modify the Perforce dependencies in the homebrew repository
> before installing them.
> 
> Fix it by asking homebrew for its path instead of hardcoding it.
> 
> [1] https://github.com/Homebrew/brew/commit/0a09ae30f8b6117ad699b4a0439010738989c547
> 
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
> 
> Hi Junio,
> 
> the problem affects all branches (pu, next, master, maint):
> https://travis-ci.org/git/git/branches
> 
> Is it possible for this fix to graduate more quickly?
> 
> Thanks,
> Lars
> 
>  .travis.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 477c3d2..37a1e1f 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -78,7 +78,7 @@ before_install:
>          FORMULA=$1
>          SHA=$(brew fetch --force $FORMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 2)
>          sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
> -          /usr/local/Library/Taps/homebrew/homebrew-binary/$FORMULA.rb
> +          "$(brew --repository homebrew/homebrew-binary)/$FORMULA.rb"
>        }
>        brew update --quiet
>        brew tap homebrew/binary --quiet
> --
> 2.10.0
> 
> 


-- 
----------------------------------------------------------------
/dev/random says: If winning isn't important then why keep score?
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')" 
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF
```

## Lars Schneider, 2016-09-21 13:28

Subject: Re: [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it
Message-ID: <14C21417-491B-4C8E-90FE-47154EEDD9FE@gmail.com>
URL: https://gitlist.dev/e/14C21417-491B-4C8E-90FE-47154EEDD9FE%40gmail.com
In-Reply-To: <83e3049c-34ea-4440-7b4d-061cb98ba2dd@atlas-elektronik.com>

```

> On 21 Sep 2016, at 11:31, stefan.naewe@atlas-elektronik.com wrote:
> 
> In the Subject: s/the //
> 
> Am 21.09.2016 um 10:45 schrieb larsxschneider@gmail.com:
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> The TravisCI macOS build is broken because homebrew (a macOS depedency
> 
> s/depedency/dependency/

Thanks for spotting both errors!

@Junio: Should I make a v2?

Thanks,
Lars

```

## Junio C Hamano, 2016-09-21 16:42

Subject: Re: [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it
Message-ID: <xmqqzin19pbj.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqzin19pbj.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <14C21417-491B-4C8E-90FE-47154EEDD9FE@gmail.com>

```
Lars Schneider <larsxschneider@gmail.com> writes:

>> On 21 Sep 2016, at 11:31, stefan.naewe@atlas-elektronik.com wrote:
>> 
>> In the Subject: s/the //
>> 
>> Am 21.09.2016 um 10:45 schrieb larsxschneider@gmail.com:
>>> From: Lars Schneider <larsxschneider@gmail.com>
>>> 
>>> The TravisCI macOS build is broken because homebrew (a macOS depedency
>> 
>> s/depedency/dependency/
>
> Thanks for spotting both errors!
>
> @Junio: Should I make a v2?

No.  osx before_install stuff was in there since the very beginning,
i.e. 522354d7 ("Add Travis CI support", 2015-11-27), so I guess this
needs to go to maint-2.7 and upwards, but I guess we should discourage
people to stay on an older maintenance track forever, so let's do
this only for 'maint' and upwards.

```

## Lars Schneider, 2016-09-22 09:03

Subject: Re: [PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it
Message-ID: <A1C0644E-095A-4903-AE86-72EAEFEB385B@gmail.com>
URL: https://gitlist.dev/e/A1C0644E-095A-4903-AE86-72EAEFEB385B%40gmail.com
In-Reply-To: <xmqqzin19pbj.fsf@gitster.mtv.corp.google.com>

```

> On 21 Sep 2016, at 18:42, Junio C Hamano <gitster@pobox.com> wrote:
> 
> Lars Schneider <larsxschneider@gmail.com> writes:
> 
>>> On 21 Sep 2016, at 11:31, stefan.naewe@atlas-elektronik.com wrote:
>>> 
>>> In the Subject: s/the //
>>> 
>>> Am 21.09.2016 um 10:45 schrieb larsxschneider@gmail.com:
>>>> From: Lars Schneider <larsxschneider@gmail.com>
>>>> 
>>>> The TravisCI macOS build is broken because homebrew (a macOS depedency
>>> 
>>> s/depedency/dependency/
>> 
>> Thanks for spotting both errors!
>> 
>> @Junio: Should I make a v2?
> 
> No.  osx before_install stuff was in there since the very beginning,
> i.e. 522354d7 ("Add Travis CI support", 2015-11-27), so I guess this
> needs to go to maint-2.7 and upwards, but I guess we should discourage
> people to stay on an older maintenance track forever, so let's do
> this only for 'maint' and upwards.

Sound good to me.

Thank you,
Lars


Minor nit: 
If still possible and no trouble for you please do
`s/the //` on the subject line of 72fa5cd29f2a9249462215109dbf41b4a6c0c768 (in PU)


```
