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

[flang] Different fir-opt tool is produced depending on FLANG_INCLUDE_TESTS #121202

Open
mgorny opened this issue Dec 27, 2024 · 1 comment
Open
Labels
cmake Build system in general and CMake in particular flang Flang issues not falling into any other category

Comments

@mgorny
Copy link
Member

mgorny commented Dec 27, 2024

The fir-opt tool that is installed unconditionally has some code conditional to FLANG_INCLUDE_TESTS. This implies that the tool installed as part of a CMake run with tests being built will be different than the tool installed otherwise.

At the very least, this goes against the principle of least surprise, and violates the Gentoo-specific policy that testing must not affect the installed package. Also, this is quite problematic for us since it implies static linking to MLIR (as the relevant test-specific MLIR libraries aren't available in the dylib — which could be acceptable for discardable test executables, but it's not fine for installed executables).

Could we perhaps build two versions of fir-opt instead? One that would not contain test-specific code and be installed, and another one with test-specific code that's only used by the test suite? I can submit a pull request if you agree with that approach.

@llvmbot
Copy link
Member

llvmbot commented Dec 27, 2024

@llvm/issue-subscribers-flang-build

Author: Michał Górny (mgorny)

The `fir-opt` tool that is installed unconditionally has some code conditional to `FLANG_INCLUDE_TESTS`. This implies that the tool installed as part of a CMake run with tests being built will be different than the tool installed otherwise.

At the very least, this goes against the principle of least surprise, and violates the Gentoo-specific policy that testing must not affect the installed package. Also, this is quite problematic for us since it implies static linking to MLIR (as the relevant test-specific MLIR libraries aren't available in the dylib — which could be acceptable for discardable test executables, but it's not fine for installed executables).

Could we perhaps build two versions of fir-opt instead? One that would not contain test-specific code and be installed, and another one with test-specific code that's only used by the test suite? I can submit a pull request if you agree with that approach.

@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular flang Flang issues not falling into any other category and removed flang:build labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular flang Flang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

3 participants