Bug 244781 - Mk/Uses/compiler.mk: Broken after LLVM 10 import
Summary: Mk/Uses/compiler.mk: Broken after LLVM 10 import
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jung-uk Kim
URL:
Keywords: needs-qa, regression
Depends on:
Blocks: 244251
  Show dependency treegraph
 
Reported: 2020-03-12 23:53 UTC by Jung-uk Kim
Modified: 2020-03-16 16:39 UTC (History)
4 users (show)

See Also:
jkim: exp-run?


Attachments
Allow compiler major version > 9 (898 bytes, patch)
2020-03-12 23:53 UTC, Jung-uk Kim
no flags Details | Diff
Allow compiler major version > 9 (1.76 KB, patch)
2020-03-13 16:01 UTC, Jung-uk Kim
no flags Details | Diff
Allow compiler major version > 9 (1.77 KB, patch)
2020-03-13 21:29 UTC, Jung-uk Kim
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jung-uk Kim freebsd_committer freebsd_triage 2020-03-12 23:53:50 UTC
Created attachment 212373 [details]
Allow compiler major version > 9

USES=compiler is broken since LLVM 10 import.  For example, "make -V COMPILER_VERSION" gives nothing.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2020-03-13 07:01:02 UTC
Mk/Uses/objc.mk has to be patched too
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2020-03-13 08:17:39 UTC
The diff looks good to me, it's basically the same as what mhorne did in base r352033 for bsd.compiler.mk, and what I did in base r357661 for lld.
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2020-03-13 16:01:45 UTC
Created attachment 212385 [details]
Allow compiler major version > 9

Add a patch for objc.mk.
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2020-03-13 16:18:24 UTC
Approved by portmgr
Comment 5 commit-hook freebsd_committer freebsd_triage 2020-03-13 16:42:04 UTC
A commit references this bug:

Author: jkim
Date: Fri Mar 13 16:41:54 UTC 2020
New revision: 528363
URL: https://svnweb.freebsd.org/changeset/ports/528363

Log:
  Support compiler version >= 10.

  PR:		244781
  Approved by:	portmgr (antoine)

Changes:
  head/Mk/Uses/compiler.mk
  head/Mk/Uses/objc.mk
Comment 6 jinxiaoyong 2020-03-13 18:24:50 UTC
With the new commit to compiler.mk, I'm getting

$ make -V COMPILER_VERSION
801 801)
$ clang --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin

So every ports that compares COMPILER_VERSION would treat it as a string and error out.

I made a simple change to fix this

$ svnlite diff
Index: compiler.mk
===================================================================
--- compiler.mk (revision 528366)
+++ compiler.mk (working copy)
@@ -79,7 +79,7 @@
 _CCVERSION_${_CC_hash}=        ${_CCVERSION}
 PORTS_ENV_VARS+=       _CCVERSION_${_CC_hash}
 .endif
-COMPILER_VERSION=      ${_CCVERSION:M[0-9]*.[0-9]*:tW:C/([0-9]+)\.([0-9])\.*/\1\2/g}
+COMPILER_VERSION=      ${_CCVERSION:M[0-9]*.[0-9]*:tW:C/([0-9]+)\.([0-9]).*/\1\2/g}
 .if ${_CCVERSION:Mclang}
 COMPILER_TYPE= clang
 .else
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2020-03-13 19:52:04 UTC
Re-open,  this was reverted because this breaks on versions < 10
Comment 8 Jung-uk Kim freebsd_committer freebsd_triage 2020-03-13 21:29:16 UTC
Created attachment 212390 [details]
Allow compiler major version > 9

Please try this.
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2020-03-13 21:34:09 UTC
Approved by portmgr
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-03-13 21:47:30 UTC
A commit references this bug:

Author: jkim
Date: Fri Mar 13 21:46:35 UTC 2020
New revision: 528379
URL: https://svnweb.freebsd.org/changeset/ports/528379

Log:
  Support compiler version >= 10 (again).

  PR:		244781
  Approved by:	portmgr (antoine)

Changes:
  head/Mk/Uses/compiler.mk
  head/Mk/Uses/objc.mk