commercialhaskell / commercialhaskell/stack

Stack fails to resolve input from non-standard preprocessor even after listing relevant file under extra-source-files

Open
#3,929 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary

I am using `uuagc` to compile a file `Test.ag` in a [test project](https://gist.github.com/sergv/b39d88500f68987046d06ca1ee54ffd0). I get following warning from stack:

```
Warning: Unable to find a known candidate for the Cabal entry Test, but did find:
* Test.ag If you are using a custom preprocessor for this module with its own file extension, consider adding
the file(s) to your .cabal under extra-source-files.
```

After adding this file under `extra-source-files` entry in the project's cabal file the warning does not disappear.

### Expected

I expected that adding `Test.ag` to the project's cabal file would remove the warning, just like the warning message promises.

### Steps to reproduce

Bulid the https://gist.github.com/sergv/b39d88500f68987046d06ca1ee54ffd0 project with `stack build`

### Actual

```
$ ./stack build

Warning: Unable to find a known candidate for the Cabal entry Test, but did find:
* Test.ag If you are using a custom preprocessor for this module with its own file extension, consider adding
the file(s) to your .cabal under extra-source-files.
uulib-0.9.23: configure
uulib-0.9.23: build
uulib-0.9.23: copy/register
uuagc-cabal-1.1.0.0: configure
uuagc-cabal-1.1.0.0: build
uuagc-cabal-1.1.0.0: copy/register
uuagc-0.9.52.1: configure
uuagc-0.9.52.1: build
uuagc-0.9.52.1: copy/register
stack-bug-report-0.1.0.0: configure (lib)
[1 of 2] Compiling Main ( /tmp/stack-bug-report/Setup.hs, /tmp/stack-bug-report/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim ( /home/sergey/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack-bug-report/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/setup/StackSetupShim.o )
Linking /tmp/stack-bug-report/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/setup/setup ...
Configuring stack-bug-report-0.1.0.0...
stack-bug-report-0.1.0.0: build (lib)
Preprocessing library for stack-bug-report-0.1.0.0..
[UUAGC] processing: Test.ag generating:
.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Test.hs
Building library for stack-bug-report-0.1.0.0..
[1 of 1] Compiling Test ( .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Test.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Test.o )

Warning: Unable to find a known candidate for the Cabal entry Test, but did find:
* Test.ag If you are using a custom preprocessor for this module with its own file extension, consider adding
the file(s) to your .cabal under extra-source-files.
stack-bug-report-0.1.0.0: copy/register
Installing library in /tmp/stack-bug-report/.stack-work/install/x86_64-linux/lts-11.0/8.2.2/lib/x86_64-linux-ghc-8.2.2/stack-bug-report-0.1.0.0-EuhAGhnUGrIE8GbjnBHYSp
Registering library for stack-bug-report-0.1.0.0..
Completed 4 action(s).
```

### Stack version

```
$ ./stack --version
Version 1.6.6, Git revision 7a4b06a275c74b0c4d15ab4376be344e483cf86e (dirty) (5524 commits) x86_64 hpack-0.20.0
```

### Method of installation

Build of `stable` branch from official repository with unmodified `stack.yaml`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.