Enforce suite
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 9
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 2
Description
The function `set_default_suite` of the ToolRepository is kind of broken. The current behaviour is: the ToolRepository will put the one tool (and I am just changing this while adding MPI support to put all tools of a suite) to the front, and then when looking for a default tool to look from the beginning of the list.
Problem is, if no tool is available for the default suite, this will silently return a completely different tool (e.g. you request 'intel-classic', and might get 'gfortran'). And at some stage (when compiler flags are added to the corresponding compiler, and not as atm to any compiler), you won't even get a warning about invalid flags anymore, since it will just silently use the compiler-specific flags.
So this function should be renamed (`enforce_suite` or `restrict_to_suite`??), and if a special suite has been requested, the `get_default_tool` function should not return a tool that is not part of that suite.
We should still allow the user to explicitly set (different) compilers in a ToolBox, so we cannot remove non-suite tools from the ToolRepository. Suggested implementation: when a suite is requested, the name is validated (check that we have tools of this suite), stored. And when get_default is called and a suite name has been set, restrict this correspondingly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing ToolRepository.set_default_suite and get_default_tool to understand how the default tool is selected and how suite names are represented. Done means a requested suite is validated and prevents fallback to tools outside that suite, while explicitly selected non-suite compilers remain usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100