Bug 218482 - devel/stack has problematic dependency on lang/gcc
Summary: devel/stack has problematic dependency on lang/gcc
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: Tobias Kortkamp
URL: https://reviews.freebsd.org/D10459
Keywords:
Depends on:
Blocks: 218330
  Show dependency treegraph
 
Reported: 2017-04-08 12:14 UTC by Gerald Pfeifer
Modified: 2017-04-28 13:09 UTC (History)
1 user (show)

See Also:


Attachments
Straightforward patch (422 bytes, patch)
2017-04-08 12:14 UTC, Gerald Pfeifer
gerald: maintainer-approval?
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 12:14:10 UTC
Created attachment 181588 [details]
Straightforward patch

ghc, which devel/stack depends on, pulls in GCC via USE_GCC=yes.

devel/stack itself also has a dependency of
  ${LOCALBASE}/bin/gcc:lang/gcc
  
So, when/if USE_GCC=yes implies a different one of the lang/gcc* ports
(which will happen after PR 218330 or when the user sets a different
version of GCC via Mk/bsd.default-versions.mk), devel/stacks pulls in
two conflicting ports - lang/gcc and lang/gcc5 - in the first case, or
pulls in the wrong port for its own dependency.

See http://package18.nyi.freebsd.org/data/110amd64-default-PR218330/2017-04-06_19h28m41s/logs/errors/stack-1.4.0.log
for an example (with the patch from PR 218330 applied).

The most straightforward patch would be the one I am attaching here.
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2017-04-08 23:23:19 UTC
I added the dependency because some Haskell packages by default assume
that "gcc" is available in the PATH.  Something that AFAICT
USE_GCC=yes does not guarantee.

For example 'stack install idris' will fail if "gcc" is not in the
PATH:

    gmake: Entering directory '/tmp/stack61184/idris-1.0/rts'
    gmake: gcc: Command not found
    ldd: illegal option -- -
    usage: ldd [-a] [-v] [-f format] program ...
    gcc -O2 -Wall -DHAS_PTHREAD -DIDRIS_ENABLE_STATS  -I/usr/local/include  -DIDRIS_TARGET_OS="\"unix\"" -DIDRIS_TARGET_TRIPLE="\"\"" -fPIC   -c -o idris_rts.o idris_rts.c
    /bin/sh: gcc: not found

In the case of Idris this can be solved with 'env CC=clang stack
install idris'.

Since not all Haskell applications/libraries require gcc or
workarounds like this, I think I'd prefer removing the forced gcc run
dependency instead.
Comment 2 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-22 09:05:54 UTC
(In reply to Tobias Kortkamp from comment #1)
> Since not all Haskell applications/libraries require gcc or
> workarounds like this, I think I'd prefer removing the forced gcc run
> dependency instead.

From the lang/gcc* ports perspective that certainly would be even
easier.

Are you going to make this change?

(This is one of the two last issues blocking PR 218330 ;-), so any
help is appreciated.)
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-04-28 13:08:26 UTC
A commit references this bug:

Author: tobik
Date: Fri Apr 28 13:08:04 UTC 2017
New revision: 439606
URL: https://svnweb.freebsd.org/changeset/ports/439606

Log:
  Remove gcc run dependency

  - ghc uses USE_GCC=yes and when USE_GCC=yes implies a different one of
    the lang/gcc* ports (which will happen after PR 218330 or when the
    user sets a different version of GCC via Mk/bsd.default-versions.mk),
    devel/stacks pulls in two conflicting ports - lang/gcc and lang/gcc5 -
    in the first case, or pulls in the wrong port for its own dependency.

  - Some Haskell libraries/programs require gcc in the PATH, but not all
    do; the port should not have a gcc dependency for this reason alone.

  PR:		218482
  Reported by:	gerald
  Approved by:	lme (mentor)
  Differential Revision:	https://reviews.freebsd.org/D10459

Changes:
  head/devel/stack/Makefile
Comment 4 Tobias Kortkamp freebsd_committer freebsd_triage 2017-04-28 13:09:34 UTC
Fixed. Sorry that it took so long.