Skip to content

toConfiguredComponent: unix (Windows) #3978

Closed

Description

@alexbiehl

Trying new-build with cabal-install from HEAD on a project of mine:

$ cabal new-build hunt-searchengine

Results in:

$ Resolving dependencies...
$ toConfiguredComponent: unix
$ CallStack (from HasCallStack):
$ error, called at .\Distribution\Backpack\ConfiguredComponent.hs:131:20 in
$ Cabal-1.25.0.0-2vbl2DGycuL3ehQ9RJKv1s:Distribution.Backpack.ConfiguredComponent

I would cabal expect to fail on building unix (since I am on Windows) instead of some internal error.

Activity

  1. changed the title [-]toConfiguredComponent: unix[/-] [+]toConfiguredComponent: unix (Windows)[/+] on Oct 13, 2016
  2. 23Skidoo commented on Oct 13, 2016

    @23Skidoo
    Member

    @ezyang, can you please look into this?

  3. ezyang commented on Oct 13, 2016

    @ezyang
    Contributor

    @alexbiehl Any chance I can get some -v logs? (Or better yet, -v3)

  4. alexbiehl commented on Oct 13, 2016

    @alexbiehl
    MemberAuthor

    Yes of course, I will hand them in tomorrow.

    Edward Z. Yang [email protected] schrieb am Do., 13. Okt. 2016,
    19:50:

    @alexbiehl https://github.com/alexbiehl Any chance I can get some -v
    logs?

    —
    You are receiving this because you were mentioned.

    Reply to this email directly, view it on GitHub
    #3978 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/AByiiUDLDsxXIahKCQG7LM9fy5-3Phfjks5qzm9mgaJpZM4KVnNl
    .

  5. alexbiehl commented on Oct 14, 2016

    @alexbiehl
    MemberAuthor

    cabal new-build hunt-searchengine -v3 with dist-newstyle deleted first:
    https://gist.github.com/alexbiehl/b303b584dcf636b54d2b84392088c20d

    And here the same command as a subsequent run (with a dist-newstyle present). Not sure if needed though.
    https://gist.github.com/alexbiehl/47c2b561de69cf4b0085eb55cbfdc4ba

    I have one question to add:

    Somewhere in the logs it says targets: html-hunter, hunt-client, hunt-crawler, hunt-searchengine, hunt-server, hunt-server-cli. But I only requested to build hunt-searchengine which does not depend on any of the other targets. Is this something weird or is it just listing all available targets?

  6. ezyang commented on Oct 14, 2016

    @ezyang
    Contributor

    new-build will solve for ALL local packages in your project, so that when you decide to build some of the other ones, it doesn't have to resolve.

  7. ezyang commented on Oct 14, 2016

    @ezyang
    Contributor

    If you can, apply this patch and then give me the non-verbose log?

    diff --git a/Cabal/Distribution/Backpack/ConfiguredComponent.hs b/Cabal/Distribution/Backpack/ConfiguredComponent.hs
    index 184b8bb..86cb899 100644
    --- a/Cabal/Distribution/Backpack/ConfiguredComponent.hs
    +++ b/Cabal/Distribution/Backpack/ConfiguredComponent.hs
    @@ -128,7 +128,8 @@ toConfiguredComponent pkg_descr this_cid
         bi = componentBuildInfo component
         find_it :: PackageName -> VersionRange -> (ComponentId, PackageId)
         find_it name reqVer =
    -        fromMaybe (error ("toConfiguredComponent: " ++ display name)) $
    +        fromMaybe (error ("toConfiguredComponent: " ++ display (packageName pkg_descr) ++
    +                            " " ++ display name)) $
                 lookup_name lib_map <|>
                 lookup_name external_lib_map
           where
    
  8. alexbiehl commented on Oct 14, 2016

    @alexbiehl
    MemberAuthor
    $ cabal new-build hunt-searchengine
    Resolving dependencies...
    toConfiguredComponent: hxt-cache unix
    CallStack (from HasCallStack):
    error, called at .\Distribution\Backpack\ConfiguredComponent.hs:131:20 in
    Cabal-1.25.0.0-2vbl2DGycuL3ehQ9RJKv1s:Distribution.Backpack.ConfiguredComponent
    
  9. ezyang commented on Oct 14, 2016

    @ezyang
    Contributor

    So, I guess this is not a direct dependency of hunt-searchengine, but one of the other packages that are local?

  10. alexbiehl commented on Oct 14, 2016

    @alexbiehl
    MemberAuthor

    Yes, right. hxt-cache is the offender here.

  11. 2 remaining items

  12. ezyang commented on Oct 16, 2016

    @ezyang
    Contributor

    OK, the bug seems to be somehow related to buildable. Min repro:

    name: p
    version: 0.1
    build-type: Simple
    cabal-version: >= 1.25
    
    library
        buildable: False
    

    Stick this in a package with a building package (say q), and then run cabal new-build q.

  13. ezyang commented on Oct 16, 2016

    @ezyang
    Contributor

    OK, so here's the problem: when the library of a pckage is marked as non-buildable, new-build does NOT eagerly fail. In 1.24, the error would only happen if you tried to build it, or anything that depended on it:

    cabal: Unknown build target 'lib:p'.
    There is no library component 'p' or component 'lib'.
    

    or

    cabal: No executables, libraries, tests, or benchmarks found. Nothing to do.
    

    I suppose that's reasonable behavior; it lets you build some part of your project even when other parts are non-buildable.

    But when I refactored this code for Backpack, I assumed that I would only ever get plans with packages that depended upon buildable things. Thus the assert failure! The library doesn't exist and never was configured.

    I guess one way we could fix this is to have the solver reject a package if the library is marked as non-buildable (as opposed to executables/tests/etc. May god have mercy on your soul if you have a non-buildable library with a buildable executable.) But maybe this is not so good for you because it means that you can't develop a project if any of the local deps transitively depends on a non-buildable thing. But maybe you didn't care so much about this case?

    By the way, unix also has build-depends: buildable < 0, so you might wonder why the solver didn't fail? Well, that's because when buildable: False we ignore the build-depends. This is desirable for executables but not for libraries.

  14. added a commit that references this issue on Oct 17, 2016
    272b504
  15. dcoutts commented on Oct 18, 2016

    @dcoutts
    Contributor

    @ezyang fyi, I've seen the same error toConfiguredComponent: blah, but I don't think it was the same problem as unix here. Can we add any more detail to this internal error so we can get better info if we hit it again in future.

  16. ezyang commented on Oct 21, 2016

    @ezyang
    Contributor

    @dcoutts Do you have a repro?

  17. added 4 commits that reference this issue on Oct 22, 2016
    b72ee85
    58d194e
    e80207c
    18e8227
  18. phadej commented on May 11, 2018

    @phadej
    Collaborator

    I get this error when

    % cabal new-build -w ghc-7.8.4 --enable-tests all
    Resolving dependencies...
    Error:
        Dependency on unbuildable library from http-client
        In the stanza 'library'
        In the package 'http-client-tls-0.3.5.3'
    

    with servant 0c66b9c0559721ea682cd0d1fa35f403ec075cda

  19. phadej commented on May 11, 2018

    @phadej
    Collaborator

    Now I see the problem: http://hdiff.luite.com/cgit/http-client/diff?id=0.5.12.1&id2=0.5.12

    clicksaver

    +  -- See build failure at https://travis-ci.org/snoyberg/http-client/jobs/359573631
    +  if impl(ghc < 7.10)
    +    buildable: False
    
  20. sebright commented on May 15, 2018

    @sebright
    Collaborator

    I opened an issue for the new type of failure: #5325

  21. added a commit that references this issue on May 19, 2018
    e23fdf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions