Bug 241031 - mail/fetchmail: fails to build on FreeBSD 11.2 on MIPS64 (Mk/Uses/compiler.mk defect)
Summary: mail/fetchmail: fails to build on FreeBSD 11.2 on MIPS64 (Mk/Uses/compiler.mk...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: mips Any
: --- Affects Only Me
Assignee: Matthias Andree
Depends on: 240822
  Show dependency treegraph
Reported: 2019-10-03 09:12 UTC by Matthias Andree
Modified: 2019-10-03 13:50 UTC (History)
4 users (show)

See Also:

zstd-compressed poudriere log of fetchmail 6.4.1 build when "compiler:c11" is DELETED from USES=. (10.58 KB, application/octet-stream)
2019-10-03 09:13 UTC, Matthias Andree
no flags Details
try to limit compiler:c11 to powerpc* (768 bytes, patch)
2019-10-03 13:01 UTC, Matthias Andree
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Andree freebsd_committer 2019-10-03 09:12:07 UTC
mail/fetchmail currently specified USES=compiler:c11. 

This breaks poudriere on MIPS64 due to compiler.mk choosing GCC without adding it to BUILD_DEPENDS.

Unfortunately, this compiler.mk-related issue was masked by a pkg bug (240822) where pkg 1.12 failed to build on MIPS, which was only recently fixed (after 2019Q4 branched).

Corey, for fetchmail, we can sidestep the issue by removing the compiler:c11 option from the USES= line. The basis fetchmail 6.4.1 code is C89, and files/patch-ZZZ-87626c2707cc0d82e49e160ab3c85430ff33534f requires C99 for the long long type (strictly speaking). C11 is not necessary.

Corey, do we know that the base compiler miscompiles fetchmail on either architecture? If not, I propose this patch:

-USES=          compiler:c11 cpe gmake tar:xz ssl
+USES=          cpe gmake tar:xz ssl
Comment 1 Matthias Andree freebsd_committer 2019-10-03 09:13:05 UTC
Created attachment 208048 [details]
zstd-compressed poudriere log of fetchmail 6.4.1 build when "compiler:c11" is DELETED from USES=.
Comment 2 Piotr Kubaj freebsd_committer 2019-10-03 12:07:51 UTC
As specified in the commit message that added USES=compiler:c11, using base GCC breaks one test on powerpc64, that's why I switched to GCC9.

If you want to use base GCC on mips64, can you instead add USES=compiler:c11 only on powerpc64?
Comment 3 Matthias Andree freebsd_committer 2019-10-03 12:43:57 UTC
I guess we could but basically do that, but I'd propose, generally speaking, that we avoid pushing architecture/CPU-specific patches down into individual ports because that does not scale well and is of limited benefit: it helps only that one port. If we instead make the framework choose working compilers...

I know my share from graphics/rawtherapee (which sheds some light on other corners of our toolchain).

Basic point is, base cc should be fixed on powerpc64.

Piotr, can you share the detailed test suite log from powerpc64? Upload to freefall, some web site, compress and attach, ...
Comment 4 Matthias Andree freebsd_committer 2019-10-03 13:01:34 UTC
Created attachment 208051 [details]
try to limit compiler:c11 to powerpc*

Piotr, please see if this patch helps on powerpc so we can unbreak MIPS (or update the patch and upload your version), and please provide the test-suite.log of the failed powerpc build.
Comment 5 Piotr Kubaj freebsd_committer 2019-10-03 13:24:08 UTC
(In reply to Matthias Andree from comment #4)
Thanks, IMO this patch is ok, but requires two corrections.

.if !empty(${ARCH:Mpowerpc*}) doesn't seem to work (base GCC is chosen), but
.if ${ARCH:Mpowerpc*}
does work.

Also, powerpc* switches to LLVM as soon as LLVM9 is merged to head, so could you check do the following instead:
.if ${ARCH:Mpowerpc*} && ${OSREL:R} < 13

This will still not fix fetchmail on powerpc* on head for some days, but we switch soon anyway.
Comment 6 commit-hook freebsd_committer 2019-10-03 13:46:33 UTC
A commit references this bug:

Author: mandree
Date: Thu Oct  3 13:46:23 UTC 2019
New revision: 513664
URL: https://svnweb.freebsd.org/changeset/ports/513664

  Limit USES+=compiler:c11 to powerpc* and FreeBSD < 13.

  MIPS regressed in r513614 because it does not have a C11
  compiler. Fetchmail 6.4.1 is C89 code, one patch we provide
  makes it C99 (it requires the long long int type).

  The base compiler on powerpc 11/12 does not yield an executable,
  but MIPS on the other hand does not offer a C11 compiler,
  so for now, revert anything but powerpc before FreeBSD 13
  to use its base compiler.  FreeBSD 13 is exempt and also uses
  the base compiler, because the ARCH guys intend to merge LLVM 9

  PR:		241031
  Reviewed by:	pkubaj@
  Approved by:	blanket (fix recent regression from r513614)

Comment 7 Matthias Andree freebsd_committer 2019-10-03 13:49:45 UTC
Piotr, your 2nd suggestion passes build tests and "make check" for me on:

JAILNAME  VERSION              ARCH          METHOD       TIMESTAMP          
112arm64  11.2-RELEASE 1102000 arm64.aarch64 src=/usr/src 2018-07-07 18:32:03
112mips64 11.2-RELEASE 1102000 mips.mips64   src=/usr/src 2018-07-07 22:01:57
112i386   11.2-RELEASE-p10     i386          ftp          2019-06-20 21:04:56
113amd64  11.3-RELEASE-p3      amd64         ftp          2019-09-28 23:14:28
120i386   12.0-RELEASE-p10     i386          ftp          2019-09-29 14:22:55
120amd64  12.0-RELEASE-p6      amd64         ftp          2019-06-20 21:02:52