Skip to content

Handle no known candidate warnings when signature file is found #6937

Description

@mpilgrem

The build of integration test backpack-x-pkg-transitive sees warnings:

Warning: Unable to find a known candidate for the Cabal entry Logger, but did find:
         * Logger.hsig
         * Logger.hsig 
          
         If you are using a custom preprocessor for this module with its own file extension,
         consider adding the extension to the value of the custom-preprocessor-extensions key in Stack's
         project-level configuration file (stack.yaml).

Warning: Unable to find a known candidate for the Cabal entry Str, but did find:
         * Str.hsig 
          
         If you are using a custom preprocessor for this module with its own file extension,
         consider adding the extension to the value of the custom-preprocessor-extensions key in Stack's
         project-level configuration file (stack.yaml).

generated by (pre-Backpack support) Stack.ComponentFile.logPossibilities - see findCandidate, resolveFiles, resolveFilesAndDeps, resolveComponentFiles, stackLibraryFiles (and similar), Stack.PackageFile.packageDescModulesAndFiles and getPackageFile.

In the context of Backpack support, these warnings could be more helpful.


We have Stack.Constants.haskellDefaultPreprocessorExts:

-- | Extensions for modules that are preprocessed by common preprocessors.
haskellDefaultPreprocessorExts :: [Text]
haskellDefaultPreprocessorExts = ["gc", "chs", "hsc", "x", "y", "ly", "cpphs"]

and findCandidate (extract):

  customPreprocessorExts <- view $ configL . to (.customPreprocessorExts)
  let haskellPreprocessorExts =
        haskellDefaultPreprocessorExts ++ customPreprocessorExts
  liftIO (makeNameCandidates haskellPreprocessorExts) >>= \case ...

Should .hsig also be treated as if it were an extension of something that will be 'preprocessed'?

Pinging @philippedev101 for his views.

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