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

Add metadata about conditionals to requirements #786

Open
tchoutri opened this issue Nov 12, 2024 — with Linear · 0 comments
Open

Add metadata about conditionals to requirements #786

tchoutri opened this issue Nov 12, 2024 — with Linear · 0 comments
Labels
component:package Package view and data model enhancement New feature or request help wanted Help is needed for this ticket Public

Comments

Copy link
Contributor

tchoutri commented Nov 12, 2024

In binary.cabal:

library
  build-depends: base >= 4.5.0.0 && < 5, bytestring >= 0.10.4, containers, array
  if impl(ghc <= 7.6)
    -- prior to ghc-7.4 generics lived in ghc-prim
    build-depends: ghc-prim

And in the database:

SELECT r0.requirement
     , r0.components
FROM requirements AS r0
WHERE r0.package_component_id = '1b792ece-9da4-ba60-c309-02e1f181f1c6'
ORDER BY r0.components

+-----------------+----------------+
| requirement     | components     |
|-----------------+----------------|
| >=0             | ['array']      |
| >=4.5.0.0 && <5 | ['base']       |
| >=0.10.4        | ['bytestring'] |
| >=0             | ['containers'] |
| >=0             | ['ghc-prim']   |
+-----------------+----------------+

Obviously it would be interesting to know that ghc-prim is only depended on if GHC <= 7.6.

We store this information in the package component today:

SELECT *
FROM package_components AS p0
WHERE p0.release_id = '6ef7f226-c6b0-1a3b-17af-a70017193dff'
{"conditions": [{"tag": "Var", "contents": {"tag": "Impl", "contents": ["ghc", "<=7.6"]}}]

But this is not where this should go.

@tchoutri tchoutri added component:package Package view and data model enhancement New feature or request help wanted Help is needed for this ticket Public labels Nov 12, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:package Package view and data model enhancement New feature or request help wanted Help is needed for this ticket Public
Projects
None yet
Development

No branches or pull requests

1 participant