[Chapel Merge] Address command quoting issue in printchplenv

Branch: refs/heads/main
Revision: cf9569b
Author: mppf
Link: Address command quoting issue in printchplenv by mppf · Pull Request #18745 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18745 from mppf/issue-18741

Address command quoting issue in printchplenv

For #18741

This PR adjusts chpl_compiler.get_compiler_command and
chpl_llvm.get_llvm_clang to return a Python list so that it is easier to
construct the correctly quoted command to run when using these.

It also adjusts get_compiler_version to accept flag of host or target.

While there, avoid adding a gcc prefix argument for clang when the prefix
is just the normal /usr.

It removes two workarounds I added in PR #18727 because reinstalling
CommandLineTools fixed the problem for me and these workarounds weren't
sufficient to get the third-party code compiling.

Future Work:

  • figure out how to resolve linker errors like object file ... was built for newer macOS version (11.6) than being linked (11.0) with
    CHPL_LLVM=bundled when linking chpl itself. So far these appear to
    be harmless.
  • Look into problems with Mojave with CHPL_LLVM=bundled (wasn't working
    for @e-kayrakli but so far we are not sure if that is a local issue)

Verified that make check passes on

  • [x] Big Sur with CHPL_LLVM=system with Homebrew LLVM 11.1
  • [x] Big Sur with CHPL_LLVM=bundled
  • [x] Mojave with CHPL_LLVM=system with Homebrew LLVM 10.1
  • [x] Catalina with CHPL_LLVM=system with Homebrew LLVM 10.1
  • [x] Ubuntu builds with CHPL_LLVM=bundled, CHPL_TARGET_COMPILER=clang,
    custom GCC, and no clang in path
  • [x] Ubuntu builds with CHPL_LLVM=system


  • [x] full local testing

Reviewed by @e-kayrakli - thanks!

Modified Files:
M util/chplenv/chpl_atomics.py

M util/chplenv/chpl_compiler.py
M util/chplenv/chpl_cpu.py
M util/chplenv/chpl_llvm.py
M util/chplenv/chpl_tasks.py
M util/chplenv/compiler_utils.py
M util/chplenv/printchplenv.py

Compare: https://github.com/chapel-lang/chapel/compare/680a10eaeebc...cf9569b7ad9e