Skip to content

Proper message when incorrect configuration of properties is found

This MR checks and prints an error message when an incorrect property configuration is parsed.

See !776 (closed)

Eg. for the following code, where a PROPERTY block is defined with no Property counterpart:

PROPERTY(block_dim_x_t, "block_dim_x", "block dimension x", unsigned) block_dim_x;
// Property<block_dim_x_t> m_block_dim_x {this, 64};

The error message looks as follows:

[dcampora@capablanca ~/projects/allen/build]$ ninja
[0/2] Re-checking globbed directories...
[1/7] Parsing Allen algorithms
FAILED: code_generation/parsed_algorithms.pickle 
cd /Users/dcampora/projects/allen/build/stream && /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E copy_directory /Users/dcampora/projects/allen/configuration/parser /Users/dcampora/projects/allen/build/code_generation/sequences/parser && /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E copy_directory /Users/dcampora/projects/allen/scripts/clang /Users/dcampora/projects/allen/build/code_generation/sequences/parser/clang && /opt/homebrew/Cellar/cmake/3.20.2/bin/cmake -E env DYLD_LIBRARY_PATH=/Library/Developer/CommandLineTools/usr/lib: CPLUS_INCLUDE_PATH= /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8 /Users/dcampora/projects/allen/build/code_generation/sequences/parser/ParseAlgorithms.py --generate parsed_algorithms --filename /Users/dcampora/projects/allen/build/code_generation/parsed_algorithms.pickle --prefix_project_folder /Users/dcampora/projects/allen
Parsing file /Users/dcampora/projects/allen/device/velo/search_by_triplet/include/SearchByTriplet.cuh failed
Traceback (most recent call last):
  File "/Users/dcampora/projects/allen/build/code_generation/sequences/parser/ParseAlgorithms.py", line 679, in <module>
    parsed_algorithms = Parser().parse_all(args.prefix_project_folder + "/")
  File "/Users/dcampora/projects/allen/build/code_generation/sequences/parser/ParseAlgorithms.py", line 73, in parse_all
    parsed_algorithms = algorithm_parser.traverse(
  File "/Users/dcampora/projects/allen/build/code_generation/sequences/parser/AlgorithmTraversalLibClang.py", line 366, in traverse
    AlgorithmTraversal.traverse_children(
  File "/Users/dcampora/projects/allen/build/code_generation/sequences/parser/AlgorithmTraversalLibClang.py", line 155, in traverse_children
    parsed_children = f(child_node, *args)
  File "/Users/dcampora/projects/allen/build/code_generation/sequences/parser/AlgorithmTraversalLibClang.py", line 342, in namespace
    raise Exception(f"Error parsing properties {set_diff} in file {filename}.\n"
Exception: Error parsing properties {'block_dim_x_t'} in file /Users/dcampora/projects/allen/device/velo/search_by_triplet/include/SearchByTriplet.cuh.
Please ensure all properties have a PROPERTY field and a Property definition.
ninja: build stopped: subcommand failed.

The error works both ways.

Merge request reports