Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Issues #477

Closed
InventorXtreme opened this issue Dec 20, 2023 · 5 comments
Closed

Build Issues #477

InventorXtreme opened this issue Dec 20, 2023 · 5 comments

Comments

@InventorXtreme
Copy link

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.

@gz83
Copy link
Collaborator

gz83 commented Dec 20, 2023

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

@InventorXtreme
Copy link
Author

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
Copy link
Author

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.

@Alex313031
Copy link
Owner

Alex313031 commented Dec 29, 2023

@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
Copy link
Owner

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

@gz83 gz83 closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants