Skip to content

Generated GenericPackageDescription is not strictly equal to cabal one #130

Open
@jneira

Description

@jneira

Hi, in the process of integrate dhall with etlas (a cabal fork suited for eta), we've found that the GenericPackageDescription generated by dhall-to-cabal is not equal to the generated by cabal itself using parseGenericPackageDescription.
Although it is similar enough to generate the same output using showGenericPackageDescription (to be fair, the main goal of the package), i am afraid that you cant use it directly against the cabal api.
I've setup a branch adding a strict comparation to analyze the changes between them:

  • options, profOptions, sharedOptions, staticOptions are an empty list in cabal and a list of (Compiler,[]) in dhall-to-cabal: i guess this probably would be not a problem but most cases fail with it
  • In projects with executables cabal has a CondNode {condTreeData = Executable {exeName = UnqualComponentName "dhall-to-cabal" and dhall-to-cabal CondNode {condTreeData = Executable {exeName = UnqualComponentName "". Likely it could cause problems using against the api.
  • In projects with dependencies cabal has condTreeConstraints filled for each component and dhall-to-cabal empty: this one caused the first (and unique for now) error when trying to use it against cabal api
  • In dhall-to-cabal.dhall there is a diff in the license: licenseRaw = Left (License (ELicense (ELicenseId MIT) Nothing)) for cabal and licenseRaw = Right MIT for dhall-to-cabal

I think some sort of strict comparation can be useful to detect and analyze possible bugs. I will open a pr to discuss the relevance of and possible changes over the strict tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions