Skip to content

[core] circumvent call to rmkdepend - #23492

Open
ferdymercury wants to merge 23 commits into
root-project:masterfrom
ferdymercury:patch-20
Open

ferdymercury wants to merge 23 commits into
root-project:masterfrom
ferdymercury:patch-20

Conversation

@ferdymercury

@ferdymercury ferdymercury commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

maybe it improves performance a bit

and one could get rid of rmkdepend dependency / hard-coded builtin

AI-assisted

not yet fully working

@ferdymercury ferdymercury added the skip code analysis Skip the code analysis CI steps for this PR, including verifying clang-formatting and running Ruff. label Sep 25, 2026
@ferdymercury ferdymercury changed the title [core] circumvent call to rmkdep [core] circumvent call to rmkdepend Sep 25, 2026
@ferdymercury
ferdymercury marked this pull request as ready for review September 25, 2026 08:38
@dpiparo dpiparo self-assigned this Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 12h 32m 29s ⏱️
 3 883 tests  3 680 ✅  29 💤   174 ❌
72 730 runs  68 645 ✅ 651 💤 3 434 ❌

For more details on these failures, see this check.

Results for commit e3e4e3d.

♻️ This comment has been updated with latest results.

warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
Comment thread core/base/src/TSystem.cxx Outdated
Comment thread core/base/CMakeLists.txt Outdated
@ferdymercury
ferdymercury requested a review from pcanal September 30, 2026 08:11
@ferdymercury

ferdymercury commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

@bellenot could you check on Windows why this error is printed in the CI?

Failed to close pipe dependencies for ...
Maybe some flag in the reconstructed command is incorrect?
Thanks in advance.

@ferdymercury

Copy link
Copy Markdown
Collaborator Author

unix failures are unrelated.

win32 failure are related, but only 6 tests failing, so not too bad.

@dpiparo

dpiparo commented Oct 9, 2026

Copy link
Copy Markdown
Member

@ferdymercury do you need help to push this through, e.g. by @bellenot ?

@bellenot

bellenot commented Oct 9, 2026

Copy link
Copy Markdown
Member

I'll take a look

Comment thread core/base/src/TSystem.cxx Outdated
// Generate the dependency via standard output, not searching the
// standard include directories,
#ifdef WIN32
TString compiler = "\"" COMPILER "\""; // 'Program Files' contains spaces on Windows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Usually we use the CXX (actually indirectly) from compiledata.h and this does not usually contain spaces (it is the basename of the compiler).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think this is slightly safer in case it changes later on?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is a two edges sword. We had to go with the basename because the same version of the compiler is not always installed in the same location on all system (but is almost always in the path). When we used the full path name we failed unless the binary was installed in the exact same configuration/distribution. This is critical for the experiment software. Even for Windows this is needed since the user can elect to install the compiler in a different place (for example on a different disk for space reason).

Comment thread core/base/src/TSystem.cxx
cmd += " -MF \"" + depfilename + "\"";
cmd += " -MT \"";
R__AddPath(cmd, targetname);
cmd += "\" ";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The design of ACLiC here was to delegate this whole command line build (for the most part) to the build system and insert it in compiledata.h

For example we have:

#define MAKESHAREDLIB  "cd $BuildDir ; c++ -fPIC -c $Opt -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fsized-deallocation -fno-common -Qunused-arguments -pthread -stdlib=libc++ -std=c++17 $IncludePath $SourceFiles ; c++ $Opt $ObjectFiles -dynamiclib -Wl,-headerpad_max_install_names -m64 -Wl,-dead_strip_dylibs -Wl,-install_name,@rpath/$LibName.so  $RPath $LinkedLibs -o $SharedLib "

So I would imagine we would add a new line in compiledata.h with all the compiler/OS specific part filed in and the run-time part easily inserted via some $variables

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since this PR is a bit complicated, now that the CI is green, I'd prefer doing this optimization in a subsequent one. On the other hand, only TSystem would be using this, so I do not see that it simplifies things. The ifdefs in the Cxx would be just moved to the CMake code, so similar if not larger number of lines and more abstraction. If there would be more places being used, then I would see that more clearly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, it sortof can wait for a further PR. Yes, the complexity is essentially the same.

There is 2 major distinctions

One is to have the same pattern for all the cases rather than 2 different ways.

Additionally, going through the indirection of having one command line pattern allows the user to manipulate and customizing as they need.

Comment thread core/base/src/TSystem.cxx
Comment thread core/base/src/TSystem.cxx Outdated
Comment thread core/base/src/TSystem.cxx Outdated
@bellenot

Copy link
Copy Markdown
Member

@ferdymercury With my suggestions:

1/7 Test #1744: roottest-root-aclic-misc-assertROOT7027 ........   Passed    9.61 sec
2/7 Test #1740: roottest-root-aclic-load-reload ................   Passed   18.07 sec
3/7 Test #2387: roottest-root-io-newstl-buildPospelov ..........   Passed   21.23 sec
    Start 2388: roottest-root-io-newstl-printPospelov
4/7 Test #2388: roottest-root-io-newstl-printPospelov ..........   Passed    6.43 sec
5/7 Test  #105: gtest-core-metacling-TClingLoadUnloadFile ......   Passed   28.74 sec
6/7 Test  #945: tutorial-roofit-roofit-rf104_classfactory ......   Passed   29.06 sec
    Start 1289: tutorial-roofit-roofit-rf104_classfactory-py
7/7 Test #1289: tutorial-roofit-roofit-rf104_classfactory-py ...   Passed   32.60 sec

Comment thread core/base/src/TSystem.cxx
Comment thread core/base/src/TSystem.cxx
Comment thread core/base/src/TSystem.cxx
by bellenot and pcanal

Co-authored-by: Bertrand Bellenot <bellenot@users.noreply.github.com>
@ferdymercury

ferdymercury commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI failure seems unrelated.

I don't know if someone wants to run some speed test benchmark of compiling some long script with AcLiC? Maybe @LukasBreitwieser ?

Comment thread core/base/src/TSystem.cxx Outdated
to allow relocation

as suggested by pcanal

also basename does not contain spaces in general, so no need for escaping

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Assisted pr:squash on merge skip code analysis Skip the code analysis CI steps for this PR, including verifying clang-formatting and running Ruff.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants