Bug 233376 - devel/hs-ShellCheck: Provide statically linked binary
Summary: devel/hs-ShellCheck: Provide statically linked binary
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Luca Pizzamiglio
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-11-21 12:28 UTC by Tobias Kortkamp
Modified: 2018-11-22 04:39 UTC (History)
3 users (show)

See Also:
pizzamig: maintainer-feedback+


Attachments
shellcheck.diff (559 bytes, patch)
2018-11-21 12:28 UTC, Tobias Kortkamp
tobik: maintainer-approval? (pizzamig)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer freebsd_triage 2018-11-21 12:28:38 UTC
Created attachment 199412 [details]
shellcheck.diff

Installing hs-ShellCheck on FreBSD currently installs about 2 GiB
worth of dependencies (including GHC!).  This is embarrassing and
hard to explain and justify to users coming from other systems where
shellcheck is generally statically linked to its Haskell dependencies
and takes up about 20-30 MiB of space.  ShellCheck is a simple tool
that shouldn't require having the entire Haskell toolchain installed.

Can we statically link it to the hs-* dependencies on FreeBSD too?
Alternatively, maybe we could create a 'static' flavor or similar.

Poudriere testport on 12.0-RC1/i386 ok.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2018-11-21 12:47:31 UTC
Converting Haskell applications to statically-linked ones is on my TODO list for a long time. The plan is to build them using Stack/Stackage and get rid of all ports for Haskell libraries. However, this is still a TODO item.

For the time being, as @haskell hat, I'd say OK for this patch. Let's hear the maintainer, though.
Comment 2 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-11-21 14:53:02 UTC
Testing.. the build will take a while
Comment 3 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-11-21 20:41:14 UTC
Looks good to me. The final binary is ~17MB, that's 100x smaller than the amount of packages that has to be previously installed

I put in my TODO list to add the OPTION to build it dynamically, but for now, static is the way to go.

Can you commit it?
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-11-22 04:37:56 UTC
A commit references this bug:

Author: tobik
Date: Thu Nov 22 04:36:54 UTC 2018
New revision: 485580
URL: https://svnweb.freebsd.org/changeset/ports/485580

Log:
  devel/hs-ShellCheck: Link Haskell dependencies statically

  ShellCheck is an essential tool that should not require having the
  entire Haskell toolchain installed which most users do not need.

  The installed size (including all run dependencies) goes down from
  ~2 GiB to ~35 MiB.  This brings the hs-ShellCheck package more in
  line with what is provided by various Linux distributions and
  OpenBSD.

  PR:		233376
  Submitted by:	tobik
  Approved by:	pizzamig (maintainer), haskell (arrowd)

Changes:
  head/devel/hs-ShellCheck/Makefile
Comment 5 Tobias Kortkamp freebsd_committer freebsd_triage 2018-11-22 04:39:06 UTC
(In reply to Luca Pizzamiglio from comment #3)
Done. Thank you both for the quick responses!

Let's hope there are no strong objections to it. ;-)