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

release binary #6

Open
unhammer opened this issue Jan 28, 2023 · 8 comments
Open

release binary #6

unhammer opened this issue Jan 28, 2023 · 8 comments

Comments

@unhammer
Copy link

unhammer commented Jan 28, 2023

This program could be useful for people who don't have the right haskell toolchain installed. It would make sense to put precompiled binaries in the Github release for those people (also haskellers who don't feel like waiting for the compilation).

It's possible to do it as github actions: https://vrom911.github.io/blog/github-actions-releases

@y-taka-23
Copy link
Owner

Thanks for your feedback! It sounds nice, and I'm also interested in why you require the precompiled binary. Perhaps the potential users of the tool have a development environment for Haskell. Did you have any troubles with the build? Or just because the build process is boring?

@unhammer
Copy link
Author

unhammer commented Jan 28, 2023

Oh I don't require it, just a suggestion :) I do have a Haskell dev env myself, but even so it's a rather high barrier of entry for a program that I is more of a "nice to have" than "need to have". For my own part, I prefer using nix with Haskell to avoid compiling so many dependencies, but then I needed to copy and modify a default.nix from one of my own projects (since I can't remember all the nixlang intricacies) and disable tests ( uncaught exception: NoHackageTarballFound probably because of nix). I'm guessing most people without GHC 8.10 installed will not bother with investigating how to get a dev env up ("First step: do you want ghcup+cabal, or stack, or nix? Read these blog posts arguing the merits of each").

@y-taka-23
Copy link
Owner

Okay, I got it. I will try it by GitHub Actions, manual, or anything else.

@y-taka-23
Copy link
Owner

@unhammer What do you think about releasing the tool not as a naked binary but as a container? To distribute binary executables, I need to tie the dependencies statically for each environment but;

  • On osX, gcc cannot link all libraries statically (e.g. ld: library not found for -lcrt0.o)
  • I don't have a Windows environment, thus I cannot test the binaries

@unhammer
Copy link
Author

unhammer commented Jan 29, 2023

A release.yml like unhammer/bin-your-stars@f65c7e7 (based on the one from stan) along with RW Workflow permissions gives Linux and macos binaries at least, looking like https://github.com/unhammer/bin-your-stars/releases/tag/v1.0.11
(For some reason cabal fails to figure out the deps on Windows? cf. bottom of this log.)

But yes, they're not statically linked (I've not looked into how to do that). Containers sounds a bit overkill to me, but if the osx dynamic binaries can't be distributed maybe it's the best option …

@y-taka-23
Copy link
Owner

@unhammer

Containers sound a bit overkill to me

Hmm, I'm afraid so, too. But anyway, I tried to build an image.
Could you taste it by the following command?

https://github.com/y-taka-23/thank-you-stars/pkgs/container/thank-you-stars

docker run \
  -v $PWD:/home/nonroot/project \
  -v $HOME/.thank-you-stars.json:/home/nonroot/.thank-you-stars.json \
  -v $HOME/.cabal:/home/nonroot/.cabal \
  ghcr.io/y-taka-23/thank-you-stars:latest

@y-taka-23
Copy link
Owner

@unhammer ping; If you are okay, I will document it on README.md and refine the CI. :)

@unhammer
Copy link
Author

unhammer commented Feb 18, 2023

Sorry, big inbox here :) That docker command does work on my end, yes!

Btw if you're editing README anyway, I had to cp ~/.stack/pantry/hackage/00-index.tar ~/.cabal/packages/hackage.haskell.org/00-index.tar since I guess stack stores its own version; got NoHackageTarballFound otherwise.

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

No branches or pull requests

2 participants