From nobody Sat Feb 03 13:15:57 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRtSF2pNqz59MlB; Sat, 3 Feb 2024 13:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRtSF2Hzlz3yfs; Sat, 3 Feb 2024 13:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706966157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pxOKVS9Xsbz8NzppTniDSlWW7RK7Cv3HAAlyW0TqCOg=; b=OhMHrOEpVcZMr46mudNES2obLSMif9TKtXZf7kRdPwpDuYvHj0O31ITvSX6esxGcyynZvn s9NjzRwgjrcKQaZz2kw6Nqjb4j7brxM557p4goHbNkqY7x1kkRut7Hl5mlaBaBKKeTcR/9 gEcu5Dcm624mTo8UPSmtJXVdne3Qo+mJvhFPbZVcWIpKjwuhum43vuDJIMfbAZL+WiHjAg dHBsvBWYvQicA9ZjlOLqrN/waK4HZfE4Shj/79cKpnHLj0KdSCeI/AlEY/FmKramOBLPL2 qvE0cBCPjBOWeDR/A8pmH3cFA/MbWpdiZ8aSh/pVGCGYMRliZ77yCKJVaLm8GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706966157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pxOKVS9Xsbz8NzppTniDSlWW7RK7Cv3HAAlyW0TqCOg=; b=f6EOy+fFfQnuy7Wn8fESQgRedmknF9KQuuBJSwzeKvYwMODUd05ReVfNHnVNrOv//GBPmC /H43tYCnEZ9myeJZ49cUyLY8Nsm23OsHSrwvRRfx66sL4VYqhhs7o1pvD9H2vatQSYqlh/ np6EQCZPdQueTcRwCQukaX4n0v+dPjbFpuKK50bqGldb0Jn4v9mBW4dUmt+uYi2ktpcSRo BwMKOtQqXenT+jeCOdOSc58Sd/vLxOhs/wghhuoiHY/QvTbRoc6K0mxyL4Cr1CwnY3g1Di GXvr2NdJTPGOY4Yp60IwVoPBJTHuQIVYuyooYu82Qp04vrJVMjJRqPIZaTINKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706966157; a=rsa-sha256; cv=none; b=LxRAA43PEgbrbsU1c+sx9s9srhsm6jfGK+eIHNywmQIX4vhxJfpl6VKjKL34XTuM6s3xL4 ooWZj2VR5EaLpAkTNzmpRgYXyBcM7krNtRPmhCmd1AkN3ZVwNtCslSfCisAdrbs4PW4SEV /02RFqVll4IQ18nJOv3MK58CGFMECYOU/7DSNbwNB6E4v6raCLmgjDYxhqU7dYssICYalW U5fg3RTzd9e8v0i3z1nIaalKYRzxYjhZIizAnC6B8imKrDxL0SOcaElWWwxMAS68DlKMGx bI7DxW/C4AspRHjRpBDHsXpPrOJIpmYjKx80M8c3ViYG5iL2Cwag7GZ5Ht5JsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRtSF1LmwzFHk; Sat, 3 Feb 2024 13:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 413DFvLK088888; Sat, 3 Feb 2024 13:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 413DFv1t088885; Sat, 3 Feb 2024 13:15:57 GMT (envelope-from git) Date: Sat, 3 Feb 2024 13:15:57 GMT Message-Id: <202402031315.413DFv1t088885@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: b7f06adf2f2e - main - devel/build2: fix build with clang 18 rc1 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7f06adf2f2ec46b17ae6ee21d18d73c0959145e Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=b7f06adf2f2ec46b17ae6ee21d18d73c0959145e commit b7f06adf2f2ec46b17ae6ee21d18d73c0959145e Author: Dimitry Andric AuthorDate: 2024-02-02 16:50:59 +0000 Commit: Dimitry Andric CommitDate: 2024-02-03 13:14:40 +0000 devel/build2: fix build with clang 18 rc1 As of rc1, clang 18 has a version id formatted as "18.1.0rc". Similarly, builds from the upstream main branch typically have a version id looking like "19.0.0git". Due to the way it parses version strings, devel/build2 cannot handle this format, and fails with: LC_ALL=C c++ -v error: unable to extract Clang minor version from '18' info: use config.cxx.version to override I submitted https://github.com/build2/build2/issues/360 upstream, and they committed a fix: https://github.com/build2/build2/commit/0e1b73e3, which should eventually end up in 0.17.0. The fix applies without issues on 0.16.0, so add it as a patch. PR: 276785 Approved by: fuz (maintainer) MFH: 2024Q1 --- .../files/patch-build2_libbuild2_cc_guess.cxx | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/devel/build2/files/patch-build2_libbuild2_cc_guess.cxx b/devel/build2/files/patch-build2_libbuild2_cc_guess.cxx new file mode 100644 index 000000000000..6721fdcbc86d --- /dev/null +++ b/devel/build2/files/patch-build2_libbuild2_cc_guess.cxx @@ -0,0 +1,79 @@ +commit 0e1b73e3b43bca7c1d77ed669b364819ad211da9 +Author: Boris Kolpackov +Date: 2024-02-02T11:41:33+02:00 + + Handle unseparated `rc` and `git` suffixes in Clang version (GH issue #360) + +--- build2/libbuild2/cc/guess.cxx.orig 2023-06-19 05:26:33 UTC ++++ build2/libbuild2/cc/guess.cxx +@@ -2421,6 +2421,12 @@ namespace build2 + // + // emcc (...) 2.0.8 + // ++ // Pre-releases of the vanilla Clang append `rc` or `git` to the ++ // version, unfortunately without a separator. So we will handle these ++ // ad hoc. For example: ++ // ++ // FreeBSD clang version 18.1.0rc (https://github.com/llvm/llvm-project.git llvmorg-18-init-18361-g22683463740e) ++ // + auto extract_version = [] (const string& s, bool patch, const char* what) + -> compiler_version + { +@@ -2435,8 +2441,28 @@ namespace build2 + // end of the word position (first space). In fact, we can just + // check if it is >= e. + // +- if (s.find_first_not_of ("1234567890.", b, 11) >= e) ++ size_t p (s.find_first_not_of ("1234567890.", b, 11)); ++ if (p >= e) + break; ++ ++ // Handle the unseparated `rc` and `git` suffixes. ++ // ++ if (p != string::npos) ++ { ++ if (p + 2 == e && (e - b) > 2 && ++ s[p] == 'r' && s[p + 1] == 'c') ++ { ++ e -= 2; ++ break; ++ } ++ ++ if (p + 3 == e && (e - b) > 3 && ++ s[p] == 'g' && s[p + 1] == 'i' && s[p + 2] == 't') ++ { ++ e -= 3; ++ break; ++ } ++ } + } + + if (b == e) +@@ -2472,8 +2498,15 @@ namespace build2 + ver.patch = next ("patch", patch); + + if (e != s.size ()) +- ver.build.assign (s, e + 1, string::npos); ++ { ++ // Skip the separator (it could also be unseparated `rc` or `git`). ++ // ++ if (s[e] == ' ' || s[e] == '-') ++ e++; + ++ ver.build.assign (s, e, string::npos); ++ } ++ + return ver; + }; + +@@ -2496,7 +2529,10 @@ namespace build2 + + // Some overrides for testing. + // ++ //string s (xv != nullptr ? *xv : ""); ++ // + //s = "clang version 3.7.0 (tags/RELEASE_370/final)"; ++ //s = "FreeBSD clang version 18.1.0rc (https://github.com/llvm/llvm-project.git llvmorg-18-init-18361-g22683463740e)"; + // + //gr.id.variant = "apple"; + //s = "Apple LLVM version 7.3.0 (clang-703.0.16.1)";