thorium icon indicating copy to clipboard operation
thorium copied to clipboard

Build Issues

Open InventorXtreme opened this issue 2 years ago • 5 comments

System Details

  • OS: Arch Linux
  • Thorium Version [e.g.118.0.5993.177]

Problem Unable to generate ninja build files. All attempts to run gn args out/thorium result in

Waiting for editor on "/mnt/linuxextrassd/chromium/src/out/thorium/args.gn"...
Generating files...
ERROR at //build/config/compiler/BUILD.gn:183:15: Duplicate build argument declaration.
  use_cxx17 = false
              ^----
Here you're declaring an argument that was already declared elsewhere.
You can only declare each argument once in the entire build so there is one
canonical place for documentation and the default value. Either move this
argument to the build config file (for visibility everywhere) or to a .gni file
that you "import" from the files where you need it (preferred).
See //build_overrides/build.gni:61:15: Previous declaration.
  use_cxx17 = false
              ^----
See also "gn help buildargs" for more on how build arguments work.
See //build/config/BUILDCONFIG.gn:334:3: which caused the file to be included.
  "//build/config/compiler:afdo_optimize_size",
  ^-------------------------------------------

Please note that the file referenced on the last line of the error changes each run.

Additional Notes I have recloned multiple times and followed word for word the instructions in the build guide.

InventorXtreme avatar Dec 20 '23 02:12 InventorXtreme

There seems to be an error occurring with circular references, and you need to make sure that there is only one copy of the full clone of the Chromium source code on the device, and that all dependencies are pulled.

Also, it is recommended to use Ubuntu as well as Debian systems for compilation.

@InventorXtreme

gz83 avatar Dec 20 '23 11:12 gz83

Is there any way to sort out the circular references? I really don't want to spin up a VM and reclone everything for the fourth time. Thanks for the response by the way.

InventorXtreme avatar Dec 21 '23 04:12 InventorXtreme

Ok, by manually setting the version in the version script to the version in the releases page I got past the gn script, but now am unable to build because clang is not recognizing x86_64-v3 as a real arch. I will probably try to reclone everything tomorrow.

InventorXtreme avatar Dec 21 '23 05:12 InventorXtreme

@InventorXtreme What you should do is follow the chromium documentation up to the point where it wants you to do the gn gen out . You should not use the --shallow flag during `fetch --no-hooks chromium, so that you get the full git history. At that point, then: (assuming depot_tools, the thorium repo, and the chromium repo are in $HOME).

Run ./trunk.sh to fetch tags and full git history, as well as update your chromium checkout. Run ./version.sh to check out the Chromium repo at the revision Thorium is currently at. Run ./setup.sh --help. This will show you the flags that can be used for the different platforms. For regular linux, you can run setup.sh with no arguments. For an AVX2 build like what you are wanting, use setup.sh --avx2

After this you can manually run gn args out/thorium, and use the args.gn appropriate for the platform. Make sure to update the PGO Profile location and version at the bottom, and you can add API Keys at the top if you wish.

Then you can either use the build scripts (build.sh, build_win.sh, etc.) to build for your platform. The scripts take one integer afterwards to tell ninja how many jobs to spawn.

For example, to build thorium for linux on an 8 core sysytem:

./build.sh 8

Alex313031 avatar Dec 29 '23 18:12 Alex313031

@InventorXtreme I updated the docs, see > https://thorium.rocks/docs/building.html

Alex313031 avatar Feb 21 '24 23:02 Alex313031