Skip to content

[jsroot] use as builtin in ROOT - #23877

Open
linev wants to merge 10 commits into
root-project:masterfrom
linev:jsroot_as_builtin
Open

linev wants to merge 10 commits into
root-project:masterfrom
linev:jsroot_as_builtin

Conversation

@linev

@linev linev commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Like many other components, download jsroot instead maintain of code copy.
In the cmake file provide two ways - URL download of version 7.12.0 (active) or git clone from github repository (commented out). Last case must be there when fast development with ROOT and JSROOT should be done without producing next JSROOT release.

If builtin_jsroot=OFF produce warning and switch ROOT to use https://root.cern/js/7.12.0/ for all widgets.
This means that such ROOT build requires internet to run webgui widgets and THttpServer UI.

Also when builtin_openui5=OFF, issue warning and switch to https://sdk.openui5.org/1.152.0/
This again require internet to run widgets.

Configure correct dependency between jsroot, mathjax and extra file copies.

@linev linev self-assigned this Oct 28, 2026
@linev
linev marked this pull request as draft October 28, 2026 14:07
@linev linev added the clean build Ask CI to do non-incremental build on PR label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 10h 5m 36s ⏱️
 3 879 tests  3 676 ✅  29 💤   174 ❌
72 674 runs  68 592 ✅ 648 💤 3 434 ❌

For more details on these failures, see this check.

Results for commit 4a3cce2.

♻️ This comment has been updated with latest results.

@guitargeek

Copy link
Copy Markdown
Contributor

Will this PR be backported to 6.42?

@linev

linev commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Will this PR be backported to 6.42?

On my side I see no any drawbacks.
It is just different installation method of the same code

Comment thread builtins/jsroot/CMakeLists.txt Resolved

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @linev, this is fantastic! I just have a few small suggestions to make things really work on an internet-free sandbox and to iron out some inconsistencies.

@linev

linev commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

@guitargeek

If we want to provide convenient way to build root without downloading many packages from network - we need to extend functionality of ExternalProject_Add which is used for that. One should have option to put all necessary tarballs in one special directory and with special flag (or by default) test if package with specified name and with correct checksum is there.

But I do not think that we want to make it for 6.42. This PR (if we decide to backport it) just provide fallback solution if install is not possible. And solution was exists since ever - but it was not configured automatically by build

@guitargeek

Copy link
Copy Markdown
Contributor

Will this PR be backported to 6.42?

On my side I see no any drawbacks. It is just different installation method of the same code

It seems late to do this, but in my opinion the backport would be quite important.

The drawback is clearly that the build system and required configuration packages changes significantly for packagers after the release candidate.

The advantage though is that we avoid churn for the packagers. With the 6.42.00-rc, they have to adapt to builtin_mathjax and builtin_openui5 as is it implemented now, and would have to migrate to builtin_jsroot the release after. If we do the switch to a builtin jsroot now, packages have to adapt only once, which is smoother overall. Also, there are usually not many people who look into the release candidates anyway.

@linev

linev commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

@guitargeek

Actually, ExternalProject_Add already has necessary functionality.
It is DOWNLOAD_DIR argument. If we set it - it will check download directory before starting download.
This can help to solve problems with many used packages - only git clone which is used for civetweb will be problematic.

@guitargeek

Copy link
Copy Markdown
Contributor

@guitargeek

If we want to provide convenient way to build root without downloading many packages from network - we need to extend functionality of ExternalProject_Add which is used for that. One should have option to put all necessary tarballs in one special directory and with special flag (or by default) test if package with specified name and with correct checksum is there.

Sure, I don't advocate for more large scale changes for 6.42.

But I do not think that we want to make it for 6.42. This PR (if we decide to backport it) just provide fallback solution if install is not possible. And solution was exists since ever - but it was not configured automatically by build

That's true for OPENUI5DIR, which has indeed existed before. But JSROOTSYS was not used by the ROOT build system before, and I'm advocating for making the build system not sensitive to more additional environment variables but to go for proper CMake variables instead.

@linev

linev commented Oct 30, 2026 •

Copy link
Copy Markdown
Member Author

I am really in favor of using DOWNLOAD_DIR argument to organize our own pre-loading of used packages.
Solution with OPENUI5DIR or JSROOTSYS are for debug purposes and can be removed than.

Actually I never actively used OPENUI5DIR - in the very beginning I was not sure if my reduced openui5 package made properly and keep backdoor to install full package instead. Now it is not necessary.

Solution with JSROOTSYS is not important during cmake - at ROOT runtime one always can set this variable and it will be properly used.

It may be useful to provide exclusive alternatives for builtin_jsroot and builtin_openui5.
Now it is fixed links like https://root.cern/js/7.12.0/ and https://sdk.openui5.org/1.152.0/
Such links can be option which replace respective builtin

@linev
linev force-pushed the jsroot_as_builtin branch from 4a3cce2 to cdb0780 Compare October 30, 2026 11:38
Comment thread builtins/openui5/CMakeLists.txt Resolved
linev added 6 commits October 30, 2026 13:02
JSROOT will be installed from github
When git clone is used, many files can be deleted which are not necessary
- like demos or examples.

Let use $JSROOTSYS as custom source for JSROOT

Add special dependency that git cloning happens before additional
files copied to js/files/ directory
For released JSROOT version one provides
tarballs which more easy to download compared with the git clone

But for fast development one also need to have possibility to use jsroot git repository

Therefore keep both variants in the code
Like jsroot, configure OPENUI5_CUSTOM_LOCATION and
use it when generate system.rootrc script
linev added 4 commits October 30, 2026 13:02
It will also include installation of mathjax
Without builtin_jsroot installation of mostly empty js/ directory
make no sence - batch files works only with locally installed JSROOT
Install will be performed together with jsroot
Do not try to copy some dirs during ROOT building - there is
no version check and therefore provided code can be corrupted
@linev
linev force-pushed the jsroot_as_builtin branch from cdb0780 to 3c5e33d Compare October 30, 2026 12:02
@linev linev added this to the 6.42.00 milestone Oct 30, 2026

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thank you very much for the PR!

It's good that there are no debugging environment variables anymore that change the configuration behavior.

As I mentioned in #23877 (comment), I think this PR should be merged and backported to 6.42 ASAP, so we avoid ending up with a release where the JavaScript packages mathjax, openui5, and jsroot are treated in an inconsistent way.

This should also be followed up by a PR that makes sure that ROOT can be built in an environment without internet connection, using the DOWNLOAD_DIR mechanism outlined by Sergey in #23877 (comment)

guitargeek added a commit to guitargeek/nixpkgs that referenced this pull request Oct 30, 2026
Build ROOT from root-project/root#23877, which
removes JSROOT from the ROOT sources. JSROOT is now a separate jsroot
package made from the release tarball, with mathjax 3.2.0 next to it as
JSROOT expects. ROOT is pointed to it with the JSROOTSYS environment
variable at configure time, which ends up in etc/system.rootrc.

The openui5 runtime distribution is passed via the OPENUI5DIR environment
variable instead of the OPENUI5_SOURCE_DIR patch. ROOT does not install it
in that case, so it is symlinked into the output in postInstall.

The mathjax patches are dropped, as mathjax is no longer handled by the
ROOT build when JSROOT is external.
guitargeek added a commit to guitargeek/nixpkgs that referenced this pull request Oct 30, 2026
Instead of pointing ROOT to an external JSROOT and openui5 with the
JSROOTSYS and OPENUI5DIR environment variables, keep builtin_jsroot,
builtin_openui5 and builtin_mathjax enabled and give ROOT the archives it
would download. A new ROOT_DOWNLOAD_DIR CMake variable (added by a patch)
is passed as DOWNLOAD_DIR to ExternalProject_Add, which skips the download
when the archive with the expected name and checksum is already there, and
the connectivity check is skipped in that case as well.

A second patch installs the js directory from the build tree, as otherwise
the downloaded JSROOT and mathjax would not be installed.

This makes the separate jsroot package unnecessary again, and nothing is
needed at runtime outside of the ROOT output. Also drop the lcgpackages
substitution: the URLs stay valid, and no download happens as long as the
archives are present.

See root-project/root#23877 (comment)
@@ -0,0 +1,32 @@
# Copyright (C) 1995-2026, Rene Brun and Fons Rademakers.

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.

We do not usually rely on GitHub for downloading tarballs. Can this become, also in another PR, an LCG provided tarball?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Of course.
If you put JSROOT release on LCG, I will directly modify this PR.

@guitargeek

Copy link
Copy Markdown
Contributor

@linev I have another question: I noticed that some files that were previously in ROOT's js/files/ directory are missing in jsroot's js/files/ directory, and at least the .htm files are also referenced by other parts of ROOT:

Can these reference be removed because they are obsolete? Or do the files need to be upstreamed to the jsroot repo?

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

clean build Ask CI to do non-incremental build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants