Compiler: migrate platform support filter to new compiler packages#48818
Compiler: migrate platform support filter to new compiler packages#48818johnwparent wants to merge 4 commits intospack:developfrom
Conversation
|
Hi @johnwparent! I noticed that the following package(s) don't yet have maintainers:
Are you interested in adopting any of these package(s)? If so, simply add the following to the package class: maintainers("johnwparent")If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with $ spack blame msvcThank you for your help! Please don't add maintainers without their consent. You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer. |
|
@alalazo let me know if there's a better way I can integrate this with the new compiler construction. I looked through the compilers as nodes PR and didn't see any obvious conflicts, but it's a large PR and I didn't spend too long looking. Also if you have an idea better than the lambdas (I really don't like the lambda approach) I'm all ears. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/build_systems/compiler.py
lib/spack/spack/compilers/__init__.py
var/spack/repos/builtin/packages/apple-clang/package.py
var/spack/repos/builtin/packages/gcc/package.py
var/spack/repos/builtin/packages/msvc/package.py
==> Running import checks
import check requires Python 3.9 or later
import checks were clean
==> Running isort checks
Fixing /tmp/tmp4nqr0w0q/spack/var/spack/repos/builtin/packages/apple-clang/package.py
Fixing /tmp/tmp4nqr0w0q/spack/var/spack/repos/builtin/packages/msvc/package.py
isort checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/msvc/package.py
reformatted lib/spack/spack/compilers/__init__.py
All done! ✨ 🍰 ✨
2 files reformatted, 3 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
lib/spack/spack/version/version_types.py:134: error: Incompatible types in assignment (expression has type "Tuple[Any, ...]", variable has type "Tuple[str]") [assignment]
lib/spack/spack/variant.py:130: error: Unsupported right operand type for in ("Union[Collection[Any], Callable[..., Any]]") [operator]
lib/spack/spack/build_environment.py:171: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc]
lib/spack/spack/build_environment.py:171: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc]
Found 4 errors in 3 files (checked 636 source files)
mypy found errors
I've updated the branch with style fixes. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/build_systems/compiler.py
lib/spack/spack/compilers/__init__.py
lib/spack/spack/platforms/_functions.py
lib/spack/spack/test/compilers/basics.py
lib/spack/spack/test/conftest.py
var/spack/repos/builtin/packages/apple-clang/package.py
var/spack/repos/builtin/packages/gcc/package.py
var/spack/repos/builtin/packages/msvc/package.py
==> Running import checks
import check requires Python 3.9 or later
import checks were clean
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/test/compilers/basics.py
All done! ✨ 🍰 ✨
1 file reformatted, 7 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
lib/spack/spack/version/version_types.py:134: error: Incompatible types in assignment (expression has type "Tuple[Any, ...]", variable has type "Tuple[str]") [assignment]
lib/spack/spack/platforms/_functions.py:22: error: "type" has no attribute "priority" [attr-defined]
lib/spack/spack/platforms/_functions.py:23: error: "type" has no attribute "detect" [attr-defined]
lib/spack/spack/variant.py:130: error: Unsupported right operand type for in ("Union[Collection[Any], Callable[..., Any]]") [operator]
lib/spack/spack/compilers/__init__.py:349: error: "Type[PackageBase]" has no attribute "is_supported_on_platform" [attr-defined]
lib/spack/spack/build_environment.py:171: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [misc]
lib/spack/spack/build_environment.py:171: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [misc]
Found 7 errors in 5 files (checked 636 source files)
mypy found errors
I've updated the branch with style fixes. |
c8b8066 to
5c05e4d
Compare
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/compilers/config.py
lib/spack/spack/platforms/__init__.py
lib/spack/spack/platforms/_platform.py
lib/spack/spack/platforms/darwin.py
lib/spack/spack/platforms/freebsd.py
lib/spack/spack/platforms/linux.py
lib/spack/spack/platforms/windows.py
var/spack/repos/spack_repo/builtin/build_systems/compiler.py
var/spack/repos/spack_repo/builtin/packages/apple_clang/package.py
var/spack/repos/spack_repo/builtin/packages/msvc/package.py
==> Running import checks
import checks were clean
==> Running isort checks
Fixing /tmp/tmpvms9gh3c/spack/lib/spack/spack/platforms/_platform.py
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/platforms/linux.py
reformatted lib/spack/spack/platforms/windows.py
reformatted var/spack/repos/spack_repo/builtin/packages/apple_clang/package.py
reformatted lib/spack/spack/compilers/config.py
All done! ✨ 🍰 ✨
4 files reformatted, 6 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 612 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
Signed-off-by: John Parent <[email protected]>
Signed-off-by: John Parent <[email protected]>
Signed-off-by: John Parent <[email protected]>
Signed-off-by: John Parent <[email protected]>
ce0812f to
83d470c
Compare
|
This pull request has been automatically marked as stale because it has not had any activity in the last 6 months. It will be closed in 30 days if there is no further activity. If the pull request is waiting for a reply from reviewers, feel free to ping them as a reminder. If it is waiting and has no assigned reviewer, feel free to ping To get more eyes on your pull request, you can post a link in the #pull-requests channel of the Spack Slack. |
Previous iterations of compiler detection filtered the compilers by supported platform. Spack recently migrated compiler detection but neglected to migrate this filtering as well.
This filtering was required to resolve bugs on Windows and Linux where detection attempts for compilers that were incompatible with the given host platform caused Spack to hang or crash.
Current mechanism to determine platform support for a compiler is a bit cludgey at the moment, will likely refactor before a final merge.
Resolves #39622 again.