Opened 4 years ago

Closed 4 years ago

#61263 closed defect (fixed)

Linking errors in multiple haskell ports

Reported by: nickgaya (Nick Gaya) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: essandess (Steve Smith)
Port: hs-alex hs-cabal-install hs-happy hs-hscolour

Description

When upgrading haskell-platform, macports detected linking errors for several ports.

 hs-alex @3.1.3
 hs-cabal-install @1.18.0.5
 hs-happy @1.19.4
 hs-hscolour @1.20.3

Rebuilding with port rev-upgrade failed to fix the errors.

Actually there seem to be two levels of errors.

  • The pre-built ports from packages.macports.org have linking errors
  • Rebuilding each port fails for various reasons (see attached build logs)
    • hs-alex and hs-happy fail during the configure stage due to a Haskell "Variable not in scope" error for rawSystemProgramConf
    • hs-cabal-install fails during the configure stage with a Haskell "Encountered missing or private dependencies" message
    • hs-hscolour fails during the build stage with an iconv linking error

Possibly related: https://github.com/macports/macports-ports/pull/8523

My computer is running macOS 10.13.16 17G14033. I have libiconv @1.16_1 installed.

Attachments (4)

hs-alex.log (8.6 KB) - added by nickgaya (Nick Gaya) 4 years ago.
hs-alex build log
hs-cabal-install.log (10.5 KB) - added by nickgaya (Nick Gaya) 4 years ago.
hs-cabal-install build log
hs-happy.log (8.9 KB) - added by nickgaya (Nick Gaya) 4 years ago.
hs-happy build log
hs-hscolour.log (26.3 KB) - added by nickgaya (Nick Gaya) 4 years ago.
hs-hscolour build log

Download all attachments as: .zip

Change History (19)

Changed 4 years ago by nickgaya (Nick Gaya)

Attachment: hs-alex.log added

hs-alex build log

Changed 4 years ago by nickgaya (Nick Gaya)

Attachment: hs-cabal-install.log added

hs-cabal-install build log

Changed 4 years ago by nickgaya (Nick Gaya)

Attachment: hs-happy.log added

hs-happy build log

Changed 4 years ago by nickgaya (Nick Gaya)

Attachment: hs-hscolour.log added

hs-hscolour build log

comment:1 Changed 4 years ago by essandess (Steve Smith)

The hs-* ports are broken and obsolete and should be deleted.

See https://github.com/macports/macports-ports/pull/5050

comment:2 Changed 4 years ago by nickgaya (Nick Gaya)

Is there a recommended replacement for haskell-platform? I know very little about the Haskell ecosystem.

comment:3 Changed 4 years ago by kencu (Ken)

they appear to have pretty much removed haskell-platform.

I just cabal install XYZ whatever I want to install.

comment:4 in reply to:  2 Changed 4 years ago by essandess (Steve Smith)

Replying to nickgaya:

Is there a recommended replacement for haskell-platform? I know very little about the Haskell ecosystem.

Yes, use stack or cabal. For example, see the ports alex, happy, hscolour, and so forth.

There may be edge case reasons for resurrecting specific Haskell libraries in the Haskell platform to use with ghc, but for the most part this approach is very fragile and difficult to maintain. This is why everyone uses stack and/or cabal.

comment:5 Changed 4 years ago by nickgaya (Nick Gaya)

Looking around haskell.org I found a couple of bits of information.

Based on this, what do you think about changing the haskell-platform port to be a "virtual package" with dependencies on ghc, cabal, and stack? I'm not sure whether having a port that only exists as a collection of dependencies goes against the design philosophy of MacPorts. Another suggestion is for haskell-platform to be a no-op with a notice suggesting that users install the aforementioned three ports. For a point of comparison, see: https://github.com/Homebrew/homebrew-cask/pull/47908

Since the hs-* ports are unsupported/broken, they should definitely get cleaned up too. Has there been any progress on that since https://github.com/macports/macports-ports/pull/5050 was closed in April? I may be able to help with some of the busy-work if someone can advise me on what steps are needed. I haven't been able to find documentation for how port deprecation/deletion works in MacPorts. Maybe the broken ports could be replaced with a placeholder message advising users to use cabal/stack to install Haskell packages instead?

comment:6 Changed 4 years ago by kencu (Ken)

I think haskell-platform is now dead, as you point out (and as I pointed out above you). So just delete it, and any remaining hs-* ports. Not sure exactly what we're waiting for, TBH.

comment:7 Changed 4 years ago by nickgaya (Nick Gaya)

Based on the links, the "Haskell platform" in the sense of "Haskell with batteries included" still exists, but without the globally-installed packages.

comment:8 Changed 4 years ago by kencu (Ken)

As you said (and as I read) the "platform" of installed "ports" no longer exists for current ghc:

However, from 8.8 onwards, the platform has moved to core-only-installers, as the current best practices for managing packages have shifted to "nixlike-sandboxed" rather than global installs.

ghc / stack / cabal are the way to go, as we all keep saying.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:9 Changed 4 years ago by neverpanic (Clemens Lang)

We should just outright delete haskell-platform and all hs-* ports.

The only reason why I haven't done it, is that we need to check which of the ports are still referenced from other Portfiles (hopefully none), and what to do about them.

There's little point in making haskell-platform an alias for a combination of (ghc, cabal, stack), because by definition (see https://www.haskell.org/platform/contents.html), haskell-platform is ghc + a number of tools + a number of libraries. It does not make sense for us to offer a haskell-platform port that does not install this set of tools and libraries (which we wouldn't be doing, if we only added dependencies on cabal and stack).

There's also little point in keeping the ports around and marking them as deleted or obsolete, since as you know, they can currently not be installed, so there can't be any users that still have them installed, and those users on old systems that actually still have a copy would likely rather keep their working copy rather than being upgraded to a notice that says "these files are now all gone".

Help is very welcome in opening a PR that will just delete all hs-* ports.

comment:10 Changed 4 years ago by neverpanic (Clemens Lang)

Deleting haskell-platform and all hs-* ports would currently break hedgewars, hsshellscript, distract and buddha. Suggestions on fixing those (e.g. by using stack) or figuring out whether those ports are no longer relevant and should also be deleted are welcome.

comment:11 Changed 4 years ago by neverpanic (Clemens Lang)

comment:12 Changed 4 years ago by kencu (Ken)

hedgewars does use haskell in a couple of places. I see it's been updated to 1.0.0; perhaps it incorporates the newer ghc build mechanisms now. I'll have to see.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:13 in reply to:  12 Changed 4 years ago by neverpanic (Clemens Lang)

Replying to kencu:

hedgewars does use haskell in a couple of places. I see it's been updated to 1.0.0; perhaps it incorporates the newer ghc build mechanisms now. I'll have to see.

Thanks. I've tried getting it to build with fpc instead of the bundled pascal-to-C converter written in Haskell to just avoid the dependency completely, but after an hour, internal compiler errors of fpc and linking errors with lua, I just had to cut my losses on how much time I invest into this.

comment:14 Changed 4 years ago by neverpanic (Clemens Lang)

In 592c1fbd2e2fef1d483a0f9c0e21ff443b288c8d/macports-ports (master):

haskell-{chunks,hinstaller,parsedate}: Delete

haskell-chunks doesn't configure.
haskell-hinstaller doesn't build.
haskell-parsedate doesn't fetch.

All three ports have not been modified since 2016 and have not been
significantly modified since their original commit in May 2007.

None of the ports have dependencies.

See: #61263

comment:15 Changed 4 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: assignedclosed

In e5c6a53381ccb92fa84a7ee6f422dd6afeacaec7/macports-ports (master):

haskell-platform, hs-*: Delete

It is too complicated to keep up with the development of
haskell-platform in its current state, and while there is technically
nothing wrong with the approach, it has turned out that nobody has the
time to maintain copies of the hundreds of libraries that are required
to provide the full haskell platform as defined at [1].

Fortunately, there is a more modern alternative available in the form of
stack, which works similar to virtualenvs for python. We are now using
stack (in the form of the haskell_stack PortGroup) for all Haskell tools
we are packaging in MacPorts (e.g. darcs, git-annex, pandoc or
shellcheck). It is also the best alternative for our users.

I am not marking haskell-platform or any of the hs-* ports as obsoleted
using the obsolete PortGroup, because these ports have not built
successfully for a while now, and the users that still have successfully
compiled copies of these tools and libraries would likely rather keep
them around than having them replaced by a file telling them that the
ports are obsolete.

This currently breaks the following ports:

  • hedgewars
  • hsshellscript
  • distract
  • buddha

[1]: https://www.haskell.org/platform/contents.html

Closes: #53652
Closes: #60241
Closes: #60359
Closes: #61020
Closes: #61162
Closes: #61218
Closes: #61263

Note: See TracTickets for help on using tickets.