Skip to content

Strange interaction with a linter #769

@rouson

Description

@rouson

Description

Is fpm copying the entire source tree (src) into the build tree? If so, would it be acceptable to change that behavior so that only program source files get copied and not everything else? I just spent several hours attempting to make changes to code that perplexingly caused inconsistencies with previous versions of the code. I felt like I was in an episode of the Twilight Zone in which multiple points along a timeline existed simultaneously. Eventually I concluded that the problem was because I switched editors. I was at one point using VS Code's Modern Fortran extension, which includes a linter that generated various *.mod and *.smod files in my source tree. I later switched to editing in vim, but my old .mod and .smod files were getting swept up in the build process and I was seeing errors caused when newly renamed variables in my submodule weren't being recognized because their declarations were in the parent module and an outdated .mod file was being used in the build process.

If I have correctly diagnosed this issue, then I'm hoping I don't need to generate a simple reproducer and the fix is for fpm to never copy .mod or .smod or similar files from the source tree into the build tree. If having .mod and .smod files in the source tree is problematic, then it will be difficult or impossible to use a linter.

Expected Behaviour

I would not expect old .mod and .smod files to be used in the build process.

Version of fpm

0.6.0

Platform and Architecture

macOS

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions