thorium icon indicating copy to clipboard operation
thorium copied to clipboard

Unable to compile Thorium

Open RudraSwat opened this issue 2 years ago • 24 comments

Was trying to compile Thorium on Ubuntu 20.04 and found that 'chromium/src/content/browser/gpu/shader_cache_factory.cc' was missing when running ./build.sh. After creating it, around 22000 of the 55000 targets were built successfully before the second error, which was related to a variable being defined and not being used due to -Werror.

RudraSwat avatar Aug 08 '22 06:08 RudraSwat

Was trying to compile Thorium on Ubuntu 20.04 and found that 'chromium/src/content/browser/gpu/shader_cache_factory.cc' was missing when running ./build.sh. After creating it, around 22000 of the 55000 targets were built successfully before the second error, which was related to a variable being defined and not being used due to -Werror.

@RudraSwat Please upload the full error to verify what went wrong

gz83 avatar Aug 08 '22 08:08 gz83

@RudraSwat Probably because of rebase. Please run another trunk.sh, setup.sh, and of course your PGO/args.gn etc. and run another build.

Also, in case you are following the old docs, (which are still mostly relevant but ugly), I have made new updated docs here > Linux & Win.

Alex313031 avatar Aug 08 '22 11:08 Alex313031

@RudraSwat If, after this, you are still having issues, post full log as per @gz83 suggestion.

Alex313031 avatar Aug 08 '22 11:08 Alex313031

@RudraSwat It was a rebase error on my part See fix > https://github.com/Alex313031/Thorium/commit/bc0c0040da5c32ad160975ca56083408ed10cb72

Alex313031 avatar Aug 08 '22 11:08 Alex313031

Please run another trunk.sh

I got this when running trunk.sh again: (should I checkout any particular branch before running trunk.sh again?)

Rebasing/Syncing and running hooks...
Previous HEAD position was 0f82c98002 Version 10.6.107
HEAD is now at d631c1efda [riscv64]  disable fp multiply and accumulate instructions
Previous HEAD position was d0b724340 Update DevTools DEPS (trusted-origins)
HEAD is now at 0d6aed5bc Update DevTools Chromium DEPS.
removed '/home/rudra/chromium/src/components/neterror/resources/favicon-16x16.png'
removed '/home/rudra/chromium/src/components/neterror/resources/images/favicon-16x16.png'
removed '/home/rudra/chromium/src/components/neterror/resources/favicon-32x32.png'
removed '/home/rudra/chromium/src/components/neterror/resources/images/favicon-32x32.png'
removed '/home/rudra/chromium/src/content/shell/app/thorium_shell.ico'
removed '/home/rudra/chromium/src/chrome/browser/thorium_flag_entries.h'
removed '/home/rudra/chromium/src/chrome/browser/thorium_flag_choices.h'
HEAD is now at 4611c74b30962 [Frameworks roll] Roll to 465837757 piper revision
Cannot rebase-update with detached head + uncommitted changes.

RudraSwat avatar Aug 08 '22 11:08 RudraSwat

@RudraSwat It was a rebase error on my part See fix > https://github.com/Alex313031/Thorium/commit/bc0c0040da5c32ad160975ca56083408ed10cb72

Ah, I'll try that. Thanks :)

RudraSwat avatar Aug 08 '22 11:08 RudraSwat

@Alex313031 This new added file doesn't seem to exist either: content/browser/preloading/prerender/prerender_page_holder.cc in the Chromium source code.

RudraSwat avatar Aug 08 '22 11:08 RudraSwat

@RudraSwat It was just added, so run another trunk amd setup To diagnost what is going wrong with trunk, run git status, and post output here.

Alex313031 avatar Aug 08 '22 16:08 Alex313031

@Alex313031 Just did that and ran build.sh and got these errors:

../../chrome/browser/chrome_content_browser_client.cc:3819:16: error: no member named 'text_track_window_padding' in 'blink::web_pref::WebPreferences'; did you mean 'text_track_window_radius'?
    web_prefs->text_track_window_padding = style->window_padding;
               ^~~~~~~~~~~~~~~~~~~~~~~~~
               text_track_window_radius
../../third_party/blink/public/common/web_preferences/web_preferences.h:199:15: note: 'text_track_window_radius' declared here
  std::string text_track_window_radius;
              ^
../../chrome/browser/chrome_content_browser_client.cc:3819:51: error: no member named 'window_padding' in 'ui::CaptionStyle'; did you mean 'window_radius'?
    web_prefs->text_track_window_padding = style->window_padding;
                                                  ^~~~~~~~~~~~~~
                                                  window_radius
../../ui/native_theme/caption_style.h:45:15: note: 'window_radius' declared here
  std::string window_radius;
              ^
2 errors generated.
[1 processes, 37508/49518 @ 22.6/s | 1...ser/chrome_download_manager_delegate.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	13292 	1807.3  	24022.8
canonicalize str 	16146962	0.1     	1522.4
canonicalize path	22731631	0.1     	1433.3
lookup node      	22812205	0.2     	4652.2
.ninja_log load  	2     	13681.5 	27.4
.ninja_deps load 	2     	21038.5 	42.1
node stat        	361072	1.8     	640.8
depfile load     	340   	21.5    	7.3
StartEdge        	37509 	2232.4  	83734.0
FinishCommand    	37509 	425.3   	15953.5

path->node hash load 0.68 (269206 entries / 393241 buckets)

RudraSwat avatar Aug 08 '22 17:08 RudraSwat

@RudraSwat Here this should fix it. Just replace the file in the chromium tree with this one, no need to run a trunk or setup, although you will want to git pull the latest thorium repo to get this file. > https://github.com/Alex313031/Thorium/commit/9c44e1a490d3250d701a866cd20346f2e456e031

Alex313031 avatar Aug 09 '22 10:08 Alex313031

@Alex313031 Tried doing that and got a new set of errors (related to the changes in the past few commits):

In file included from ../../chrome/browser/about_flags.cc:3281:
../../chrome/browser/thorium_flag_entries.h:17:43: error: expected '}'
     "Tab Outlines in Low Contrast Themes";
                                          ^
../../chrome/browser/thorium_flag_entries.h:16:5: note: to match this '{'
    {"tab-outlines-in-low-contrast-themes",
    ^
../../chrome/browser/thorium_flag_entries.h:20:79: error: expected ';' at end of declaration
     kOsDesktop, SINGLE_VALUE_TYPE(features::kTabOutlinesInLowContrastThemes)},
                                                                              ^
                                                                              ;
../../chrome/browser/thorium_flag_entries.h:21:5: error: expected unqualified-id
    {"prominent-dark-mode-active-tab-title",
    ^
../../chrome/browser/about_flags.cc:9209:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9217:10: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  return FlagsStateSingleton::GetFlagsState()
         ^~~~~~~~~~~~~~~~~~~
         about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9225:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->GetFlagFeatureEntries(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9238:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->GetFlagFeatureEntries(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9240:28: error: use of undeclared identifier 'ShouldSkipNonDeprecatedFeatureEntry'; did you mean 'about_flags::ShouldSkipNonDeprecatedFeatureEntry'?
      base::BindRepeating(&ShouldSkipNonDeprecatedFeatureEntry));
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           about_flags::ShouldSkipNonDeprecatedFeatureEntry
../../chrome/browser/about_flags.cc:9084:6: note: 'about_flags::ShouldSkipNonDeprecatedFeatureEntry' declared here
bool ShouldSkipNonDeprecatedFeatureEntry(const FeatureEntry& entry) {
     ^
../../chrome/browser/about_flags.cc:9244:10: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  return FlagsStateSingleton::GetFlagsState();
         ^~~~~~~~~~~~~~~~~~~
         about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9248:10: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  return FlagsStateSingleton::GetFlagsState()->IsRestartNeededToCommitChanges();
         ^~~~~~~~~~~~~~~~~~~
         about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9254:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->SetFeatureEntryEnabled(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9261:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->SetOriginListFlag(internal_name, value,
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9266:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->RemoveFlagsSwitches(switch_list);
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9270:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->ResetAllFlags(flags_storage);
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9292:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetFlagsState()->GetSwitchesAndFeaturesFromFlags(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9309:3: error: use of undeclared identifier 'FlagsStateSingleton'; did you mean 'about_flags::FlagsStateSingleton'?
  FlagsStateSingleton::GetInstance()->RebuildState(
  ^~~~~~~~~~~~~~~~~~~
  about_flags::FlagsStateSingleton
../../chrome/browser/about_flags.cc:9048:7: note: 'about_flags::FlagsStateSingleton' declared here
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
      ^
../../chrome/browser/about_flags.cc:9313:1: error: use of undeclared identifier 'ScopedFeatureEntries'; did you mean 'about_flags::testing::ScopedFeatureEntries'?
ScopedFeatureEntries::ScopedFeatureEntries(
^~~~~~~~~~~~~~~~~~~~
about_flags::testing::ScopedFeatureEntries
../../chrome/browser/about_flags.h:116:7: note: 'about_flags::testing::ScopedFeatureEntries' declared here
class ScopedFeatureEntries final {
      ^
../../chrome/browser/about_flags.cc:9313:23: error: cannot define or redeclare 'ScopedFeatureEntries' here because namespace 'testing' does not enclose namespace 'ScopedFeatureEntries'
ScopedFeatureEntries::ScopedFeatureEntries(
~~~~~~~~~~~~~~~~~~~~~~^
../../chrome/browser/about_flags.cc:9315:21: error: use of undeclared identifier 'entries'
  SetFeatureEntries(entries);
                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[1 processes, 99/12012 @ 6.3/s | 15.608 sec. ] CXX obj/chrome/browser/browser/chrome_content_browser_client.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	2575.7  	17118.3
canonicalize str 	8073483	0.1     	759.3
canonicalize path	8142875	0.1     	412.8
lookup node      	8234900	0.1     	658.0
.ninja_log load  	1     	34143.0 	34.1
.ninja_deps load 	1     	69005.0 	69.0
node stat        	174097	19.0    	3306.5
depfile load     	339   	227.9   	77.3
StartEdge        	99    	859.3   	85.1
FinishCommand    	99    	595.5   	59.0

path->node hash load 0.69 (270240 entries / 393241 buckets)

RudraSwat avatar Aug 09 '22 10:08 RudraSwat

@RudraSwat Yeah sorry, I screwed those files up, and got the same error Simply replace these two files and continue. > https://github.com/Alex313031/Thorium/blob/main/src/chrome/browser/thorium_flag_choices.h and https://github.com/Alex313031/Thorium/blob/main/src/chrome/browser/thorium_flag_entries.h

Alex313031 avatar Aug 09 '22 12:08 Alex313031

@Alex313031 That seems to have fixed those issues. Get these new errors now:

../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc:1951:6: error: use of undeclared identifier 'IDS_SETTINGS_SAFETY_CHECK_UNUSED_SITE_PERMISSIONS_PRIMARY_LABEL'
     IDS_SETTINGS_SAFETY_CHECK_UNUSED_SITE_PERMISSIONS_PRIMARY_LABEL},
     ^
../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc:1972:16: error: no matching member function for call to 'AddLocalizedStrings'
  html_source->AddLocalizedStrings(kLocalizedStrings);
  ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
../../content/public/browser/web_ui_data_source.h:76:16: note: candidate function not viable: cannot convert argument of incomplete type 'const webui::LocalizedString[]' to 'base::span<const webui::LocalizedString>' for 1st argument
  virtual void AddLocalizedStrings(
               ^
../../content/public/browser/web_ui_data_source.h:80:16: note: candidate function not viable: cannot convert argument of incomplete type 'const webui::LocalizedString[]' to 'const base::Value::Dict' for 1st argument
  virtual void AddLocalizedStrings(
               ^
2 errors generated.
[1 processes, 897/11809 @ 10.4/s | 85.942 sec. ] CXX obj/chrome/browser/ui/ui/qrcode_generator_bubble.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	1543.8  	10260.1
canonicalize str 	8073483	0.1     	767.1
canonicalize path	8640735	0.1     	460.1
lookup node      	8733362	0.1     	876.8
.ninja_log load  	1     	30859.0 	30.9
.ninja_deps load 	1     	61357.0 	61.4
node stat        	176681	0.9     	160.4
depfile load     	339   	19.2    	6.5
StartEdge        	897   	745.2   	668.5
FinishCommand    	897   	662.8   	594.5

path->node hash load 0.69 (271193 entries / 393241 buckets)

RudraSwat avatar Aug 09 '22 13:08 RudraSwat

@Alex313031 That seems to have fixed those issues. Get these new errors now:

../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc:1951:6: error: use of undeclared identifier 'IDS_SETTINGS_SAFETY_CHECK_UNUSED_SITE_PERMISSIONS_PRIMARY_LABEL'
     IDS_SETTINGS_SAFETY_CHECK_UNUSED_SITE_PERMISSIONS_PRIMARY_LABEL},
     ^
../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc:1972:16: error: no matching member function for call to 'AddLocalizedStrings'
  html_source->AddLocalizedStrings(kLocalizedStrings);
  ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
../../content/public/browser/web_ui_data_source.h:76:16: note: candidate function not viable: cannot convert argument of incomplete type 'const webui::LocalizedString[]' to 'base::span<const webui::LocalizedString>' for 1st argument
  virtual void AddLocalizedStrings(
               ^
../../content/public/browser/web_ui_data_source.h:80:16: note: candidate function not viable: cannot convert argument of incomplete type 'const webui::LocalizedString[]' to 'const base::Value::Dict' for 1st argument
  virtual void AddLocalizedStrings(
               ^
2 errors generated.
[1 processes, 897/11809 @ 10.4/s | 85.942 sec. ] CXX obj/chrome/browser/ui/ui/qrcode_generator_bubble.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	1543.8  	10260.1
canonicalize str 	8073483	0.1     	767.1
canonicalize path	8640735	0.1     	460.1
lookup node      	8733362	0.1     	876.8
.ninja_log load  	1     	30859.0 	30.9
.ninja_deps load 	1     	61357.0 	61.4
node stat        	176681	0.9     	160.4
depfile load     	339   	19.2    	6.5
StartEdge        	897   	745.2   	668.5
FinishCommand    	897   	662.8   	594.5

path->node hash load 0.69 (271193 entries / 393241 buckets)

@RudraSwat Please find the /chrome/app directory in the chromium source code, and open the settings_strings.grdp file, and then modify the file according to the following three pages

https://chromium-review.googlesource.com/c/chromium/src/+/3779882/22/chrome/app/settings_strings.grdp

https://chromium-review.googlesource.com/c/chromium/src/+/3787900/7/chrome/app/settings_strings.grdp

https://chromium-review.googlesource.com/c/chromium/src/+/3810358/4/chrome/app/settings_strings.grdp

Please run the gn args out\thorium command after modification, and then continue compiling.

If there is still an error related to this file after modifying according to the above webpage, please continue to refer to the following webpage to modify this file. The rest of the steps after modification are the same as the previous ones.

https://chromium-review.googlesource.com/c/chromium/src/+/3811280/8/chrome/app/settings_strings.grdp

gz83 avatar Aug 09 '22 15:08 gz83

@gz83 That seems to have fixed most of the issues, and looks like the build was almost successful after making those changes. I get this linking error now:

ninja: Entering directory `/home/rudra/chromium/src/out/thorium'
[1 processes, 11439/11456 @ 6.9/s | 1654.994 sec. ] LINK ./v8_context_snapshot_generator
FAILED: v8_context_snapshot_generator 
python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapshot_generator" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Werror -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -m64 -Wl,-O3 -mavx -maes -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-import-hot-multiplier=30 -Wl,-mllvm,-import-cold-multiplier=8 -no-canonical-prefixes -Wl,-mllvm,-extra-vectorizer-passes -Wl,-mllvm,-enable-cond-stores-vec -Wl,-mllvm,-slp-vectorize-hor-store -Wl,-mllvm,-enable-loopinterchange -Wl,-mllvm,-enable-loop-distribute -Wl,-mllvm,-enable-unroll-and-jam -Wl,-mllvm,-enable-loop-flatten -Wl,-mllvm,-interleave-small-loop-scalar-reduction -Wl,-mllvm,-unroll-runtime-multi-exit -Wl,-mllvm,-aggressive-ext-opt -Wl,-O3 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -Wl,--lto-O3 -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN -Wl,--icf=none -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp" ./libffmpeg.so -Wl,--end-group  -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lresolv -lgio-2.0 -lexpat -luuid -lm -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lgbm -lEGL -ldrm -lxcb -lxkbcommon -lwayland-client -lwayland-server -ldbus-1 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -latk-1.0 -latk-bridge-2.0 -lasound -lwayland-egl -lXi -lpci -latspi
ld.lld: error: undefined symbol: blink::features::kWebRtcThreadsUseResourceEfficientType
>>> referenced by peer_connection_dependency_factory.cc
>>>               lto.tmp:(blink::PeerConnectionDependencyFactory::CreatePeerConnectionFactory())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	1597.7  	10618.2
canonicalize str 	8073483	0.1     	790.1
canonicalize path	15555335	0.1     	1112.2
lookup node      	15654805	0.3     	3946.4
.ninja_log load  	1     	35540.0 	35.5
.ninja_deps load 	1     	73551.0 	73.6
node stat        	211064	1.3     	266.7
depfile load     	339   	21.4    	7.3
StartEdge        	11439 	958.4   	10963.1
FinishCommand    	11439 	764.5   	8744.9

path->node hash load 0.71 (279617 entries / 393241 buckets)

RudraSwat avatar Aug 09 '22 17:08 RudraSwat

@RudraSwat This is because of features.cc, which sometimes changes multiple times a day. It has changed since I last rebased thorium.

Simply replace this file > https://github.com/Alex313031/Thorium/commit/687d83972bbb3777c486222dee2e54fcbfc2645e

Alex313031 avatar Aug 09 '22 18:08 Alex313031

@Alex313031 That seems to have introduced another error:

../../third_party/blink/common/features.cc:1562:32: error: unused variable 'kPretokenizeInlineSheets' [-Werror,-Wunused-const-variable]
const base::FeatureParam<bool> kPretokenizeInlineSheets = {
                               ^
1 error generated.
[1 processes, 2266/5249 @ 52.4/s | 43....work/network_service/network_context.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	13292 	1885.3  	25058.8
canonicalize str 	16146962	0.1     	1521.9
canonicalize path	16335901	0.1     	833.3
lookup node      	16591289	0.1     	1697.8
.ninja_log load  	2     	37898.0 	75.8
.ninja_deps load 	2     	106516.0	213.0
node stat        	203978	12.9    	2626.4
depfile load     	340   	230.4   	78.3
StartEdge        	2267  	2089.0  	4735.7
FinishCommand    	2267  	280.2   	635.2

path->node hash load 0.71 (279617 entries / 393241 buckets)

RudraSwat avatar Aug 10 '22 07:08 RudraSwat

@Alex313031 That seems to have introduced another error:

../../third_party/blink/common/features.cc:1562:32: error: unused variable 'kPretokenizeInlineSheets' [-Werror,-Wunused-const-variable]
const base::FeatureParam<bool> kPretokenizeInlineSheets = {
                               ^
1 error generated.
[1 processes, 2266/5249 @ 52.4/s | 43....work/network_service/network_context.o
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	13292 	1885.3  	25058.8
canonicalize str 	16146962	0.1     	1521.9
canonicalize path	16335901	0.1     	833.3
lookup node      	16591289	0.1     	1697.8
.ninja_log load  	2     	37898.0 	75.8
.ninja_deps load 	2     	106516.0	213.0
node stat        	203978	12.9    	2626.4
depfile load     	340   	230.4   	78.3
StartEdge        	2267  	2089.0  	4735.7
FinishCommand    	2267  	280.2   	635.2

path->node hash load 0.71 (279617 entries / 393241 buckets)

@RudraSwat Please follow this webpage to modify the features.cc file in the third_party\blink\common directory, and then continue compiling

https://chromium-review.googlesource.com/c/chromium/src/+/3810818/4/third_party/blink/common/features.cc

gz83 avatar Aug 10 '22 07:08 gz83

@gz83 These changes seem to already be present in features.cc after https://github.com/Alex313031/Thorium/commit/687d83972bbb3777c486222dee2e54fcbfc2645e.

RudraSwat avatar Aug 10 '22 08:08 RudraSwat

@gz83 These changes seem to already be present in features.cc after 687d839.

@RudraSwat Please try to delete the newly added code in lines 1560-1564 in this file and compile again

gz83 avatar Aug 10 '22 08:08 gz83

@gz83 That seems to have resulted in even more linking errors:

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::URLLoaderClientCheckedRemote(mojo::PendingRemote<network::mojom::URLLoaderClient>)
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::ServiceWorkerInstalledScriptLoader(unsigned int, mojo::PendingRemote<network::mojom::URLLoaderClient>, mojo::Remote<storage::mojom::ServiceWorkerResourceReader>, scoped_refptr<content::ServiceWorkerVersion>, GURL const&))
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::ServiceWorkerNewScriptLoader(int, unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>, scoped_refptr<network::SharedURLLoaderFactory>, net::MutableNetworkTrafficAnnotationTag const&, long, bool, content::GlobalRenderFrameHostId const&))
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::ServiceWorkerUpdatedScriptLoader(unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>))

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::Proxy::~Proxy()
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::~ServiceWorkerInstalledScriptLoader())
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::~ServiceWorkerNewScriptLoader())
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::~ServiceWorkerUpdatedScriptLoader())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[1 processes, 2508/2509 @ 1.7/s | 1464.621 sec. ] LINK ./thorium
FAILED: thorium 
python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./thorium" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--version-script=../../build/linux/chrome.map -Werror -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -m64 -Wl,-O3 -mavx -maes -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-import-hot-multiplier=30 -Wl,-mllvm,-import-cold-multiplier=8 -no-canonical-prefixes -Wl,-mllvm,-extra-vectorizer-passes -Wl,-mllvm,-enable-cond-stores-vec -Wl,-mllvm,-slp-vectorize-hor-store -Wl,-mllvm,-enable-loopinterchange -Wl,-mllvm,-enable-loop-distribute -Wl,-mllvm,-enable-unroll-and-jam -Wl,-mllvm,-enable-loop-flatten -Wl,-mllvm,-interleave-small-loop-scalar-reduction -Wl,-mllvm,-unroll-runtime-multi-exit -Wl,-mllvm,-aggressive-ext-opt -Wl,-O3 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -Wl,--lto-O3 -Wl,-rpath=\$ORIGIN -o "./thorium" -Wl,--start-group @"./thorium.rsp" ./libffmpeg.so -Wl,--end-group  -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -latk-1.0 -latk-bridge-2.0 -lcups -lgio-2.0 -ldrm -ldbus-1 -lresolv -lexpat -luuid -lxcb -lxkbcommon -lm -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lgbm -lEGL -lwayland-client -lwayland-server -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lasound -lwayland-egl -lXi -lpci -latspi -lxshmfence
ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::URLLoaderClientCheckedRemote(mojo::PendingRemote<network::mojom::URLLoaderClient>)
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::ServiceWorkerInstalledScriptLoader(unsigned int, mojo::PendingRemote<network::mojom::URLLoaderClient>, mojo::Remote<storage::mojom::ServiceWorkerResourceReader>, scoped_refptr<content::ServiceWorkerVersion>, GURL const&))
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::ServiceWorkerNewScriptLoader(int, unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>, scoped_refptr<network::SharedURLLoaderFactory>, net::MutableNetworkTrafficAnnotationTag const&, long, bool, content::GlobalRenderFrameHostId const&))
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::ServiceWorkerUpdatedScriptLoader(unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>))

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::Proxy::~Proxy()
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::~ServiceWorkerInstalledScriptLoader())
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::~ServiceWorkerNewScriptLoader())
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::~ServiceWorkerUpdatedScriptLoader())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	1520.4  	10104.5
canonicalize str 	8073483	0.1     	749.9
canonicalize path	9244796	0.1     	507.0
lookup node      	9372321	0.1     	1159.4
.ninja_log load  	1     	40823.0 	40.8
.ninja_deps load 	1     	103901.0	103.9
node stat        	192993	1.0     	200.7
depfile load     	339   	21.3    	7.2
StartEdge        	2508  	2259.6  	5667.1
FinishCommand    	2508  	608.1   	1525.1

path->node hash load 0.71 (279618 entries / 393241 buckets)

RudraSwat avatar Aug 10 '22 08:08 RudraSwat

@gz83 That seems to have resulted in even more linking errors:

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::URLLoaderClientCheckedRemote(mojo::PendingRemote<network::mojom::URLLoaderClient>)
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::ServiceWorkerInstalledScriptLoader(unsigned int, mojo::PendingRemote<network::mojom::URLLoaderClient>, mojo::Remote<storage::mojom::ServiceWorkerResourceReader>, scoped_refptr<content::ServiceWorkerVersion>, GURL const&))
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::ServiceWorkerNewScriptLoader(int, unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>, scoped_refptr<network::SharedURLLoaderFactory>, net::MutableNetworkTrafficAnnotationTag const&, long, bool, content::GlobalRenderFrameHostId const&))
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::ServiceWorkerUpdatedScriptLoader(unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>))

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::Proxy::~Proxy()
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::~ServiceWorkerInstalledScriptLoader())
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::~ServiceWorkerNewScriptLoader())
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::~ServiceWorkerUpdatedScriptLoader())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[1 processes, 2508/2509 @ 1.7/s | 1464.621 sec. ] LINK ./thorium
FAILED: thorium 
python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./thorium" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--version-script=../../build/linux/chrome.map -Werror -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -m64 -Wl,-O3 -mavx -maes -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-import-hot-multiplier=30 -Wl,-mllvm,-import-cold-multiplier=8 -no-canonical-prefixes -Wl,-mllvm,-extra-vectorizer-passes -Wl,-mllvm,-enable-cond-stores-vec -Wl,-mllvm,-slp-vectorize-hor-store -Wl,-mllvm,-enable-loopinterchange -Wl,-mllvm,-enable-loop-distribute -Wl,-mllvm,-enable-unroll-and-jam -Wl,-mllvm,-enable-loop-flatten -Wl,-mllvm,-interleave-small-loop-scalar-reduction -Wl,-mllvm,-unroll-runtime-multi-exit -Wl,-mllvm,-aggressive-ext-opt -Wl,-O3 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -Wl,--lto-O3 -Wl,-rpath=\$ORIGIN -o "./thorium" -Wl,--start-group @"./thorium.rsp" ./libffmpeg.so -Wl,--end-group  -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -latk-1.0 -latk-bridge-2.0 -lcups -lgio-2.0 -ldrm -ldbus-1 -lresolv -lexpat -luuid -lxcb -lxkbcommon -lm -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lgbm -lEGL -lwayland-client -lwayland-server -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lasound -lwayland-egl -lXi -lpci -latspi -lxshmfence
ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::URLLoaderClientCheckedRemote(mojo::PendingRemote<network::mojom::URLLoaderClient>)
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::ServiceWorkerInstalledScriptLoader(unsigned int, mojo::PendingRemote<network::mojom::URLLoaderClient>, mojo::Remote<storage::mojom::ServiceWorkerResourceReader>, scoped_refptr<content::ServiceWorkerVersion>, GURL const&))
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::ServiceWorkerNewScriptLoader(int, unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>, scoped_refptr<network::SharedURLLoaderFactory>, net::MutableNetworkTrafficAnnotationTag const&, long, bool, content::GlobalRenderFrameHostId const&))
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::ServiceWorkerUpdatedScriptLoader(unsigned int, network::ResourceRequest const&, mojo::PendingRemote<network::mojom::URLLoaderClient>, scoped_refptr<content::ServiceWorkerVersion>))

ld.lld: error: undefined symbol: content::URLLoaderClientCheckedRemote::Proxy::~Proxy()
>>> referenced by service_worker_installed_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerInstalledScriptLoader::~ServiceWorkerInstalledScriptLoader())
>>> referenced by service_worker_new_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerNewScriptLoader::~ServiceWorkerNewScriptLoader())
>>> referenced by service_worker_updated_script_loader.cc
>>>               lto.tmp:(content::ServiceWorkerUpdatedScriptLoader::~ServiceWorkerUpdatedScriptLoader())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
metric           	count 	avg (us) 	total (ms)
.ninja parse     	6646  	1520.4  	10104.5
canonicalize str 	8073483	0.1     	749.9
canonicalize path	9244796	0.1     	507.0
lookup node      	9372321	0.1     	1159.4
.ninja_log load  	1     	40823.0 	40.8
.ninja_deps load 	1     	103901.0	103.9
node stat        	192993	1.0     	200.7
depfile load     	339   	21.3    	7.2
StartEdge        	2508  	2259.6  	5667.1
FinishCommand    	2508  	608.1   	1525.1

path->node hash load 0.71 (279618 entries / 393241 buckets)

@RudraSwat Please modify the following files, the files are located in the content/browser directory

https://chromium-review.googlesource.com/c/chromium/src/+/3814201/5/content/browser/BUILD.gn

gz83 avatar Aug 10 '22 09:08 gz83

@Alex313031 @gz83

Thanks guys, compiled successfully. Should I close the issue?

RudraSwat avatar Aug 10 '22 17:08 RudraSwat

Thanks @gz83 for helping this guy. @RudraSwat Because Thorium is based on tip-o-tree, stuff changes frequently. You can try to rebase yourself, I've prepared a bookmarks file with all the files Thorium uses bookmarked in the chromium code search with the history pane open. > https://github.com/Alex313031/Thorium/blob/main/infra/thorium_devel_bookmarks.html

Also, we can exchange social info if you want, this way you can tell me when you want to build, and I can sync up my rebases, so that your building doesn't occur days after the last rebase, when multiple files are likely to have changed.

If you want to just rebase a single file, you can use those bookmarks, and I also highly recommend the program meld > https://meldmerge.org/ which can compare local files, directories, and diffs. You can simply sudo apt install meld, it is under 20mb.

Alex313031 avatar Aug 10 '22 18:08 Alex313031

@Alex313031 That's really nice of you :) Do you have a Telegram or Discord? My Telegram is @rs2009 and Discord is rs2009#6116. I'll take a look at meld, thanks!

RudraSwat avatar Aug 11 '22 15:08 RudraSwat

@RudraSwat We also have an IRC set up, its also a quick way to get ahold of me. https://kiwiirc.com/nextclient/#irc://irc.libera.chat:+6697/#thorium

Alex313031 avatar Aug 14 '22 05:08 Alex313031

@RudraSwat Messaged you on telegram.

Alex313031 avatar Aug 23 '22 06:08 Alex313031