Skip to content

Handle Backpack signature files in component discovery#6940

Open
philippedev101 wants to merge 1 commit into
commercialhaskell:masterfrom
philippedev101:re6937-backpack-signatures
Open

Handle Backpack signature files in component discovery#6940
philippedev101 wants to merge 1 commit into
commercialhaskell:masterfrom
philippedev101:re6937-backpack-signatures

Conversation

@philippedev101

Copy link
Copy Markdown
Contributor

Addresses #6937.

@mpilgrem I don't think .hsig should go through the custom-preprocessor path. A .hsig file is already the source file for a Backpack signature, not an input that should produce a .hs file.

The main user-visible change is that a normal Backpack package should stop getting a warning that suggests adding .hsig to custom-preprocessor-extensions. That warning sends people in the wrong direction: the project is not missing preprocessor configuration, Stack just needs to recognize the declared signature file as part of the package.

There are now three cases. If the module is listed in signatures, Stack treats the .hsig as expected and stays quiet. If there is a local .hsig file but the module is not listed in signatures, Stack gives a Backpack-specific hint pointing at the missing field. If the file really is some other unknown extension, Stack still gives the existing custom-preprocessor warning.

The declared .hsig files are also tracked for rebuilds, so changing a signature is treated like changing another source file that matters to the component.

Tests cover the valid Backpack case, .hsig rebuild tracking, the undeclared-signature warning, and the unchanged custom-preprocessor warning path.

Treat declared .hsig files as Backpack signatures instead of unknown custom-preprocessor candidates. Track declared signature files for rebuilds, keep signature modules out of ordinary module resolution, and emit a Backpack-specific warning when a local .hsig file is not listed in the component's signatures field.

Keep the existing custom-preprocessor warning for other unknown extensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant