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

Fix haddocks copy bug (#1105) (nearly) #1206

Closed
wants to merge 6 commits into from

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented Oct 20, 2015

Please don't merge this yet!

This is simply to share some ideas on this problem before I go to sleep. :)

At this point, stack does generate haddocks for the dependencies and copies them too.
But now it tends to hit the following problem:

~/s/tasty (master) $ stack haddock
clock-0.5.1: configure
clock-0.5.1: build
clock-0.5.1: haddock
clock-0.5.1: install
tasty-0.11.0.1: configure
tasty-0.11.0.1: build
tasty-0.11.0.1: haddock
tasty-0.11.0.1: install
ProInvalid package identifier: "builtin_rts"
gress: 2⏎  

I'm not sure where in the code this error happens. Are there any tricks to get a line number or a something similar?

Please note that ghc-pkg seems to handle builtin_rts in a rather peculiar way too:

~/src $ ghc-pkg --version 
GHC package manager version 7.8.4
~/src $ stack exec ghc-pkg -- --version
Run from outside a project, using implicit global project config
Using resolver: lts-3.10 from implicit global project's config file: /home/simon/.stack/global/stack.yaml
GHC package manager version 7.10.2

~/src $ ghc-pkg field base depends
depends: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37
         integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 builtin_rts
~/src $ stack exec ghc-pkg -- field base depends
Run from outside a project, using implicit global project config
Using resolver: lts-3.10 from implicit global project's config file: /home/simon/.stack/global/stack.yaml
depends:
    builtin_rts ghc-prim-0.4.0.0-af16264bc80979d06e37ac63e3ba9a21
    integer-gmp-1.0.0.0-8e0f14d0262184533b417ca1f8b44482

~/src $ ghc-pkg field builtin_rts id
ghc-pkg: cannot parse 'builtin_rts' as a package identifier
~/src $ stack exec ghc-pkg -- field builtin_rts id
Run from outside a project, using implicit global project config
Using resolver: lts-3.10 from implicit global project's config file: /home/simon/.stack/global/stack.yaml
ghc-pkg: cannot parse 'builtin_rts' as a package identifier

Note the strange alignment when asking for the dependencies of base.

(Referencing #1105)

@@ -116,16 +115,16 @@ findGhcPkgField
=> EnvOverride
-> WhichCompiler
-> [Path Abs Dir] -- ^ package databases
-> String -- ^ package identifier, or GhcPkgId
-> PackageName
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug 1, I believe. ghc-pkg doesn't accept full ghc-pkg ids:

~/src $ ghc-pkg field containers depends
depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b
         base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1
         deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02
         ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37
~/src $ ghc-pkg field base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 name
ghc-pkg: cannot find package base-4.7.0.2

@borsboom
Copy link
Contributor

I'm actually right in the middle of a major refactor of related code (basically, most of Stack.GhcPkg will be going away) as a first step toward #1105. At this point I'm not sure whether the changes in this PR will still be relevant once that's done, so I hope your time hasn't been wasted.

@sjakobi
Copy link
Member Author

sjakobi commented Oct 21, 2015

No worries, it was a lot of fun! I'm looking forward to your refactor!

@sjakobi sjakobi closed this Oct 21, 2015
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

Successfully merging this pull request may close these issues.

2 participants