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

Dynamically-linked Stack binaries for Termux and other non-FHS compliant environments #6345

Closed
dhuux opened this issue Nov 23, 2023 · 6 comments

Comments

@dhuux
Copy link

dhuux commented Nov 23, 2023

i used ghcup to download cabal and stack on Termux. cabal and ghcup can do network stuff with the patched glibc for Termux since they are dynamically linked. but the stack binary is statically linked so it can't resolve DNS names because /etc/resolv.conf doesn't exist without proot in Termux.

it would be nice if we had dynamically linked Linux AArch64 binaries also.

Screenshot_20231123-193420_Termux

@philderbeast
Copy link
Contributor

I'm looking for this option too. I see that Cabal has executable-dynamic and this is used in the clash-compiler/cabal.project, a project that I'm trying to build with stack.

package clash-benchmark
  executable-dynamic: True

@philderbeast
Copy link
Contributor

@dhuux it is possible to build stack from source with cabal.

@dhuux
Copy link
Author

dhuux commented Nov 28, 2023

how? did you used it like this --enable-executable-dynamic. i have just started my programming journey with Termux. i'm not used to building programs. hhh

@mpilgrem
Copy link
Member

@dhuux, I am not a user of Cabal (the tool) or a Linux user, but if you have a working version of GHC 9.4.7 on your system, I think you can build Stack from source with Cabal (the tool) as follows:

  1. Download the Stack project's source code from GitHub and change to the project's root directory.
  2. Command cabal update to update the latest package list from Hackage.
  3. Command cabal build --with-compiler <path_to_ghc_9.4.7_executable_file>. This will take a little while to complete, because there are about 176 direct and indirect dependencies and then 183 modules, but not so very long. The last step should tell you where Cabal has put the Stack executable. It can be moved anywhere.

@mpilgrem mpilgrem changed the title we need dynamically linked banaries for non FHS compaliant environments like Termux. Dynamically-linked Stack binaries for Termux and other non-FHS compliant environments Nov 30, 2023
@mpilgrem
Copy link
Member

Stack's current release process has its origins in the discussion at #2534. There are no plans to provide dynamically-linked binary distributions from this repository, but if other parts of the Haskell community wish to support what you are looking for, we would try to support them in their support.

@dhuux
Copy link
Author

dhuux commented Dec 1, 2023

@mpilgrem thanks.

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

3 participants