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

stack repl stack:lib bytecode compiler can't foreign #5814

Open
philderbeast opened this issue Aug 5, 2022 · 4 comments
Open

stack repl stack:lib bytecode compiler can't foreign #5814

philderbeast opened this issue Aug 5, 2022 · 4 comments

Comments

@philderbeast
Copy link
Contributor

Steps to reproduce

On this very repo:

> stack repl stack:lib
Configuring GHCi with the following packages: stack
GHCi, version 8.10.4: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /Users/pdejoux/.ghci
[  1 of 110] Compiling Network.HTTP.StackClient
[  2 of 110] Compiling Path.Extended
...
[ 80 of 110] Compiling System.Process.Pager
[ 81 of 110] Compiling System.Terminal
Error: bytecode compiler can't handle some foreign calling conventions
  Workaround: use -fobject-code, or compile this module to .o separately.

<no location info>: error:
    Could not load module ‘Stack.Build’
    It is a member of the hidden package ‘stack-2.7.6’.
    You can run ‘:set -package stack’ to expose it.
    (Note: this unloads all the modules in the current scope.)

I tried stack build stack:lib that worked but going back to the above command still fails the same way.

Expected

I'd expect to be able to load stack's lib into the REPL.

Versions

> stack --version
Version 2.7.5, Git revision ba147e6f59b2da75b1beb98b1888cce97f7032b1 x86_64 hpack-0.34.4

> sw_vers
ProductName:	macOS
ProductVersion:	11.6.7
BuildVersion:	20G630

Method of installation

ghcup

@philderbeast philderbeast changed the title stack repl stack:lib bytecode compiler can't handle some foreign calling conventions stack repl stack:lib bytecode compiler can't foreign Aug 5, 2022
@mpilgrem
Copy link
Member

I hope a new binary version of Stack will be available soon on all major operating systems (see #5733). I am using the version of Stack built from the current master branch:

> stack install # In the root of the Stack repository

If you are on macOS, you would want to install that version of Stack with:

$ stack --stack-yaml=stack-macos.yaml install

Using that version of Stack yields for me (at least, on Windows 11):

> stack repl stack:lib
If building Stack on macOS, you are advised to use stack-macos.yaml as the
project-level configuration file, and command:

stack --stack-yaml stack-macos.yaml build

See that configuration file for further information.

Configuring GHCi with the following packages: stack
GHCi, version 9.2.4: https://www.haskell.org/ghc/  :? for help
[  1 of 110] Compiling Network.HTTP.StackClient
...
[110 of 110] Compiling Stack.Ls
Ok, 110 modules loaded.
Loaded GHCi configuration from C:\Users\mike\AppData\Local\Temp\haskell-stack-ghci\ab68c681\ghci-script
ghci>

@mpilgrem
Copy link
Member

@philderbeast, does using a current version of Stack on macOS also solve the problem you identify?

@hasufell
Copy link
Contributor

hasufell commented Dec 9, 2022

Using that version of Stack yields for me (at least, on Windows 11):

I don't think you can reproduce that on windows.

This is very common and not really a stack bug.

See:

So it seems the first version that doesn't have this problem is GHC 9.2.4. On mac you should not use that version though, but 9.2.5.

@felixminom
Copy link

@hasufell thanks, didn't know what was it, but upgrading my stack resolver solved it.

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

4 participants