Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

HsColour on GHC.Prim fails #6

Closed
bgamari opened this issue Dec 20, 2015 · 7 comments
Closed

HsColour on GHC.Prim fails #6

bgamari opened this issue Dec 20, 2015 · 7 comments
Assignees

Comments

@bgamari
Copy link
Collaborator

bgamari commented Dec 20, 2015

I just encountered this while building master,

/--------
| Running GhcCabalHsColour with arguments:
|   hscolour
|   libraries/ghc-prim
|   dist-install
\--------
Running hscolour for ghc-prim-0.5.0.0...
Preprocessing library ghc-prim-0.5.0.0...
ghc-cabal: can't find source for GHC/Prim in ., dist-install/build/autogen
Error when running Shake build system:
* libraries/ghc-prim/dist-install/doc/html/ghc-prim/ghc-prim.haddock
user error (Development.Shake.cmd, system command failed
Command: /opt/exp/ghc/ghc/inplace/bin/ghc-cabal hscolour libraries/ghc-prim dist-install
Exit code: 1
Stderr:
ghc-cabal: can't find source for GHC/Prim in ., dist-install/build/autogen
)
@snowleopard
Copy link
Owner

I tried to reproduce this on my Windows machine but ghc-cabal hscolour libraries/ghc-prim dist-install was successful, as well as all other invocations of GhcCabalHsColour builder.

I've pushed a small related fix to deal with absolute paths on Windows: 30d3d63. Currently configure sets the following path in system.config: hscolour = /c/Users/[...] which I replaced with C:/Users/[...] to be able to run hscolour. Maybe there is a better way to deal with this.

@bgamari
Copy link
Collaborator Author

bgamari commented Dec 20, 2015

I can say that Prim.hs certainly does not exist where I would have expected it,

$ shake-build/build.sh
...
/--------
| Running GhcCabalHsColour with arguments:
|   hscolour
|   libraries/ghc-prim
|   dist-install
\--------
Running hscolour for ghc-prim-0.5.0.0...
Preprocessing library ghc-prim-0.5.0.0...
ghc-cabal: can't find source for GHC/Prim in ., dist-install/build/autogen
Error when running Shake build system:
* libraries/ghc-prim/dist-install/doc/html/ghc-prim/ghc-prim.haddock
user error (Development.Shake.cmd, system command failed
Command: /opt/exp/ghc/ghc/inplace/bin/ghc-cabal hscolour libraries/ghc-prim dist-install
Exit code: 1
Stderr:
ghc-cabal: can't find source for GHC/Prim in ., dist-install/build/autogen
)

$ ls libraries/ghc-prim/dist-install/build/autogen/
cabal_macros.h  Paths_ghc_prim.hs

bgamari added a commit to bgamari/hadrian that referenced this issue Dec 20, 2015
HsColour also depends upon the sources existing. Fixes snowleopard#6.
@bgamari bgamari mentioned this issue Dec 20, 2015
@snowleopard
Copy link
Owner

Ah, that's true. I can now reproduce this. We need to add a dependency on autogen/GHC/Prim.hs (this file is generated by a rule in Rules/Generate.hs).

If you amend you pull request #8 I'll fix this using your partial solution (otherwise we'll have merge conflicts).

@snowleopard snowleopard self-assigned this Dec 20, 2015
@snowleopard snowleopard reopened this Dec 20, 2015
@snowleopard
Copy link
Owner

Not sure why this got closed automatically when merging #8...

@bgamari
Copy link
Collaborator Author

bgamari commented Dec 20, 2015

What is the status of this?

My impression was that 8e8cc53 is the correct solution here. HsColour depends upon the source. Settings.getPackagesSources should already handle the addition of autogen/GHC/Prim.hs.

@snowleopard
Copy link
Owner

Sorry, full rebuild takes a huge time on my machine (I need to find out why).

I think you are right and 8e8cc53 should be enough but I'd like to double check before closing this.

@snowleopard
Copy link
Owner

OK, I've tested this and I think we can close this now.

A minor relevant fix: 0c9d7d8.

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

No branches or pull requests

2 participants