AcademySoftwareFoundation / AcademySoftwareFoundation/aswf-docker
Refactoring replicated build scripts?
- Dominant language
- Python
- Stars
- 189
- Forks
- 42
- Avg merge
- 9h 38m
- Merged PRs (30d)
- 6
Description
For some tools like ccache and cmake, it looks like there are two different installs involved (and I'm probably getting details wrong, just started looking into this):
- a global install in /opt/aswfbuilder which (I think) is used to build the infrastructure for building the ASWF containers, and which uses hard coded versions
- a per-container install in /usr/local which is versioned based on the reference platform year
There are separate but very similar scripts for these two steps:
- `scripts/common/install_dev_cmake.sh` : /opt/aswfbuilder with hard coded version
- `scripts/base/install_cmake.sh`: /usr/local with per year version
- `scripts/common/install_dev_cache.sh`: /opt/aswfbuilder with hard coded version
- `scripts/common/install_ccache.sh`: /usr/local with per year version
I would make the following suggestions:
- add/move definitions such as `ARG CMAKE_VERSION=3.12.4` and `ARG CCACHE_VERSION=3.7.4` to `packages/Dockerfile` instead of hard coding those in the scripts, assuming those get overridden once you are inside the package specific containers by the definitions in `scripts/20xx/versions_base.sh`
- merge the cmake and ccache scripts into a single one which gets an additional command line parameter to specify the desired behavior of installing in /opt/aswfbuilder vs /usr/local
Of course it is possible that there are additional reasons for needing to keep these scripts split up, I've only given this a brief look.
Contributor guide
Research direction
Compare scripts/common/install_dev_cmake.sh, scripts/base/install_cmake.sh, scripts/common/install_dev_cache.sh, and scripts/common/install_ccache.sh with packages/Dockerfile and the scripts/20xx/versions_base.sh definitions. Determine why the /opt/aswfbuilder and /usr/local installs are separate; done means the version ownership and any safe script consolidation are agreed and the affected container builds still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, dockerfile
- Domain
- build-system, infrastructure
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100