Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm-clang-win-x-{armv7l,aarch64}-release: migrate away from DEFAULT_SYSROOT #94284

Open
MaskRay opened this issue Jun 3, 2024 · 6 comments
Open
Assignees
Labels
infrastructure Bugs about LLVM infrastructure

Comments

@MaskRay
Copy link
Member

MaskRay commented Jun 3, 2024

The CMake variable DEFAULT_SYSROOT provides a default --sysroot= for every clang --target=xxx.

Within the clang/test/Driver testsuite, there have been many changes tha adjust --sysroot= so that
these tests will pass on build bots that specify DEFAULT_SYSROOT.
Like the now-deprecated GCC_INSTALL_PREFIX, this places undue maintenance burden to keep clang/test/Driver tests pass for all supported bots.

Two changes should happen:

  • There should be no expectation that all tests will pass.
  • DEFAULT_SYSROOT should eventually be deprecated and then removed. (After we figure out a way to support relative paths https://reviews.llvm.org/D158218)

As alternatives, llvm-clang-win-x-{armv7l,aarch64}-release may switch a Clang configuration file.

In short, place bin/$default_triple.cfg beside bin/clang.

clang/test/lit.cfg.py specifies config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1", so the configuration files will not affect %clang behavior in driver tests.

@MaskRay MaskRay added the infrastructure Bugs about LLVM infrastructure label Jun 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 3, 2024

@llvm/issue-subscribers-infrastructure

Author: Fangrui Song (MaskRay)

The CMake variable `DEFAULT_SYSROOT` provides a default `--sysroot=` for every `clang --target=xxx`.

Within the clang/test/Driver testsuite, there have been many changes tha adjust --sysroot= so that
these tests will pass on build bots that specify DEFAULT_SYSROOT.
Like the now-deprecated GCC_INSTALL_PREFIX, this places undue maintenance burden to keep clang/test/Driver tests pass for all supported bots.
Two changes should happen:

  • There should be no expectation that all tests will pass.
  • DEFAULT_SYSROOT should eventually be deprecated and then removed. (After we figure out a way to support relative paths https://reviews.llvm.org/D158218)

As alternatives, llvm-clang-win-x-{armv7l,aarch64}-release may switch a Clang configuration file.

In short, place bin/$default_triple.cfg beside bin/clang.

@vvereschaka vvereschaka self-assigned this Jun 3, 2024
vvereschaka added a commit to vvereschaka/llvm-project that referenced this issue Jun 4, 2024
…s builds. NFC.

Avoid usage DEFAULT_SYSROOT Cmake variable to confgiure the ARM/Aarch64 cross
platform toolchain builds. Use the Clang configuration files with proper
`--sysroot=` in it instead.

More details could be found here:
    llvm#94284
vvereschaka added a commit to vvereschaka/llvm-zorg that referenced this issue Jun 4, 2024
* llvm-clang-win-x-{armv7l,aarch64}-release
* llvm-clang-win-x-{armv7l,aarch64}

Removed DEFAULT_SYSROOT from the build configurations. Use the local clang
configuration files instead.

More details could be found here:
    llvm/llvm-project#94284
vvereschaka added a commit to llvm/llvm-zorg that referenced this issue Jun 4, 2024
…builders. (#199)

* llvm-clang-win-x-{armv7l,aarch64}-release
* llvm-clang-win-x-{armv7l,aarch64}

Removed DEFAULT_SYSROOT from the build configurations. Use the local
clang configuration files instead.

More details could be found here:
    llvm/llvm-project#94284
vvereschaka added a commit that referenced this issue Jun 4, 2024
…s builds. NFC. (#94300)

Avoid usage DEFAULT_SYSROOT CMake variable to confgiure the ARM/Aarch64
cross platform toolchain builds. Use the Clang configuration files with
proper `--sysroot=` in it instead.

More details could be found here:
    #94284
vvereschaka added a commit to vvereschaka/llvm-zorg that referenced this issue Jun 5, 2024
…release builders.

Missed configuration for the workers hosted the release builders.

See llvm#199 for details.

Related llvm/llvm-project#94284
vvereschaka added a commit to vvereschaka/llvm-zorg that referenced this issue Jun 8, 2024
…release builders.

Missed configuration for the workers hosted the release builders.

See llvm#199 for details.

Related llvm/llvm-project#94284
vvereschaka added a commit to llvm/llvm-zorg that referenced this issue Jun 8, 2024
…release builders. (#200)

Missed configuration for the workers hosting the release builders.

See #199 for details.

Related llvm/llvm-project#94284
vvereschaka added a commit that referenced this issue Jun 8, 2024
…uilds. NFC. (#94835)

* generate Clang configuration file with provided target sysroot
(TOOLCHAIN_TARGET_SYSROOTFS)
* explicitly pass provided target sysroot into the compiler-rt tests
configuration.
* added ability to configure a type of the build libraries -- shared or
static (TOOLCHAIN_SHARED_LIBS, default OFF)

In behalf of: #94284
nekoshirro pushed a commit to nekoshirro/Alchemist-LLVM that referenced this issue Jun 9, 2024
…uilds. NFC. (llvm#94835)

* generate Clang configuration file with provided target sysroot
(TOOLCHAIN_TARGET_SYSROOTFS)
* explicitly pass provided target sysroot into the compiler-rt tests
configuration.
* added ability to configure a type of the build libraries -- shared or
static (TOOLCHAIN_SHARED_LIBS, default OFF)

In behalf of: llvm#94284

Signed-off-by: Hafidz Muzakky <ais.muzakky@gmail.com>
@vvereschaka
Copy link
Contributor

Hi @tstellar,

there are few updates for the arm/linux cross cmake cache file -- clang/cmake/caches/CrossWinToARMLinux.cmake -- including these that fix the DEFAULT_SYSROOT problem. The post-commit builders work ok with these changes

it would be nice to add these changes into the current release branches to fix the appropriate release bots:

https://github.com/llvm/llvm-project/commits/main/clang/cmake/caches/CrossWinToARMLinux.cmake

Please let me know if it requires any specific steps on my side to add these changes into the release branch.

Thanks, Vlad.

@tstellar
Copy link
Collaborator

@vvereschaka The release/18.x branch is frozen now, we aren't planning any more releases.

@vvereschaka
Copy link
Contributor

Understood. Thank you!

@carlocab
Copy link
Member

carlocab commented Dec 9, 2024

Relative paths to the configuration file directory are already supported by something like

--sysroot=<CFGDIR>/relative/path/to/sysroot

This is, of course, not the same as a driver-relative path, but perhaps it's enough to suit the needs of users who require a relative DEFAULT_SYSROOT? Otherwise, I suppose we could support something like <CLANGDIR>, but it would probably be nicer if we didn't need it.

carlocab added a commit to carlocab/wasi-sdk that referenced this issue Dec 12, 2024
Upstream want to deprecate `DEFAULT_SYSROOT`[^1][^2][^3], but one
blocker is wasi-sdk's usage of it.

Let's try to help that along by switching to using config files[^4]
instead.

This should result in no user-facing changes in functionality. (If it
does, then that's an LLVM bug that should be fixed there.)

[^1]: https://reviews.llvm.org/D158218
[^2]: llvm/llvm-project#94284
[^3]: llvm/llvm-project#77537
[^4]: https://clang.llvm.org/docs/UsersManual.html#configuration-files
sunfishcode pushed a commit to WebAssembly/wasi-sdk that referenced this issue Dec 12, 2024
Upstream want to deprecate `DEFAULT_SYSROOT`[^1][^2][^3], but one
blocker is wasi-sdk's usage of it.

Let's try to help that along by switching to using config files[^4]
instead.

This should result in no user-facing changes in functionality. (If it
does, then that's an LLVM bug that should be fixed there.)

[^1]: https://reviews.llvm.org/D158218
[^2]: llvm/llvm-project#94284
[^3]: llvm/llvm-project#77537
[^4]: https://clang.llvm.org/docs/UsersManual.html#configuration-files
@carlocab
Copy link
Member

wasi-sdk should no longer be using DEFAULT_SYSROOT as of WebAssembly/wasi-sdk#503.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Bugs about LLVM infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants