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

Build issues #42

Open
jberryman opened this issue Sep 15, 2020 · 1 comment
Open

Build issues #42

jberryman opened this issue Sep 15, 2020 · 1 comment

Comments

@jberryman
Copy link
Contributor

(I'm poking at this as part of the Hasura collaboration, hoping to experiment with frontends)

I've built the referenced ghc branch, but when i try to do:

cabal build all -w $(readlink -f ../ghc-for-ghc-debug/inplace/bin/ghc-stage2)

I'm getting a lot of errors like:

cbits/stub.cpp:76:46: error:
     error: ‘Task’ has not been declared
     void stopAllCapabilities (Capability **pCap, Task *task);
                                                  ^~~~
   |
76 | void stopAllCapabilities (Capability **pCap, Task *task);
   |                                              ^

cbits/stub.cpp:77:58: error:
     error: ‘Task’ has not been declared
     void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task);
                                                              ^~~~
   |
77 | void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task);
   |                                                          ^

cbits/stub.cpp:176:8: error:
     error: ‘RtsPaused’ does not name a type
     static RtsPaused r_paused;
            ^~~~~~~~~
    |
176 | static RtsPaused r_paused;
    |        ^
cbits/stub.cpp: In function ‘void pause_mutator()’:

cbits/stub.cpp:183:3: error:
     error: ‘r_paused’ was not declared in this scope
       r_paused = rts_pause();
       ^~~~~~~~
    |
183 |   r_paused = rts_pause();
    |   ^

I tried fiddling with include dirs but wasn't making much progress.

@DavidEichmann
Copy link
Contributor

DavidEichmann commented Sep 16, 2020

Things are q bit of a WIP at the moment. ghc-debug support isn't even in ghc head yet (it's still an MR). My advice right now is:

  • Start with supersven's branch of ghc-debug https://github.com/supersven/ghc-debug/tree/more_StgTSO_fields (as of writing: commit e52928b)
    • Make sure to run git submodule update --init to get the dwarf and dwarfadt submodules.
  • In cabal.project in the packages section, remove /home/sven/src/head.hackage/packages/io-streams-1.5.1.0 and remove the duplicate test.
  • Copy and paste all of https://ghc.gitlab.haskell.org/head.hackage/cabal.constraints into the end of cabal.project
  • Open a nix shell with nix-shell ./simple-shell.nix (are you familiar with nix?). This should download a version of ghc with ghc-debug support.
  • Fetch the head.hackage package list with cabal new-update
  • Then you should be able to build with cabal new-build all

I see you've build your own ghc locally. With the nix shell you shouldn't need to do that. If you still want to use your locally build ghc then I'd recommend using the new-* cabal commands: cabal new-configure --with-compiler=/path/to/local/ghc --with-hs-pkg=/path/to/local/ghc-pkg and cabal new-build all

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