Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD support and installation instructions #1253

Closed
varosi opened this issue Oct 29, 2015 · 29 comments
Closed

FreeBSD support and installation instructions #1253

varosi opened this issue Oct 29, 2015 · 29 comments
Assignees
Milestone

Comments

@varosi
Copy link

varosi commented Oct 29, 2015

It would be great if there is FreeBSD support for stack, too.

@borsboom
Copy link
Contributor

Have you tried it? In theory, Stack should work just fine on FreeBSD.

It wouldn't be hard to start distributing binaries for FreeBSD either, since there are official GHC bindists available. Basically all we'd need is a Vagrantfile in https://github.com/commercialhaskell/stack/tree/master/etc/vagrant that sets up the environment in which a binary gets built. A pull request would be welcome.

We'd also be very open to anyone who wants to contribute Stack packages/ports to FreeBSD. We can provide any help needed, and would also be willing to take over maintenance for new Stack versions once the legwork to get it all set up has been done.

@varosi
Copy link
Author

varosi commented Oct 30, 2015

I'm not much proficient in BSD. I have tried to build it via cabal without Stackage config without success. I should try with Stackage. I'll try with vagrant, too. Thanks!

@borsboom
Copy link
Contributor

This seems to work for building stack on a fresh FreeBSD VM:

sudo pkg install ghc hs-cabal-install ca_root_nss
cabal install ignore -f without-pcre # This won't be needed for stack >0.1.6.0
cabal install stack

This stack seems to work fine using the system-installed GHC.

However, there's an issue that blocks us distributing stack binaries for FreeBSD, which need to support stack setup: the GHC bindist's defaults for ./configure don't seem to work quite right. Here's what I did on another fresh FreeBSD VM with the just the stack executable I built earlier (but no system-installed GHC):

sudo pkg install ca_root_nss compat8x-amd64 gmake perl5 gcc libiconv
stack setup

When you build Haskell code after this, there are a lot of clang: warning: argument unused during compilation warnings. According to the GHC bindist's README:

Although GHC may work with Clang, it is recommended to use GCC from the Ports Collection until the Clang support receives more testing on FreeBSD.

$ env CC=gcc48 ./configure --with-gcc=gcc48 --with-ld=/usr/local/bin/ld --prefix=$PREFIX

I guess we could teach stack setup to pass these arguments to the bindists's configure?

@cmoore
Copy link

cmoore commented Jan 26, 2016

Here are links to the FreeBSD bindists on GHC's download site for 7.10.3. Strangely, they're not in the initial yellow box listing the supported OSs, but the download links are there.

freebsd64:
http://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-x86_64-portbld-freebsd.tar.bz2

(not sure the key for this in the metadata, but this is 32 bit)
http://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-i386-portbld-freebsd.tar.bz2

While I love lts-3.20, it'd be nice to upgrade :)

I'll just send a PR for stackage-content.

commercialhaskell/stackage-content#16

@borsboom
Copy link
Contributor

borsboom commented Feb 4, 2016

Does stack setup actually work with the 7.10.3 FreeBSD bindist? Last time I tried there were problems because the ./configure step needed extra arguments that Stack wasn't providing.

@berdario
Copy link
Contributor

I tried to run stack setup on FreeBSD 10.2-RELEASE-p9 and it failed due to a missing libutils.so.8

Running /tmp/stack-setup13907/ghc-7.10.3/configure --prefix=/home/dario/.stack/programs/x86_64-freebsd/ghc-7.10.3/ in directory /tmp/stack-setup13907/ghc-7.10.3/ exited with ExitFailure 1

checking for path to top of build tree... 
Shared object "libutil.so.8" not found, required by "ghc-pwd"
configure: error: cannot determine current directory

There's a /lib/libutil.so.9 on my system, so I presume that maybe the bindists have been built on an older version of FreeBSD?

(OTOH, using stackage lts 3.22, which sports GHC 7.10.2, and thus using the system's ghc, it seems to work fine)

@cmoore
Copy link

cmoore commented Feb 14, 2016

Yep, I had to install compat8x and compat9x from pkg to get things going on 10.2.

@borsboom

Yes, the metadata for stack has been updated so now stack setup should work like you expect.

@ghost
Copy link

ghost commented Feb 19, 2016

I've built a pkg repository for stack and FreeBSD here: http://stack-pkg.applicative.tech/

Build tools are here in case anyone is interested: https://github.com/applicative-tech/stack-pkg

@borsboom borsboom self-assigned this Feb 20, 2016
@borsboom
Copy link
Contributor

This looks great! If you don't mind, I'd like to look into integrating this with our standard release process and hosting the packages on our S3 bucket. I didn't have a chance to do this for the just-released stack-1.0.4, unfortunately.

@borsboom
Copy link
Contributor

@t6: Also, feel free to make a pull request on the stable branch that adds links to doc/install_and_upgrade.md and doc/README.md so that, until this is integrated, FreeBSD users know to find your work. Just include a note that it's unofficial and may not have the latest version.

@ghost
Copy link

ghost commented Feb 20, 2016

@borsboom: Thanks, just updated the package repository to stack 1.0.4 and have opened a pull request for adding links.

@jungle-boogie
Copy link

Has anyone tried getting this in FreeBSD ports?

@ghost
Copy link

ghost commented Feb 20, 2016

Sure that was my initial plan, but I have given up for now for time reasons and the problems described here: https://github.com/applicative-tech/stack-pkg/blob/master/devel/stack/Makefile#L31-L53

I'm pretty sure that they can be solved though by someone who knows, understands (or wants to invest the time to understand) the ports tree and its Cabal support i.e. bsd.cabal.mk better than me.

@jungle-boogie
Copy link

hi @t6,

yikes, not an easy task.

@afiskon
Copy link

afiskon commented Apr 9, 2016

TWIMC stack works on FreeBSD just fine. Here is simplest way to install it:

sudo pkg install hs-cabal-install
cabal update
cabal install stack

Then copy ~/.cabal/bin/stack somewhere in your $PATH. After that cabal and other Haskell packages are no longer required.

I think these steps could be recommended in the official installation instruction.

@Cipherwraith
Copy link

Replicated and confirmed @afiskon's simple install guide using a clean install of freebsd 10.3.

@nd2s
Copy link

nd2s commented Apr 10, 2016

@afiskon @Cipherwraith You still need compat8x/compat9x for stack's ghc.

@afiskon
Copy link

afiskon commented Apr 10, 2016

@nd2s I don't have these packages and everything seems to work. Could be true for older LTS`es though.

@nd2s
Copy link

nd2s commented Apr 10, 2016

@afiskon I am on FreeBSD 10.3-RELEASE amd64 and needed to install them a few days ago for GHC 7.10.3 (resolvers lts-5.1 and lts-5.11). Got the (already known) Shared object "libutil.so.8" not found, required by "ghc" error.

Just checked again: I definitely need them.

@afiskon
Copy link

afiskon commented Apr 10, 2016

@nd2s oh, I see. I am on FreeBSD 11.0-CURRENT and I got the same error. But I thought the reason for this is that GHC was built for -STABLE or -RELEASE branch. So I just created a symlink to libutils.so and it solved all problems. @Cipherwraith didn't you encounter this error?

@Cipherwraith
Copy link

@afiskon
Yeah I encountered that error also. Sorry forgot to mention it.

@borsboom
Copy link
Contributor

@t6 I'm trying out the packages you're providing on a fresh system, but stack setup didn't work for me. That's because GHC's Makefile requires GNU make, but that's not installed by default on FreeBSD. stack setup will use gmake if it's installed, and indeed if I pkg install gmake everything is fine, so I think gmake should be made a dependency of your package.

@ghost
Copy link

ghost commented May 20, 2016

@borsboom Thanks, I've added a run dependency on gmake. It'll be part of the next package.

@borsboom
Copy link
Contributor

The just-released stack-1.1.2 now includes an official FreeBSD bindist. Instructions to download and install are here: http://docs.haskellstack.org/en/stable/install_and_upgrade/#freebsd

@varosi
Copy link
Author

varosi commented May 21, 2016

Wow! Great!

On 21.05.2016 г., at 1:49, Emanuel Borsboom [email protected] wrote:

The just-released stack-1.1.2 now includes an official FreeBSD bindist. Instructions to download and install are here: http://docs.haskellstack.org/en/stable/install_and_upgrade/#freebsd


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@varosi
Copy link
Author

varosi commented Jun 2, 2016

Instructions on http://docs.haskellstack.org/en/stable/install_and_upgrade/#freebsd have pointing to this issue which is already resolved, i.e. progress finished?

@borsboom
Copy link
Contributor

borsboom commented Jun 2, 2016

I've removed that bit of text. Thanks for letting me know!

@varosi
Copy link
Author

varosi commented Jun 2, 2016

Thanks!

@ghost
Copy link

ghost commented Jul 23, 2016

It's in the ports tree now: https://www.freshports.org/devel/stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants