Skip to content

CMake: update_graphql_..._files functions can delete files without warning if misused #212

@wravery

Description

@wravery

These functions each execute a script which loads the previous file list, regenerates the code in the build directory, deletes files which are not in the new file list, then copies new/modified files (including the file list) back to the source directory. These functions assume that you will always build the generated code in a separate sub-directory, and all of the files in that sub-directory are generated by this function.

That deletion step means that if you start building a schema or client target in an existing directory, you may delete some of your implementation files the first time you try to build with update_graphql_..._files!

I think the scripts need to be more robust to misuse. They should output an error if the directory contains any files but the file list is missing, and they should maybe generate a separate list of headers which can be used to exhaustively compare the directory contents with the previous generation pass. If any unrecognized *.h or *.cpp files are in the directory, it should fail fast.

Metadata

Metadata

Assignees

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