Repository navigation
oac-tree: refactor to use oac-tree bundle 1.3 - #75
ralphlange wants to merge 1 commit into
Conversation
| - name: "Create bundle build flag" | ||
| copy: | ||
| content: "" | ||
| dest: "{{ oactree_install_path }}/.flag/oac-tree-bundle" | ||
| become: true | ||
| when: build_result.rc | default(0) == 0 and oactree_bundle_flag.stat.exists == false |
There was a problem hiding this comment.
I think you can do this more cleanly using the file module and state touch, see https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/file_module.html
There was a problem hiding this comment.
True. Will do.
I worked on this before merging the EPICS modules refactor - this is old stuff creeping in.
| PVXS_DIR: "{{ epics_install_path }}/pvxs-{{ pvxs_version }}" | ||
| CMAKE_PREFIX_PATH: "{{ oactree_install_path }}" | ||
| become: true | ||
| when: oactree_bundle_flag.stat.exists == false |
There was a problem hiding this comment.
All of these might be better suited to be in a block, as they are consecutive tasks that depend on a common condition.
| - name: "Check bundle source directory" | ||
| stat: | ||
| path: "{{ oactree_install_path }}/src/oac-tree-bundle" | ||
| register: oactree_bundle_dir |
There was a problem hiding this comment.
This could likely come after the clone and anything that depends on this could instead depend on whether or not that task is changed. This is probably a better way to handle this in that this only checks if the src dir exists; with this other method you would actually know if the source had changed.
| - name: "Set global rebuild flag if needed" | ||
| ansible.builtin.file: | ||
| path: "{{ oactree_install_path }}/.flag/REBUILD" | ||
| state: touch | ||
| modification_time: preserve | ||
| access_time: preserve | ||
| become: true | ||
| when: oactree_bundle_flag.stat.exists == false |
There was a problem hiding this comment.
I'm not sure I understand what exactly is happening with this logic. I don't see anywhere outside of this task that modifies this flag. Moreover, as I read the logic:
- We first check if REBUILD is set
- If it is not (or the source is missing) we will clear the "bundle build flag"
- We then check if it exists.
** This means that either REBUILD being set or source missing means we trigger the build steps - The build steps then create the REBUILD flag
- At the end, they also set the "bundle build flag"
The problem as I see it is that the order suggests that this will re-run the build every time: since we are building we set the rebuild flag, and hence next time we trigger a rebuild, etc. etc.
Am I missing something? Is there an external way to set this rebuild flag?
There was a problem hiding this comment.
That's a left-over from building the modules separately (without the bundle parent dir).
(Same logic is used for the EPICS modules.)
You have a number of modules that are built in a specific order (flattened dependency tree).
As soon as one module is being rebuilt, all following modules also need to be rebuilt (changed or not) as they are further down the list, i.e., downstream dependencies.
|
|
||
| - name: "Check bundle source directory" | ||
| stat: | ||
| path: "{{ oactree_install_path }}/src/oac-tree-bundle" |
There was a problem hiding this comment.
If flags are to be used, I think it would be good to variable-ise them. e.g. {{ oactree_build_flag }}
- Update vars/main.yml to use oac-tree bundle repo - Add git and remove unzip from rpm/deb dependencies - Update tasks/main.yml to implement bundle build process - Ensure environment variables (EPICS_BASE, PVXS_DIR, CMAKE_PREFIX_PATH, etc.) are passed to both cmake and make tasks for super-build consistency - Correct global rebuild flag logic - Use distribution-specific library directory names - Remove obsolete top-level make install task (as sub-projects are automatically installed) - Remove obsolete tasks/build_module.yml Co-authored-by: google-labs-jules[bot]
e7e02eb to
3669f0c
Compare
Co-authored-by: google-labs-jules[bot]
@waltervh: Would you mind to take a look?