thorium icon indicating copy to clipboard operation
thorium copied to clipboard

Build failed for MacOS

Open downlz opened this issue 2 years ago • 9 comments

System Details

  • OS: [Mac 14.0]
  • Thorium Version [118.xx]

Problem The build instructions is not specific to Mac mentioned over here https://github.com/Alex313031/thorium/blob/main/docs/BUILDING_MAC.md Specific instruction would help to support release of thorium build for MacOS for the broader community

Additional Notes Below are the steps followed:

  1. Get latest chrome src to $HOME directory
  2. Get depot_tools to $HOME directory
  3. Get thorium to $HOME directory
  4. Run reset_depot_tools.sh (Edit bashrc to zshrc based on your settings)
  5. Run version.sh
  6. Run trunk.sh (NA for Mac)
  7. Run setup.sh
  8. Run build_mac.sh

Failed in build_mac.sh: Building Thorium for MacOS...

/Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Users/shahnawaz/depot_tools/ninja.py -C out/thorium chrome chromedriver -j -d stats ninja: fatal: invalid -j parameter

downlz avatar Oct 28 '23 13:10 downlz

I think the relevant instructions are sufficient, and if you follow the steps, you should not have the problems you encountered.

Also, why are you running reset_depot_tools.sh? For the sh script that cannot be executed on your side, have you tried manually executing the commands inside?

We are also currently trying to resolve linker errors that occurred during compilation of the MacOS version

gz83 avatar Oct 28 '23 13:10 gz83

@downlz Hi. I guess you're trying to build Thorium M117 (xx.157) according to current version.sh script.

Your instructions look correct, except:

  • running setup.sh --mac
  • afterwards gn args out/thorium with
target_os = "mac"
target_cpu = "arm64"

as minimal argument input for M1 (and x64 in target_cpu for non-M1 mac).

Finally, you should be able to build with

autoninja -c out/thorium -j8 (8 = Build threads)

This info is from my memory. If you connect to #thorium IRC channel, we can sort things out further.

Happy weekend midzer

midzer avatar Oct 28 '23 16:10 midzer

@midzer I am checking it. Would you help with IRC channel link so that I can join the same.

downlz avatar Oct 28 '23 18:10 downlz

@downlz You can either follow https://thorium.rocks/irc/ for a connection in your browser. Or use an IRC client and connect to libera.chat with channel name #thorium. See you there :)

midzer avatar Oct 28 '23 20:10 midzer

I tried running build_mac.sh and now getting stuck in final stage: Log from ./setup.sh --mac: Exporting variables and setting handy aliases...

export NINJA_SUMMARIZE_BUILD=1 export EDITOR=nano export VISUAL=nano

alias origin = git checkout -f origin/main alias gfetch = git fetch --tags alias rebase = git rebase-update alias gsync = gclient sync --with_branch_heads --with_tags -f -R -D alias args = gn args out/thorium alias gnls = gn ls out/thorium alias show = git show-ref alias runhooks = gclient runhooks alias pgo = python3 tools/update_pgo_profiles.py --target=linux update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgow = python3 tools/update_pgo_profiles.py --target=win64 update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgom = python3 tools/update_pgo_profiles.py --target=mac update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgomac-arm = python3 tools/update_pgo_profiles.py --target=mac-arm update --gs-url-base=chromium-optimization-profiles/pgo_profiles


|____ \ |\ \ \ \ |\ __ \ |\ __ \ |\ \ |\ \ \ \ |\ __ __ \
|
\ _| \ \ _\ \ \ \ \ \ \ \ \ _\ \ \ \ \ \ \ \ \ \ \ \ \ _\ \ \
\ \ \ \ \ __ \ \ \ \ \ \ \ \ _ \ \ \ \ \ \ \ \ \ \ \ |__|\ \ \
\ \ \ \ \ \ \ \ \ \ _\ \ \ \ \ \ \ \ \ \ \ _\ \ \ \ \ \ \ \
\ _
\ \ _\ _\ \ _\ \ _\ \ \ _\ \ _\ \ _\ \ _\ || |||__| || |||| |__| |_| || ||

Enjoy Thorium!

shahnawaz@Shahnawazs-Mac thorium % ./build_mac.sh 8

Building Thorium for MacOS...

/Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Users/shahnawaz/depot_tools/ninja.py -C out/thorium chrome chromedriver -j8 -d stats ninja: Entering directory `out/thorium' ninja: error: loading 'build.ninja': No such file or directory

How can I proceed now? @midzer @Alex313031

downlz avatar Nov 03 '23 06:11 downlz

I tried running build_mac.sh and now getting stuck in final stage: Log from ./setup.sh --mac: Exporting variables and setting handy aliases...

export NINJA_SUMMARIZE_BUILD=1 export EDITOR=nano export VISUAL=nano

alias origin = git checkout -f origin/main alias gfetch = git fetch --tags alias rebase = git rebase-update alias gsync = gclient sync --with_branch_heads --with_tags -f -R -D alias args = gn args out/thorium alias gnls = gn ls out/thorium alias show = git show-ref alias runhooks = gclient runhooks alias pgo = python3 tools/update_pgo_profiles.py --target=linux update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgow = python3 tools/update_pgo_profiles.py --target=win64 update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgom = python3 tools/update_pgo_profiles.py --target=mac update --gs-url-base=chromium-optimization-profiles/pgo_profiles alias pgomac-arm = python3 tools/update_pgo_profiles.py --target=mac-arm update --gs-url-base=chromium-optimization-profiles/pgo_profiles

|____ \ |\ \ \ \ |\ __ \ |\ __ \ |\ \ |\ \ \ \ |\ __ __ \ | \ __| \ \ _\ \ \ \ \ \ \ \ \ _\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ __ \ \ \ \ \ \ \ \ _ _\ \ \ \ \ \ \ \ \ \ \ ||\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ __\ \ __\ __\ \ __**\ \ \ \ \ \ \ _**\ \ __\ \ \ || |||| |**| |||| || |**| || ||

Enjoy Thorium!

shahnawaz@Shahnawazs-Mac thorium % ./build_mac.sh 8

Building Thorium for MacOS...

/Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Users/shahnawaz/depot_tools/ninja.py -C out/thorium chrome chromedriver -j8 -d stats ninja: Entering directory `out/thorium' ninja: error: loading 'build.ninja': No such file or directory

How can I proceed now? @midzer @Alex313031

The general process of compilation:

  1. Get full Chromium code checkout

  2. Get the complete Thorium code and submodules

  3. Make sure the system meets the requirements for compiling Chromium

  4. Use trunk.sh to update code checkout

  5. Use version.sh to switch to the correct code branch

  6. Use setup.sh --mac to copy the files required by Thorium to the Chromium code

  7. Execute the gn args out/thorium command in the chromium/src directory and fill in the correct args parameters to ensure that the target files required for compilation can be generated normally.

https://github.com/Alex313031/thorium/blob/main/other/Mac/mac_ARM_args.gn

https://github.com/Alex313031/thorium/blob/main/other/Mac/mac_args.gn

  1. Build Thorium using build_mac.sh

I don't know whether MacOS requires depot_tools. If you need depot_tools, you also need to obtain depot_tools in advance.

@downlz

gz83 avatar Nov 03 '23 08:11 gz83

You need depot_tools, reference https://chromium.googlesource.com/chromium/src/+/main/docs/mac_build_instructions.md

midzer avatar Nov 14 '23 21:11 midzer

@downlz I updated the docs, see > https://thorium.rocks/docs/building_mac.html

Alex313031 avatar Feb 21 '24 23:02 Alex313031

@Alex313031 ./setup.sh --mac-arm does not exist in https://github.com/Alex313031/thorium/blob/main/setup.sh

I use ./setup.sh --mac for ARM and x64. Works for me.

midzer avatar Feb 21 '24 23:02 midzer