8000 oac-tree: refactor to use oac-tree bundle 1.3 by ralphlange · Pull Request #75 · epics-training/training-vm · GitHub
[go: up one dir, main page]

Skip to content

oac-tree: refactor to use oac-tree bundle 1.3 - #75

Closed
ralphlange wants to merge 1 commit into
epics-training:mainfrom
ralphlange:oac-tree-bundle-1.3
Closed

ralphlange wants to merge 1 commit into
epics-training:mainfrom
ralphlange:oac-tree-bundle-1.3

Conversation

@ralphlange
Copy link
Copy Markdown
Contributor
  • 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]

@waltervh: Would you mind to take a look?

@ralphlange
ralphlange requested a review from simon-ess February 24, 2026 13:24
@ralphlange ralphlange linked an issue Feb 24, 2026 that may be closed by this pull request
Comment on lines +144 to +149
- 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All of these might be better suited to be in a block, as they are consecutive tasks that depend on a common condition.

Comment on lines +62 to +65
- name: "Check bundle source directory"
stat:
path: "{{ oactree_install_path }}/src/oac-tree-bundle"
register: oactree_bundle_dir
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +79 to +86
- 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]
@ralphlange
ralphlange force-pushed the oac-tree-bundle-1.3 branch from e7e02eb to 3669f0c Compare April 6, 2026 13:30
@ralphlange ralphlange closed this Apr 6, 2026
@ralphlange
ralphlange deleted the oac-tree-bundle-1.3 branch April 6, 2026 13:31
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.

Update oac-tree to use the super-build repository

2 participants

0