Skip to content

odb: Move messages checking to odb to fix deps.#5704

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
titan73:master
Sep 10, 2024
Merged

odb: Move messages checking to odb to fix deps.#5704
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
titan73:master

Conversation

@titan73
Copy link
Contributor

@titan73 titan73 commented Sep 8, 2024

The messages checking was set at db level as odb is an interface and doesn't not have a post-build trigger.
Unfortunately there were no dependencies on other libs besides db such as defin.
So since add_dependencies can only add targets but not files, create a custom target which depends on a generated files which
triggers the call to find_messages.py.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

maliberty commented Sep 8, 2024

I assume this is to fix #5687

add_custom_target docs say

The target has no output file and is always considered out of date even if the commands try to create a file with the name of the target. Use the add_custom_command() command to generate a file with dependencies.

I think this should only run when there is a change to a dependency. Can this be accomplished with add_custom_command ?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

@titan73
Copy link
Contributor Author

titan73 commented Sep 8, 2024

You're right. PR updated as suggested.
We still need a custom target as add_dependencies accepts only targets.
But this time the custom target depends on a file generated only when the deps have change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of the touch command? That file doesn't seem to be referenced.

Copy link
Contributor Author

@titan73 titan73 Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is referenced by add_custom_target(odb_messages DEPENDS messages.txt). This file is in build/src/odb and is only generated when find_messages.py succeeds. This way invoking make will rerun find_messages.py if it's missing (ie find_message.py not run yet) or if a dependencies is changed.
The output of find_messages.py is in src/odb and is always generated whenever find_messages.py succeeds or not which is the current behaviour.

To test the patch I just do a "ls src/odb/messages.txt ../src/odd/messages.txt" from build folder to see how things are going on so I can see if the files are updated and when based on the date. Thins go as intented after testing in the different conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed the target file to messages_checked to avoid confusion.

The messages checking was set at db level as odb is an interface and
doesn't not have a post-build trigger. Unfortunately there were no
dependencies on other libs besides db such as defin.
So since add_dependencies can only add targets but not files,
create a custom target which depends on a generated files which
triggers the call to find_messages.py.

Signed-off-by: Christian Costa <titan.costa@gmail.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

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.

2 participants