chore: Move codegen venv setup into build stage#6617
Conversation
943f911 to
bb3c7f0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6617 +/- ##
=========================================
- Coverage 81.4% 81.4% -0.0%
=========================================
Files 999 999
Lines 74423 74423
Branches 7557 7553 -4
=========================================
- Hits 60613 60606 -7
- Misses 13810 13817 +7 🚀 New features to boost your workflow:
|
mathbunnyru
left a comment
There was a problem hiding this comment.
A few comments, nothing major
|
I think there're a couple of things we can do
Because currently, cmake still regenerates even if we touch the macro files and we want to avoid regeneration as much as possible. |
|
I'm just thinking, does it make sense to call list_output each time when we run cmake? I think what we expect is:
but what we're doing currently is:
Would it be easier to have a stamp file containing the hash of the script file, the template files, and the macro files, and then, we check the stamp file into git, and we only generate when the hash is different? Doing so means that:
I think this is the safest way |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
following up the discussion, we'll move the code generation process outside of cmake. |
Co-authored-by: Bart <bthomee@users.noreply.github.com>
bthomee
left a comment
There was a problem hiding this comment.
I'm somewhat concerned it will be too confusing for developers to keep track of which cmake commands they need to run and when.
I also wonder if it will work fine in IDEs - after I run the conan install command, my IDE for instance will automatically pick up the CMake profile and configure everything; all I need to do then is build the code. Will my workflow have to change? Do I need to remember to run setup_code_gen and/or code_gen each time I switch branches, for instance?
No, you only have to run cmake --build . --target code_gen when you update the macro files or the template files, and the ci pipeline will ask you to do it if you update those files but forget to run the scripts |
High Level Overview of Change
This PR moves python venv setup into build stage. Also move venv setup into python code so venv is created only when generation is needed.
Context of Change
Python venv setup is relatively slow so moving it into build stage helps build system to do something else in parallel while python dependencies are being downloaded.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)