Refactor firedrake configure#5073
Conversation
All logic is now gone. All possible configs are explicitly enumerated. This is needed because the previous approach was not extensible (e.g. supporting Ubuntu 24.04 and 26.04 together). This opens the door to having 'community' configurations and even externally provided configuration files.
…or-firedrake-configure
| if args.gpu_arch != GPUPlatform.NO_GPU and os_ == OS.MACOS_ARM64: | ||
| error( | ||
| "GPU-compatible PETSc builds are currently only supported" | ||
| "on Linux" | ||
| ) |
There was a problem hiding this comment.
Should the test be for os_ != <LINUX_VALUE> rather than for MACOS?
There was a problem hiding this comment.
I've removed this as the default error message is quite informative. I don't think we need a GPU-specific one.
|
|
||
| def has_apt() -> bool: | ||
| try: | ||
| subprocess.run(["apt", "--version"], capture_output=True) |
There was a problem hiding this comment.
which apt and check if it's empty rather than relying on errors?
There was a problem hiding this comment.
I've dropped this and am detecting Ubuntu directly
| extra_url: str | None = None | ||
| """The URL to a deb package that will enable vendor-specific software development | ||
| repositories, or None if not required. | ||
| """ |
There was a problem hiding this comment.
This is useful. Please can we also have docstrings for the other attributes?
| "Don't know what system dependencies to install on this platform, " | ||
| "please install them manually" |
There was a problem hiding this comment.
This should print some description of the Arch (e.g. name, platform, etc) so people know if they actually selected the one they thought they did.
All logic is now gone. All possible configs are explicitly enumerated.
This is needed because the previous approach was not extensible (e.g.
supporting Ubuntu 24.04 and 26.04 together).
This opens the door to having 'community' configurations and even
externally provided configuration files.