Skip to content

Fix CI failures because of unused names or importing transitive dependencies #43

@thomashoneyman

Description

@thomashoneyman

A number of our libraries are failing in CI for one of two reasons:

  1. They directly import from a package that isn't explicitly listed as a dependency in their spago.dhall file
  2. They contain unused names in their code (ie. an unused function, or an unused argument, or a destructured value that is never used...)

They need to be fixed by taking actions depending on whether they're failing due to the unused names or the transitive dependencies. If you would like to be included in the CHANGELOG you are free to add an entry under the "Other improvements" section (for example: Ensure all imported packages are in the spago.dhall file (#000 by @___)).

Don't bother updating the bower.json files -- I can take care of this later on!

To fix a library that imports from a transitive dependency:

  1. Follow the instructions Spago includes about installing missing libraries -- this can basically be copy/pasted into a call to spago install. For example, if Spago reports that a library imports from prelude but doesn't list it as a dependency, then you can fix the issue with spago install prelude.
  2. If there are warnings about unused dependencies, then remove the libraries that Spago has identified as unused from the package's spago.dhall file. This has to be done manually -- there is no uninstall command.

To fix a library that has an UnusedName error from the compiler:

  1. If the error is reported on a top-level declaration that is unused and not exported, then remove the declaration. (If it should be exported instead, then it will be caught in code review.)
  2. If the error is about a declaration that is unused, then remove the declaration.
  3. If the error results from destructuring (for example, destructuring a record { a, b } but one or more of the names is unused), then remove the unused names.

When you fix one of these libraries, please include a link to this issue in the pull request so that it automatically shows up on this issue. These libraries need to be fixed:

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