[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1023333: qt6-webengine: Fail to build with rollup 3



Control: tags -1 patch


A little bit of investigation shows that upstream Chromium has already switched to using rollup 3 compatible config files, and the Debian Chromium package started using the system version of rollup during build beginning in version 112.0.5615.121-1.


https://tracker.debian.org/media/packages/c/chromium/changelog-118.0.5993.70-1


However, qt6-webengine 6.4.2 still has the older config file style.  When attempting to use the system rollup 3, the following error is produced:


    RollupError: Node tried to load your configuration file as CommonJS eve

    though it is likely an ES module. To resolve this, change the extension of

    your configuration to ".mjs", set "type": "module" in your package.json file

    or pass the "--bundleConfigAsCjs" flag.


The easiest way to deal with this is probably to wait until a version of Qt WebEngine based on Chromium 112 or newer is released.


https://wiki.qt.io/QtWebEngine/ChromiumVersions


At that point, the attached patch can be applied to build from the system rollup.


--

Soren Stoutner

soren@stoutner.com

>From 9ca8c84ebafad40e38ab85bdd104b0150f64c7ec Mon Sep 17 00:00:00 2001
From: Soren Stoutner <soren@stoutner.com>
Date: Tue, 17 Oct 2023 12:21:50 -0700
Subject: [PATCH] Use system rollup.

---
 debian/control   | 1 +
 debian/copyright | 1 +
 debian/rules     | 6 ++++++
 4 files changed, 8 insertions(+)

diff --git a/debian/control b/debian/control
index b790e4f..4b6fcd6 100644
--- a/debian/control
+++ b/debian/control
@@ -80,6 +80,7 @@ Build-Depends: binutils (>= 2.32-8~),
                qt6-webchannel-dev (>= 6.4.2~),
                qt6-websockets-dev (>= 6.4.2~),
                re2c,
+               rollup,
                ruby,
                xauth <!nocheck>,
                xvfb <!nocheck>,
diff --git a/debian/copyright b/debian/copyright
index bbef02c..ad692c9 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -38,6 +38,7 @@ Files-Excluded: examples/webenginewidgets/contentmanipulation/jquery.min.js
                 src/3rdparty/chromium/third_party/lzma_sdk/7zr.exe
                 src/3rdparty/chromium/third_party/lzma_sdk/Executable/7za.exe
                 src/3rdparty/chromium/third_party/mako/doc
+                src/3rdparty/chromium/third_party/node/node_modules/rollup
                 src/3rdparty/chromium/third_party/openh264/src/autotest/performanceTest/ios/fruitstrap
                 src/3rdparty/chromium/third_party/openh264/src/autotest/performanceTest/ios/iFileTransfer
                 src/3rdparty/chromium/third_party/pycoverage/coverage/htmlfiles/*.min.js
diff --git a/debian/rules b/debian/rules
index 9dabc1a..a65cc00 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,6 +31,9 @@ touch_files = src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/
 override_dh_auto_clean:
 	dh_auto_clean
 
+	# Remove the system version of rollup, which is copied in during build to replace the bundled version that is remove by the copyright file.
+	rm -rf src/3rdparty/chromium/third_party/node/node_modules/rollup/
+
 	rm -f $(CURDIR)/src/3rdparty/chromium/third_party/jstemplate/jstemplate_compiled.js
 	for fname in $(touch_files); do \
 		rm -f $(CURDIR)/$${fname}; \
@@ -59,6 +62,9 @@ override_dh_auto_configure:
 	cp /usr/share/javascript/jquery/jquery.min.js src/3rdparty/chromium/third_party/pycoverage/coverage/htmlfiles/
 	cp /usr/share/javascript/jquery-tablesorter/jquery.tablesorter.min.js src/3rdparty/chromium/third_party/pycoverage/coverage/htmlfiles/
 
+	# Use the system rollup.
+	cp -a /usr/share/nodejs/rollup src/3rdparty/chromium/third_party/node/node_modules/rollup/
+
 	set -ex; for fname in $(touch_files); do \
 		mkdir -p $(CURDIR)/$$(dirname $${fname}); \
 		touch $(CURDIR)/$${fname}; \
-- 
2.42.0

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: