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

ninja: error: loading 'build.ninja': No such file or directory #1463

Closed
MRYangY opened this issue Aug 29, 2018 · 45 comments
Closed

ninja: error: loading 'build.ninja': No such file or directory #1463

MRYangY opened this issue Aug 29, 2018 · 45 comments

Comments

@MRYangY
Copy link

MRYangY commented Aug 29, 2018

environment :Mac
Install ninja with the brew intsall ninja command
then on terminal execute ninja occur ninja: error: loading 'build.ninja': No such file or directory 。
➜ ~ ninja
ninja: error: loading 'build.ninja': No such file or directory
➜ ~

Why is this problem still occurring when you have successfully installed ninja?

@mydongistiny
Copy link

Are you just running ninja with no arguments?

@MRYangY
Copy link
Author

MRYangY commented Sep 4, 2018

@mydongistiny yes ! Need to take parameters?

@SrNetoChan
Copy link

I got the same. I have install using apt-get install ninja-build on ubuntu 18.04.

The error occurs with or without arguments

@LuQQiu
Copy link

LuQQiu commented Sep 25, 2018

I have the same issue and also using apt-get install ninja-build on ubuntu 18.04.

@AmjadHD
Copy link

AmjadHD commented Sep 29, 2018

on windows too.

@mydongistiny
Copy link

mydongistiny commented Sep 29, 2018

Depending on what project you're building and what arguments you are using you may need to set

GYP_GENERATORS=ninja

Nobody is giving any other information about full command, project you're trying to build etc. There's a few reasons why you could get this error.

@ThanushreeEG
Copy link

even i have come across this issue.
when i was trying to download fuse

and i get the same error when i give the command ninja or apt-get install ninja
screenshot from 2018-10-10 21-22-06

@mydongistiny
Copy link

@ThanushreeEG what was the output of meson --reconfigure? Did it run ninja for you?

@PkuRainBow
Copy link

@AmjadHD Have you solved this problem? I am also meet this error on Windows.

@jhasse
Copy link
Collaborator

jhasse commented Oct 29, 2018

@ThanushreeEG Does the build.ninja file exist in the CWD though? If not, this sound's like a Meson bug to me.

@jhasse jhasse closed this as completed Nov 7, 2018
@jhasse
Copy link
Collaborator

jhasse commented Nov 7, 2018

To answer the original question:

Why is this problem still occurring when you have successfully installed ninja?

Because Ninja needs a build definition file in the current working directory.

@hyperfraise
Copy link

Same problem on ubuntu 18.04

ninja: error: loading 'build.ninja': No such file or directory
damien@Earth2:~$ meson --reconfigure
Error during basic setup:

Must specify at least one directory name.

@jhasse
Copy link
Collaborator

jhasse commented Nov 16, 2018

@hyperfraise It seems you're running meson in your home directory.

@Praveer1981
Copy link

Praveer1981 commented Dec 23, 2018

I too encounter the same problem when I tried to build LLVM on windows.

cmake -G ninja ../llvm

@hongyx11
Copy link

hongyx11 commented Feb 6, 2019

+1 tried on two mac and install from brew or source, all get error loading

[Solved] Generate build.ninja file first and execute the binary. It works.

@leonsaber
Copy link

I got how to work use gn gen out/Default , then you will find build.ninja file in /out/Default
run ninja under /out/Default

@imshengli
Copy link

I got how to work use gn gen out/Default , then you will find build.ninja file in /out/Default
run ninja under /out/Default

In this case, same error happened. ninja: error: loading 'build.ninja': No such file or directory
We can use -f FILE specify input build file.

@hanzhaogang
Copy link

I got how to work use gn gen out/Default , then you will find build.ninja file in /out/Default
run ninja under /out/Default

What is gn, and how can we get it?

@nix-universe
Copy link

@qingdujun
Copy link

qingdujun commented Mar 3, 2020

same problem~

qingdujun@MacBook-Pro src % gn gen out/Release
ERROR at //third_party/fontconfig/fontconfig.gni:7:1: Assertion failed.
assert(is_linux)
^-----
See //third_party/fontconfig/BUILD.gn:6:1: whence it was imported.
import("//third_party/fontconfig/fontconfig.gni")
^-----------------------------------------------
See //headless/BUILD.gn:200:7: which caused the file to be included.
      "//third_party/fontconfig",
      ^-------------------------




qingdujun@MacBook-Pro src % autoninja -C out/Release/ headless_shell
ninja: Entering directory `out/Release/'
ninja: error: loading 'build.ninja': No such file or directory
Traceback (most recent call last):
  File "/Users/qingdujun/repos/workspace/depot_tools/ninjalog_uploader_wrapper.py", line 118, in <module>
    sys.exit(main())
  File "/Users/qingdujun/repos/workspace/depot_tools/ninjalog_uploader_wrapper.py", line 76, in main
    config = LoadConfig()
  File "/Users/qingdujun/repos/workspace/depot_tools/ninjalog_uploader_wrapper.py", line 31, in LoadConfig
    'chromium-build-stats.appspot.com'),
  File "/Users/qingdujun/repos/workspace/depot_tools/ninjalog_uploader.py", line 44, in IsGoogler
    _, content = h.request('https://'+server+'/should-upload', 'GET')
  File "/Users/qingdujun/.vpython-root/867170/lib/python2.7/site-packages/httplib2/__init__.py", line 1659, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/Users/qingdujun/.vpython-root/867170/lib/python2.7/site-packages/httplib2/__init__.py", line 1399, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/Users/qingdujun/.vpython-root/867170/lib/python2.7/site-packages/httplib2/__init__.py", line 1355, in _conn_request
    response = conn.getresponse()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1108, in getresponse
    raise ResponseNotReady()
httplib.ResponseNotReady

@qingdujun
Copy link

Building on Mac only works without headless.gn.

The reason for that is that the headless windowing system (ozone's headless platform in particular) that we use on Linux/Win and is configured in headless.gn isn't yet supported on Mac.

On Wed, Aug 9, 2017, 17:04 brandon.kobel via headless-dev headle...@chromium.org wrote:
When attempting to build the headless-shell on mac and performing the following step from Usage as a C++ library:

@agalod
Copy link

agalod commented Jul 30, 2020

In case of building Chromium, try generating build.ninja with gn gen out/Default in directory src.

@xiaozhiming2233
Copy link

the same problem on ubuntu 18.04

@twitchplaystrading
Copy link

Same on MX Linux 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1. I've tried to use ninja on and debian and arch. Got it barely working on arch but no avail in debian.

@Tekh-ops
Copy link

Is there a fix for this

@erichodges
Copy link

erichodges commented May 8, 2021

OS X 11.3 I also have this issue. It's unclear to me how to fix this. I don't understand why this was closed as I don't see a clear fix above.

I saw this comment:
[Solved] Generate build.ninja file first and execute the binary. It works.

Ok, how do I generate the build.ninja file and where does it go? What binary do I need to execute and where is it?

@kbot
Copy link

kbot commented May 11, 2021

For anyone still finding this thread first in search results, the solution here worked for me google/filament#1810

@Akhil564
Copy link

Hi, in the process of installing GTK stress testing tool i need to do install dependencies. but when I am executing with ninja command i am getting an issue...anyone could you please help me out.. thanks in advance.

following are the dependencies need to install....
git clone --recurse-submodules -j4 https://gitlab.com/leinardi/gst.git
cd gst
git checkout release
pip3 install -r requirements.txt
meson . build --prefix /usr
ninja -v -C build
ninja -v -C build install

getting an issue with ninja
#ninja -v -C build
ninja: Entering directory `build'
ninja: fatal: chdir to 'build' - No such file or directory

@ashokkaladi
Copy link

environment :Mac
Install ninja with the brew intsall ninja command
then on terminal execute ninja occur ninja: error: loading 'build.ninja': No such file or directory 。
➜ ~ ninja
ninja: error: loading 'build.ninja': No such file or directory
➜ ~

Why is this problem still occurring when you have successfully installed ninja?

Did you try to locate the build.ninja file and run ninja in that folder?

@ThisIsMython
Copy link

this problem still there

@passos
Copy link

passos commented Apr 16, 2022

~ ❯ brew reinstall ninja
==> Downloading https://ghcr.io/v2/homebrew/core/ninja/manifests/1.10.2_1
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/3d885b06ee8943649e1e4f3edebcca2003dc2e9e332202cc2a0b16ccce4f8cae--ninja-1.10.2_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/ninja/blobs/sha256:b3e0b14cffa2d227c0b4140c1a3742a2a4e7e3966a429e1d253b0e29acfb6293
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/ecdaa7d4e110c91481ede9ce38cf5a8fd3b025c3943ec3efefc1c4ff99b0fc6e--ninja--1.10.2_1.big_sur.bottle.tar.gz

~ ❯ ninja
ninja: error: loading 'build.ninja': No such file or directory

macOS 11.6.1

@Arthur151
Copy link

Arthur151 commented May 6, 2022

I have successfully fix this, finally!!!!!

If you follow the README of https://github.com/ninja-build/ninja to build the ninja from source, then you can use command like ninja -v just inside the ninja folder, you will see the build.ninja file just in there.

To use ninja in other place, I copy and paste all ninja files (not include the build folder and other txt files) to where I want to use ninja command.

B.T.W., if this is helpful to you, could you please visit my own repositories? Maybe there are something interesting.

@gmolkho
Copy link

gmolkho commented Nov 28, 2022

At U20 was resolved for me only when using "pip install ninja" rather than "sudo apt install ninja-build"

@HriGrit
Copy link

HriGrit commented Apr 3, 2023

I got how to work use gn gen out/Default , then you will find build.ninja file in /out/Default
run ninja under /out/Default

In this case, same error happened. ninja: error: loading 'build.ninja': No such file or directory We can use -f FILE specify input build file.

Can you show how the command line code will look like?

@razeek-j
Copy link

razeek-j commented May 7, 2023

i got the solution

just type : sudo apt install generate-ninja

that's it

@Gamer069
Copy link

Gamer069 commented Jul 7, 2023

In case of build

i have the same problem, and i already did that ofc, the out/Default directory exists, gn gen out/Default didn't provide any output, autoninja -C out/Default complains about the build.ninja file not being a thing in the directory, (I double-checked, yeah it doesn't exist.), also i'm doing this on ubuntu.

@Gamer069
Copy link

Gamer069 commented Jul 7, 2023

sudo apt install generate-ninja

that doesn't work for me.

@morebray
Copy link

Lösung für MACos
cp /Users/username/gst/build/build.ninja /usr/local/Cellar/ninja/1.11.1/bin
dann
ninja -v

@haciMMicah
Copy link

sudo apt install generate-ninja

that doesn't work for me.

You probably just have the generated build.ninja file in a different directory.

@IceAsteroid
Copy link

IceAsteroid commented Sep 5, 2023

The output of meson setup build said the system lacks some dependencies.

something like "meson.build:72:8: ERROR: Dependency "xcb-aux" not found, tried pkgconfig and cmake"

After installing those critical packages or just simply disabling the functionalities, I managed to run ninja -C build successfully.

@nguyenph194812
Copy link

is there a fix for this, i met this problem when running vcpkg installation
image

@tunm1228
Copy link

You try gn gen out/debug --args='import("//with_pw_rpc.gni")'
image

@manojgit31792
Copy link

~/AndroidStudioProjects/COAT
$ sudo apt install generate-ninja
bash: sudo: command not found

I am getting this error when trying to install on android studio by using git bash. Can anyone help how to solve this?

@ramardoautistin
Copy link

i am going insane trying to compile aseprite on linux cause i keep getting this exact same error even after supposedly installing ninja :/

@LuftRev
Copy link

LuftRev commented Mar 7, 2024

i am going insane trying to compile aseprite on linux cause i keep getting this exact same error even after supposedly installing ninja :/

Likewise but on mac, I'm not a dev in any way shape or form so this all basically moon runes to me. Rather infuriating...

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