This may be a known issue. If so, I think it could be documented better. I could not find a clear answer in the issue archive to match this, so, at the very least, this issue might help others who encounter the problem.
Steps to reproduce:
- Create a
.cabal for an executable.
- Include the
hs-source-dirs field mentioning the source directories with the modules.
- Do not include the
other-modules field with the modules listed.
- Create a
stack from that .cabal.
stack build the first time.
- Change a module in the package.
stack build to rebuild.
Expected:
The project rebuilds.
Actual:
The project does not rebuild.
Discussion:
I couldn't figure out why my project wasn't rebuilding. Then, I found that if I include other-modules with a module M and update M, the project would rebuild. If I then change N, a module not listed in other-modules, the project would not rebuild.
Related:
These issues seem to be related:
From my cursory reading, it seems like this issue was supposed to be fixed in:
There seems to be a currently undocumented --force-dirty flag added in 09a9fa4 to deal with this kind of issue.
I believe I did see a warning for unlisted modules (added in 31712d3?), but I wasn't sure what the warning was for. I wasn't even sure what an “unlisted module” was. Why would unlisted modules be a problem? If this issue is the reason for that warning, then the warning text could be improved.
Questions:
If this is a known issue with no fix currently planned, could it be documented better or handled by stack?
- One option would be to mention it somewhere in the guide. The “Build command” section would be a good place to start with.
- Another option would be to automate the check with
stack and report it.
This may be a known issue. If so, I think it could be documented better. I could not find a clear answer in the issue archive to match this, so, at the very least, this issue might help others who encounter the problem.
Steps to reproduce:
.cabalfor an executable.hs-source-dirsfield mentioning the source directories with the modules.other-modulesfield with the modules listed.stackfrom that.cabal.stack buildthe first time.stack buildto rebuild.Expected:
The project rebuilds.
Actual:
The project does not rebuild.
Discussion:
I couldn't figure out why my project wasn't rebuilding. Then, I found that if I include
other-moduleswith a moduleMand updateM, the project would rebuild. If I then changeN, a module not listed inother-modules, the project would not rebuild.Related:
These issues seem to be related:
stack testnot detecting changes to the test suitestack testnot detecting changes to the test suite #556From my cursory reading, it seems like this issue was supposed to be fixed in:
There seems to be a currently undocumented
--force-dirtyflag added in 09a9fa4 to deal with this kind of issue.I believe I did see a warning for unlisted modules (added in 31712d3?), but I wasn't sure what the warning was for. I wasn't even sure what an “unlisted module” was. Why would unlisted modules be a problem? If this issue is the reason for that warning, then the warning text could be improved.
Questions:
If this is a known issue with no fix currently planned, could it be documented better or handled by
stack?stackand report it.