External package detection for compilers#43464
Conversation
|
@ravil-mobile can you review this PR? This PR modifies the following package(s), for which you are listed as a maintainer:
|
231ef1f to
d9d6b24
Compare
944ba46 to
ab29485
Compare
There was a problem hiding this comment.
I checked the mixin and left a few comments. Overall I don't understand the technical reason why we can't split this in multiple PRs:
- One to push common logic into the mixin
- Others to add detection methods to other compilers
Since this PR both refactors existing code and changes the logic, it's more difficult to spot issues by just reviewing code.
That said, a very basic test seems to have regressed:
$ spack external find gcc
finds gcc@9 in this PR on my laptop, and gcc@9.4.0 on develop.
The newly added compilers:
aoccarmnag
all miss a detection_test.yaml file to perform detection tests.
There was a problem hiding this comment.
I checked why this is reporting gcc@9. It's because we changed the flag being used from -dumpfullversion to -dumpversion:
$ gcc -dumpversion
9
$ gcc -dumpfullversion
9.4.0It also seems we skip checking if:
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.contains the Apple string to discard whether gcc is apple-clang in disguise?
Can we please revert that?
I still think this would be much easier to review if split in smaller PRs doing a single change, rather than a big PR that overhauls code and regexes and flags together.
I'll submit a separate change to the detection test that makes this fail, so we also test which flag is supposed to be used.
80291c0 to
8400bb3
Compare
Instead, leave either a debug message or a loud warning, depending on the entry being missing. Delete a unit test that was detecting `gcc-8` as being part of a `gcc@7.7.7` spec, with previous auto-detection.
|
Relevant changes that we should note:
|
|
@becker33 Let me know if there's anything in the latest commits you don't agree with. |
|
Testing for AOCC support I have noticed that Otherwise AOCC detection is behaving as I would expect. |
Yes, this is how external detection for packages works at the moment. It's just based on PATH inspection. |
|
(To be solved in a following PR) There is still one thing that is missing for: spack external find -t compilerto be a full substitute of spack compiler find --mixed-toolchainSee #40902 |
This creates shared infrastructure for compiler packages to implement the detailed search capabilities from the `spack compiler find` command for the `spack external find` command. After this commit, `spack compiler find` can be replaced with `spack external find --tag compiler`, with the exception of mixed toolchains.
This creates shared infrastructure for compiler packages to implement the detailed search capabilities from the `spack compiler find` command for the `spack external find` command. After this commit, `spack compiler find` can be replaced with `spack external find --tag compiler`, with the exception of mixed toolchains.
This PR creates shared infrastructure for compiler packages to implement the detailed search capabilities from the
spack compiler findcommand for thespack external findcommand.This PR updates the
aocc,apple-clang,arm,gcc, andnagpackages to use the new functionality. PRs for other compilers to come.With this PR,
spack compiler findcan be replaced withspack external find --tag compileras long as only the five covered compilers are relevant.Once the rest of the packages are updated, future work will replace the
spack compiler findcommand with an alias tospack external find --tag compiler.