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

[CI] enable dev=on on debian12 #15853

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

silverweed
Copy link
Contributor

This Pull request:

adds the -Ddev=on flag on the debian CI machine. It's a "test run" to see if we can later enable it on more (potentially all) build machines.

Here's what the flag does:

  • enables asserts
  • (Linux|BSD) enables -Werror
  • (Linux|BSD) does not relink if a dependent .so has changed (CMAKE_LINK_DEPENDS_NO_SHARED On)
  • (Linux|BSD) splits debug info (-gsplit-dwarf)
  • (Linux|BSD) uses lld if available
  • defines USE_LESS_INCLUDES

@silverweed silverweed self-assigned this Jun 14, 2024
@silverweed silverweed requested a review from dpiparo as a code owner June 14, 2024 12:01
Copy link

github-actions bot commented Jun 14, 2024

Test Results

    18 files      18 suites   4d 13h 33m 56s ⏱️
 2 719 tests  2 719 ✅ 0 💤 0 ❌
47 245 runs  47 245 ✅ 0 💤 0 ❌

Results for commit 99a6fa3.

♻️ This comment has been updated with latest results.

@silverweed silverweed requested a review from bellenot as a code owner June 14, 2024 13:26
@pcanal
Copy link
Member

pcanal commented Jun 14, 2024

[enable on] (potentially all)

We need to make sure that we still test the environment the users will actually use (i.e dev=OFF on each PR).

@dpiparo
Copy link
Member

dpiparo commented Jun 15, 2024

Maybe we can add a "special" build, like "modules off" or "march=native"?

@vepadulano
Copy link
Member

I also would start with -Ddev=ON being a special build tested on just a few platforms and nightly. In any case currently it cannot work (at least) because of the many warnings coming from LLVM so we need to suppress those before continuing

@silverweed
Copy link
Contributor Author

silverweed commented Jun 17, 2024

@pcanal if that proves feasible, wouldn't it be beneficial to enable some of the flags everywhere instead of having them opt-in? Namely:

  • enabling -Werror everywhere except llvm-facing parts
  • using lld when possible (of course we still want to keep building with the default linker to test it works - but maybe it should be the exception rather than the rule)
  • always defining R__LESS_INCLUDES (or, better, removing all the code in the #else parts). By the way, do you know why this define exists? Is there some compiler/platform where compilation breaks if it's not defined?

@hahnjo
Copy link
Member

hahnjo commented Jun 17, 2024

enabling -Werror everywhere except llvm-facing parts

We don't want -Werror by default because there will always be weird platforms that we cannot test, and future compilers may enable other warnings but we don't want to prevent them from building an older release of ROOT. FWIW LLVM sources should explicitly opt out of -Werror in our setup. The only place this doesn't work are some ROOT files including Clang headers - I don't have a good idea what to do about that case...

@silverweed
Copy link
Contributor Author

@hahnjo that's fair; but I suppose we still wanna enable it on all our main tested platforms, at least for the CI nodes.
I tried adding appending -Wno-error to the CMakeLists of some directories (like interpreter), but it didn't really work (I guess -Werror gets added after it so it suppresses the other flag) and even if it did it looks sketchy. Not sure what's the best way to approach this.

@hahnjo
Copy link
Member

hahnjo commented Jun 17, 2024

I suppose we still wanna enable it on all our main tested platforms, at least for the CI nodes.

I tend to agree.

I tried adding appending -Wno-error to the CMakeLists of some directories (like interpreter), but it didn't really work (I guess -Werror gets added after it so it suppresses the other flag) and even if it did it looks sketchy. Not sure what's the best way to approach this.

As mentioned before, I think nothing is needed for interpreter/ because we already disable all warnings for LLVM libraries. For core/clingutils and core/metacling, I think the flags must be set before ROOT_OBJECT_LIBRARY.

@pcanal
Copy link
Member

pcanal commented Jun 17, 2024

I suppose we still wanna enable it on all our main tested platforms, at least for the CI nodes.

We still need to test (at the very least in the nightly) what the user will see. If we don't test it we will eventually break it (for example some new CMake that inadvertently relies on side-effect of that code path).

@pcanal
Copy link
Member

pcanal commented Jun 17, 2024

always defining R__LESS_INCLUDES (or, better, removing all the code in the #else parts). By the way, do you know why this define exists? Is there some compiler/platform where compilation breaks if it's not defined?

Per the commit log:

    When -Ddev=ON specified, R__LESS_INCLUDES is defined
    It will be used to reduce includes which are exposed to the public.
    While such changes can have side-effects on user code,
    option is off by default.

i.e. the changes of which header files are included where is a code-wise backward incompatible change (that has only light to zero actual benefit to the user), so we want to thread carefully in introducing them.

@silverweed silverweed force-pushed the enable_dev_on branch 2 times, most recently from dd7daaa to 40630b6 Compare June 19, 2024 09:38
@silverweed silverweed requested a review from jblomer as a code owner June 19, 2024 12:21
@silverweed silverweed force-pushed the enable_dev_on branch 2 times, most recently from a491e6e to effc96c Compare July 30, 2024 14:52
@silverweed silverweed requested a review from agheata as a code owner July 30, 2024 14:52
Copy link
Member

@agheata agheata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix in TGeoManager.cxx is fine, thanks for spotting the typo

@silverweed
Copy link
Contributor Author

@agheata it was a compile error with dev=on due to -Werror.
It was actually already fixed by #16142, but I temporarily put it on this PR so the CI could build correctly

@silverweed silverweed force-pushed the enable_dev_on branch 6 times, most recently from cd22854 to 90f9253 Compare September 13, 2024 08:11
@silverweed silverweed force-pushed the enable_dev_on branch 2 times, most recently from 5db76a7 to 01ccda9 Compare September 16, 2024 06:57
@bellenot
Copy link
Member

@silverweed FYI -Wno-error is not known by MSVC:

cl : command line  error D8021: invalid numeric argument '/Wno-error'

You should use something like:

if(NOT MSVC)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")`
endif()

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixes compiler warnings about using incomplete type

[hist] add missing includes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants