From patchwork Thu Jan 18 10:22:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13522670 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C315C20B01 for ; Thu, 18 Jan 2024 10:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573369; cv=none; b=i2HL++zFY0FuqgGAQI2nBIyxLD+xzsRraeVucaFaTuBPB1N5VqngDFBS0BFs9BUOJlTzbCKbuYRfgy2kRmm/nxIkAwKLXzQKhIu/HO10nlZToo3e9iXD/tsDYZDFBXi3WFlsX7X14tHKW1alO6/XQxg/v8niULAJMRciKxF8/GE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573369; c=relaxed/simple; bh=r3iYOnXXf454+N9G+JpqjN8o9pV1Gop66/xtHdOvzhU=; h=Received:Received:DKIM-Signature:DKIM-Signature:X-ME-Sender: X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received: Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=AJ/6OaoqlbI8nEWwIMk5sNqMw52/ZJv+CPylLUAZWsmiKE8Iyy0V8ajtEOAtnWyiCei5a3ORu5ReYdRNHLhInkUM74Go/hqCh25bszaS6w1lvy4v5Os3N1+Zxr/DzOy/HsjYNku/V8VlMsA1ln16Vk3UzhV67OgUO5EZQ5Ewsjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=ptNqBAk7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=addnlZtc; arc=none smtp.client-ip=64.147.123.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="ptNqBAk7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="addnlZtc" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9125F3200A90; Thu, 18 Jan 2024 05:22:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 18 Jan 2024 05:22:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1705573366; x=1705659766; bh=QIq8bljEIp TPyZgfHje2NtChIcZfoHdrOxWXR2LnX34=; b=ptNqBAk7LPkpk0Dxl92/7OefQc zNbpVxvhM2zx46uy9P1nOkLFztC3DnnqX+smtSJcJrRHsMs7IGKH78RbGBhWqbRo iCDEuEwJzxM7ACP/THmB8B+htFDBNvcOAInbFYg6GWdVWUre3hN01xayakhpFgkd wJT7RPkWkCPKAl4Wq6Jxmo6mdFazIzWnG++j5PuN2+3pI/iSbMijtDDFAkuvDrcm Yv8kF0YVqkmjy3Ej/2PmjCAr7DK53D1OxF3eqRAkgI/iacCRpFD+NoW5Y38O7+UI vEb8zusDVsyxxVWaGgY1PBDkcEXDOHMSnlWspsFq5R3+yxNWnUwDXWPDvCQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1705573366; x=1705659766; bh=QIq8bljEIpTPyZgfHje2NtChIcZf oHdrOxWXR2LnX34=; b=addnlZtczrz2YO6gwci37MuXCOGlrklpzvOIK4k6wgvX 9xBZ93IqGH3cdBCel0D+AKp9bm/i9xexn4Gean0eF3uV6qdjztciTOlTT/TcPldr +SCjF4OBVF22Jn2AFp+Qx+b1JKANNZ2Xyl3J5vtPzbYKMzvVY8fK7nmDXKyl9EqL WDalBo+IX0Kl+0j/3e2JFVz1rZKepqcbQOtt0vv5n1skRgnSSf8SxrqpK+nRD1vN a1FIV4twubWIijzFloeH6h4/oMWMuNk1alJu95Knm/kt8LXv5TcIv8MGdy40Ay49 ia0pcT5Qdu5qByIRhjrv2U9kWWYkKcSFnjSjDhsTyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejjedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Jan 2024 05:22:45 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id cda49e98 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 18 Jan 2024 10:19:48 +0000 (UTC) Date: Thu, 18 Jan 2024 11:22:41 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Phillip Wood , Matthias =?iso-8859-1?q?A=DFha?= =?iso-8859-1?q?uer?= Subject: [PATCH v2 0/5] ci: add support for macOS to GitLab CI Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Hi, this is the second version of my patch series that adds a macOS job to GitLab CI. Changes compared to v1: - Added a fix for a flaky test in t7527 that caused the pipeline to fail in ~50% of all runs. - Improved some commit messages. - Tests now write test data into a RAMDisk. This speeds up tests and fixes some hung pipelines I was seeing. Thanks for your reviews so far! Patrick Patrick Steinhardt (5): t7527: decrease likelihood of racing with fsmonitor daemon Makefile: detect new Homebrew location for ARM-based Macs ci: handle TEST_OUTPUT_DIRECTORY when printing test failures ci: make p4 setup on macOS more robust ci: add macOS jobs to GitLab CI .gitlab-ci.yml | 34 +++++++++++++++++++++++++++++++++- ci/install-dependencies.sh | 10 ++++------ ci/lib.sh | 12 +++++++++++- ci/print-test-failures.sh | 2 +- config.mak.uname | 13 +++++++++++++ t/t7527-builtin-fsmonitor.sh | 2 +- 6 files changed, 63 insertions(+), 10 deletions(-) Range-diff against v1: -: ---------- > 1: 554b1c8546 t7527: decrease likelihood of racing with fsmonitor daemon 2: 3adb0b7ae8 = 2: 32d8bd1d78 Makefile: detect new Homebrew location for ARM-based Macs -: ---------- > 3: d55da77747 ci: handle TEST_OUTPUT_DIRECTORY when printing test failures 1: a5d725bea7 ! 4: 1ed6e68650 ci: make p4 setup on macOS more robust @@ Commit message into a separate directory which we then manually append to our PATH. This matches what we do on Linux-based jobs. + Note that it may seem like we already did append "$HOME/bin" to PATH + because we're actually removing the lines that adapt PATH. But we only + ever adapted the PATH variable in "ci/install-dependencies.sh", and + didn't adapt it when running "ci/run-build-and-test.sh". Consequently, + the required binaries wouldn't be found during the test run unless the + CI platform already had the "$HOME/bin" in PATH right from the start. + Signed-off-by: Patrick Steinhardt ## ci/install-dependencies.sh ## 3: d196cfd9d0 ! 5: c5ed38f0a6 ci: add macOS jobs to GitLab CI @@ Metadata ## Commit message ## ci: add macOS jobs to GitLab CI - Add two macOS-based jobs to GitLab CI, one for Clang and one for GCC. - This matches equivalent jobs we have for GitHub Workflows, except that - we use macOS 14 instead of macOS 13. + Add a job to GitLab CI which runs tests on macOS, which matches the + equivalent "osx-clang" job that we have for GitHub Workflows. One + significant difference though is that this new job runs on Apple M1 + machines and thus uses the "arm64" architecture. As GCC does not yet + support this comparatively new architecture we cannot easily include an + equivalent for the "osx-gcc" job that exists in GitHub Workflows. Note that one test marked as `test_must_fail` is surprisingly passing: t7815-grep-binary.sh (Wstat: 0 Tests: 22 Failed: 0) TODO passed: 12 - This seems to boil down to an unexpected difference in how regcomp(1) + This seems to boil down to an unexpected difference in how regcomp(3P) works when matching NUL bytes. Cross-checking with the respective GitHub - job shows though that this is not an issue unique to the GitLab CI job - as it passes in the same way there. - - Further note that we do not include the equivalent for the "osx-gcc" job - that we use with GitHub Workflows. This is because the runner for macOS - on GitLab is running on Apple M1 machines and thus uses the "arm64" - architecture. GCC does not support this platform yet. + job shows that this is not an issue unique to the GitLab CI job as it + passes in the same way there. Signed-off-by: Patrick Steinhardt @@ .gitlab-ci.yml: test: + image: $image + tags: + - saas-macos-medium-m1 ++ variables: ++ TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk" + before_script: ++ # Create a 4GB RAM disk that we use to store test output on. This small hack ++ # significantly speeds up tests by more than a factor of 2 because the ++ # macOS runners use network-attached storage as disks, which is _really_ ++ # slow with the many small writes that our tests do. ++ - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk + - ./ci/install-dependencies.sh + script: + - ./ci/run-build-and-tests.sh @@ .gitlab-ci.yml: test: + if test "$CI_JOB_STATUS" != 'success' + then + ./ci/print-test-failures.sh ++ mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/ + fi + parallel: + matrix: base-commit: cd69c635a1a62b0c8bfdbf221778be8a512ad048