Skip to content

Haskell source pre-processing in Haskell no longer works #1541

Closed
@ygale

Description

@ygale

The standard technique for pre-processing Haskell source code using Haskell has stopped working in recent versions of Cabal. The technique is as follows:

The cabal file is structured like this:

Name: foo
...
Executable foo-meta
  ...
Library
  ...
Executable foo
  ...

Then you pass "-F -pgmF dist/build/foo/foo-meta" to GHC for the source file you want to pre-process, e.g., using an OPTIONS_GHC pragma.

The effect is that first cabal builds foo-meta, then uses it to build the library, then builds the final executable.

But now, Cabal refuses to build the artifacts in the order I specified in the Cabal file. It always tries to build the library first, before the foo-meta executable, and the build fails.

Note: We have only tried this so far inside a sandbox. However, we have verified that the problem is definitely that cabal is not even trying to build foo-meta, not a problem with differences in the path to the foo-meta executable in a sandbox.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions