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 failed for MacOS #362

Closed
downlz opened this issue Oct 28, 2023 · 9 comments
Closed

Build failed for MacOS #362

downlz opened this issue Oct 28, 2023 · 9 comments

Comments

@downlz
Copy link

downlz commented Oct 28, 2023

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

@gz83
Copy link
Collaborator

gz83 commented Oct 28, 2023

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

@midzer
Copy link
Collaborator

midzer commented Oct 28, 2023

@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

@downlz
Copy link
Author

downlz commented Oct 28, 2023

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

@midzer
Copy link
Collaborator

midzer commented Oct 28, 2023

@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 :)

@downlz
Copy link
Author

downlz commented Nov 3, 2023

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

@gz83
Copy link
Collaborator

gz83 commented Nov 3, 2023

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

@midzer
Copy link
Collaborator

midzer commented Nov 14, 2023

@Alex313031
Copy link
Owner

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

@midzer
Copy link
Collaborator

midzer commented Feb 21, 2024

@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.

@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

4 participants