Skip to content

ci: work around osx-* hangs #2527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2020
Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 25, 2020

There is currently a problem in the macOS-latest agents of Azure Pipelines where p4d -V would hang, and the osx-* jobs would time out.

This patch works around that.

@dscho dscho force-pushed the workaround-macos-sip branch from 4b48619 to 800beac Compare February 25, 2020 15:01
@dscho dscho changed the title [DEBUG] analyze osx-* hangs ci: work around osx-* hangs Feb 25, 2020
The most recent Azure Pipelines macOS agents enable what Apple calls
"System Integrity Protection". This makes `p4d -V` hang: there is some
sort of GUI dialog waiting for the user to acknowledge that the copied
binaries are legit and may be executed, but on build agents, there is no
user who could acknowledge that.

Let's ask Homebrew specifically to _not_ quarantine the Perforce
binaries.

Helped-by: Aleksandr Chebotov
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member Author

dscho commented Feb 25, 2020

Hold on, there is a better solution: brew cask install --no-quarantine. But we'll need more changes to make t5616, t5702 and t5703 work.

@dscho dscho force-pushed the workaround-macos-sip branch 5 times, most recently from 5054af8 to e35351b Compare February 25, 2020 22:33
Among other differences relative to GNU sed, BSD sed always ends its
output with a trailing newline, even if the input did not have such a
trailing newline.

Surprisingly, this makes three httpd-based tests fail on macOS: t5616,
t5702 and t5703. ("Surprisingly" because those tests have been around
for some time, but apparently nobody runs them on macOS with a working
Apache2 setup.)

The reason is that we use `sed` in those tests to filter the response of
the web server. Apart from the fact that we use GNU constructs (such as
using a space after the `c` command instead of a backslash and a
newline), we have another problem: BSD sed LF-only newlines while
webservers are supposed to use CR/LF ones.

Even worse, t5616 uses `sed` to replace a binary part of the response
with a new binary part (kind of hoping that the replaced binary part
does not contain a 0x0a byte which would be interpreted as a newline).

To that end, it calls on Perl to read the binary pack file and
hex-encode it, then calls on `sed` to prefix every hex digit pair with a
`\x` in order to construct the text that the `c` statement of the `sed`
invocation is supposed to insert. So we call Perl and sed to construct a
sed statement. The final nail in the coffin is that BSD sed does not
even interpret those `\x<hex>` constructs.

Let's just replace all of that by Perl snippets. With Perl, at least, we
do not have to deal with GNU vs BSD semantics, we do not have to worry
about unwanted trailing newlines, and we do not have to spawn commands
to construct arguments for other commands to be spawned (i.e. we can
avoid a whole lot of shell scripting complexity).

The upshot is that this fixes t5616, t5702 and t5703 on macOS with
Apache2.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho force-pushed the workaround-macos-sip branch 2 times, most recently from c00f4c7 to 36738d9 Compare February 26, 2020 13:43
@dscho dscho merged commit 432da0e into git-for-windows:master Feb 26, 2020
@dscho dscho deleted the workaround-macos-sip branch February 26, 2020 15:57
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2020
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2020
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2020
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2020
@AKkilla69

This comment has been minimized.

git-for-windows-ci pushed a commit that referenced this pull request Mar 3, 2020
git-for-windows-ci pushed a commit that referenced this pull request Mar 5, 2020
git-for-windows-ci pushed a commit that referenced this pull request Mar 5, 2020
dscho added a commit that referenced this pull request Mar 10, 2020
git-for-windows-ci pushed a commit that referenced this pull request Mar 11, 2020
dscho added a commit that referenced this pull request Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants