Bug 218475 - sysutils/fusefs-lkl depends on gcc binary, ignores CC setting
Summary: sysutils/fusefs-lkl depends on gcc binary, ignores CC setting
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Conrad Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-08 07:07 UTC by Gerald Pfeifer
Modified: 2017-07-14 23:22 UTC (History)
5 users (show)

See Also:


Attachments
Suggested patch (507 bytes, patch)
2017-04-30 07:53 UTC, Gerald Pfeifer
cem: maintainer-approval+
Details | Diff
Set CC and HOSTCC variables to avoid depending on lang/gcc port (710 bytes, patch)
2017-06-05 08:09 UTC, Ting-Wei Lan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-08 07:07:50 UTC
Testing a patch to align the lang/gcc* ports with other languages
and default to lang/gcc5 (instead of lang/gcc as it currently is)
it appears sysutils/fusefs-lkl ignores the CXX variable to denote
the C compiler and simply checks for gcc:

http://package18.nyi.freebsd.org/data/110amd64-default-PR218330/2017-04-06_19h28m41s/logs/errors/fusefs-lkl-4.8.493_2.log

If you want to reproduce this, try the simple patch from PR 218330.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2017-04-08 16:09:02 UTC
It can only build with gcc of some version.
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2017-04-08 16:13:27 UTC
The Linux folks assume the compiled is installed as 'gcc'.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-04-08 20:02:36 UTC
(In reply to Conrad Meyer from comment #2)
> The Linux folks assume the compiled is installed as 'gcc'.

The ports tree has a policy of not allowing such assumptions. By closing this one without fix you give bug 218330 a blanket to mark the port BROKEN on landing.

https://www.freebsd.org/doc/en/books/porters-handbook/dads-cc.html
Comment 4 Baptiste Daroussin freebsd_committer freebsd_triage 2017-04-08 20:05:28 UTC
CC is made to allow switching compilers including between only gcc, there is a policy to say ports should respect CC so the framework/maintainer actually decides which compiler to use
Comment 5 Conrad Meyer freebsd_committer freebsd_triage 2017-04-08 20:34:53 UTC
Well, you're welcome to try and change the Linux kernel to use CC if you like.  I would not be surprised if it is hardcoded in several places in the build.
Comment 6 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-08 20:47:59 UTC
This port is already broken today (without the patch from PR 218330)
whenever a user changes GCC_DEFAULT in Mk/bsd.default-versions.mk since
that pulls in lang/gcc49 or lang/gcc6, for example, none of which provides
gcc or g++.

If the port needs those, it needs to depend on lang/gcc explicitly.

Can you help with this, please?
Comment 7 Conrad Meyer freebsd_committer freebsd_triage 2017-04-08 21:08:48 UTC
(In reply to Gerald Pfeifer from comment #6)
> If the port needs those, it needs to depend on lang/gcc explicitly.

It had BUILD_DEPENDS on gcc specifically when originally written, but bdrewery asked me to replace that with USE_GCC:

https://reviews.freebsd.org/D4199?id=10285#inline-28443

It would be easy for a committer to re-add such a dependency.  But I do not have a bit, so it's difficult for me to make these kind of trivial cleanups.  Again: you are welcome to do so.
Comment 8 Conrad Meyer freebsd_committer freebsd_triage 2017-04-13 23:42:46 UTC
As mat@ says, "Note, this is a volunteer project, if you really want something, might be a good idea to provide a patch."
Comment 9 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-30 07:53:22 UTC
Created attachment 182188 [details]
Suggested patch

This brings this port in line with what devel/linux-kernel/Makefile
uses, and depends on lang/gcc directly due to the need to find a gcc
binary (as opposed to honoring CC as ports should).
Comment 10 Conrad Meyer freebsd_committer freebsd_triage 2017-04-30 17:06:03 UTC
Comment on attachment 182188 [details]
Suggested patch

No objection from me.
Comment 11 commit-hook freebsd_committer freebsd_triage 2017-05-01 08:42:35 UTC
A commit references this bug:

Author: gerald
Date: Mon May  1 08:42:19 UTC 2017
New revision: 439860
URL: https://svnweb.freebsd.org/changeset/ports/439860

Log:
  Replace USE_GCC=yes by a strict build dependency on lang/gcc since
  only that guarantees that a binary (or actually symlink) named gcc
  is present which this ports apparently requires.

  USE_GCC=yes allows users to adjust the default version of GCC via
  Mk/bsd.defaults-versions.mk, and with the change coming via PR218330
  lang/gcc5 is going to be used instead of the (nearly identical, for
  now) lang/gcc shortly.

  PR:		218475, 218330
  Approved by:	cem (maintainer)

Changes:
  head/sysutils/fusefs-lkl/Makefile
Comment 12 Gerald Pfeifer freebsd_committer freebsd_triage 2017-05-01 09:41:45 UTC
With this, PR 218330 is not blocked any longer, thank you!

(It's still a problem for a port to ignore CC, so that is something
you may want to raise upstream and/or fix later on, hence I am not
closing this.)
Comment 13 Ting-Wei Lan 2017-06-05 08:09:23 UTC
Created attachment 183234 [details]
Set CC and HOSTCC variables to avoid depending on lang/gcc port
Comment 14 commit-hook freebsd_committer freebsd_triage 2017-07-14 23:20:27 UTC
A commit references this bug:

Author: jbeich
Date: Fri Jul 14 23:19:21 UTC 2017
New revision: 445834
URL: https://svnweb.freebsd.org/changeset/ports/445834

Log:
  sysutils/fusefs-lkl: respect CC

  PR:		218475
  Submitted by:	Ting-Wei Lan
  Approved by:	maintainer timeout (1 month)

Changes:
  head/sysutils/fusefs-lkl/Makefile
Comment 15 Jan Beich freebsd_committer freebsd_triage 2017-07-14 23:21:49 UTC
(In reply to Ting-Wei Lan from comment #13)
Thank you! Landed after confirming it builds fine with lang/gcc5 and lang/gcc6.
Comment 16 commit-hook freebsd_committer freebsd_triage 2017-07-14 23:22:30 UTC
A commit references this bug:

Author: jbeich
Date: Fri Jul 14 23:21:29 UTC 2017
New revision: 445835
URL: https://svnweb.freebsd.org/changeset/ports/445835

Log:
  MFH: r445834

  sysutils/fusefs-lkl: respect CC

  PR:		218475
  Submitted by:	Ting-Wei Lan
  Approved by:	maintainer timeout (1 month)
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q3/
  branches/2017Q3/sysutils/fusefs-lkl/Makefile