Skip to content

Revert the style2str change in b547ead #8721

Open

Description

@phadej

The commit b547ead introduced change to style2str. I think it's wrong. Or at least I'd want to see a lot better justification for it then just changing inside unrelated patch.

In particular, there are no tests. As a maintainer of cabal-plan I want to understand the change, but I don't. So please revert it, and do it properly if there is justification.

Activity

  1. jneira commented on Feb 1, 2023

    @jneira
    Member

    Just in case, from the commit message:

    Additionally, adjust the ‘style’ attribute in plan.json so that globally
    installed packages are designated as global even if they are local to the
    project. (Without this adjustment to ‘style2str’, the T5782Diamond test fails,
    because it looks up ‘dist-dirs’ in plan.json, where ‘dist-dirs’ is absent from
    the JSON.)

    But there is no specific tests about that change (but it did not broke any prior test so the previous behaviour was not tested either?)

  2. Mikolaj commented on Feb 1, 2023

    @Mikolaj
    Member

    @jneira: yes, it seems it wasn't tested. Which just proves you right when you go around pestering everybody to add their tests to their PRs. :D

  3. phadej commented on Feb 1, 2023

    @phadej
    CollaboratorAuthor

    But there is no specific tests about that change (but it did not broke any prior test so the previous behaviour was not tested either?)

    There kind of was. The beef of b547ead broke T5782Diamond test. So instead of thinking that changing what local package means is maybe not the right way, the author made another somewhat unrelated change elsewhere.

    It isn't a direct test about what plan.jsons local (note: this local is different from local in LocalTarball, local tarballs maybe global or inplace - but they are not local - confusing isn't it), inplace and global means, but I explain my best understanding in #8722 (comment). The b547ead introduced the fourth combination in ElabConfiguredPackage flags , which I think shouldn't ever happen, as it doesn't make sense to me. OTOH, it's not prevented by the types, so it probably happen occasionally.

    I'd go and try to change the two booleans into a type with only three values (provide selectors with old names for compat), and see what other changes need to be done. But it's not a few hour experiment, so I won't have time to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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