Build failed for MacOS
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:
- Get latest chrome src to $HOME directory
- Get depot_tools to $HOME directory
- Get thorium to $HOME directory
- Run reset_depot_tools.sh (Edit bashrc to zshrc based on your settings)
- Run version.sh
- Run trunk.sh (NA for Mac)
- Run setup.sh
- 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
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
@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/thoriumwith
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 I am checking it. Would you help with IRC channel link so that I can join the same.
@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 :)
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
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:
-
Get full Chromium code checkout
-
Get the complete Thorium code and submodules
-
Make sure the system meets the requirements for compiling Chromium
-
Use trunk.sh to update code checkout
-
Use version.sh to switch to the correct code branch
-
Use setup.sh --mac to copy the files required by Thorium to the Chromium code
-
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
- 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
You need depot_tools, reference https://chromium.googlesource.com/chromium/src/+/main/docs/mac_build_instructions.md
@downlz I updated the docs, see > https://thorium.rocks/docs/building_mac.html
@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.