ungoogled-software / ungoogled-chromium-windows

Windows packaging for ungoogled-chromium
BSD 3-Clause "New" or "Revised" License
1.12k stars 112 forks source link

ninja: error: unknown target 'gn'. I got the same error, can anyone tell me how to fix it? #189

Closed hoanghiep1x0 closed 1 year ago

hoanghiep1x0 commented 1 year ago
./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles -j4 -o out/Default/
ninja: error: unknown target 'gn'
ninja: Entering directory `C:\Users\MACBOOK\ungoogled-chromium\build\src\out\Release\gn_build'
Traceback (most recent call last):
  File "./tools/gn/bootstrap/bootstrap.py", line 144, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./tools/gn/bootstrap/bootstrap.py", line 127, in main
    [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', '-j'+str(options.jobs), 'gn'])
  File "C:\tools\python2\lib\subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', '-C', 'C:\\Users\\MACBOOK\\ungoogled-chromium\\build\\src\\out\\Release\\gn_build', '-w', 'dupbuild=err', '-j4', 'gn']' returned non-zero exit status 1

i tried almost every tutorial but don't know how to debug.

Nifury commented 1 year ago

You need to follow the build instruction in this repo: https://github.com/ungoogled-software/ungoogled-chromium-windows

hoanghiep1x0 commented 1 year ago

@Nifury I tried following all the instructions but got the same error. I tried to fix it many times before asking..

Nifury commented 1 year ago

./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles -j4 -o out/Default/ indicates you are using ungoogled-chromium repo instead of ungoogled-chromium-windows.

hoanghiep1x0 commented 1 year ago

@Nifury Yes. An error similar to ungoogled-chromium-windows and I try to reproduce the problem by separating the run statement with ungoogled-chromium. A similar error is emitted.

hoanghiep1x0 commented 1 year ago

I also try to create virtual machine and try setting "Setup Prerequisites for Build"

Theater at an error as such as when typing py build.py

teeminus commented 1 year ago

Can you please post the output of the command py --version?

teeminus commented 1 year ago

Based on your deleted comment: Do you use cmd.exe or the Developer Command Prompt for VS?

hoanghiep1x0 commented 1 year ago

@teeminus can you refer to help me C:\Users\Administrator>python --version Python 3.8.10 C:\Users\Administrator>where python C:\tools\python3\python.exe C:\Users\Administrator>python3 --version Python 3.8.10 system variable has been added as instructed: vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10 GYP_MSVS_VERSION=2019 I'm trying to re-initialize the problem. There's been a problem with windowskits/10/include/10.0.20348.0 I'll get back to you.

hoanghiep1x0 commented 1 year ago

i use "cmd" run with adminitrator

teeminus commented 1 year ago

Try using the Developer Command Prompt for VS.

hoanghiep1x0 commented 1 year ago

Sorry I already know where the problem is depot_tools and path run command ungoogled-software not by ungoogled-software-windows.

  1. is because python3 and depot_tools path of depot_tools on top position environment variable. according to instructions depot_tools is deprecated as google_chromium build.
  2. is because the windowkit version with the appropriate OS does not exist. windowkit/10/19045.2251 is loaded automatically while os is 20348.288.
  3. should run with "cmd.exe administrator"

C:\Users\Administrator>python --version Python 3.8.10 C:\Users\Administrator>where python C:\tools\python3\python.exe C:\Users\Administrator>python3 --version Python 3.8.10

system variable has been added as instructed: vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10 GYP_MSVS_VERSION=2019

Note exists OS version build when installing with Microsoft Visual Studio. "C:\Program Files (x86)\Windows Kits\10\ + OS_VERSION".

then run the command in cmd.exe (as administrator):

git clone --recurse-submodules https://github.com/ungoogled-software/ungoogled-chromium-windows.git

cd ungoogled-chromium-windows

py build.py

then it should work properly.

Sorry for wasting your time, thanks for your help.

joja16 commented 1 year ago

Are you still developing using VS2019?