Repository navigation
Ninja not working to compile engine #163487
Description
Hello,
I've always complied the engine locally on my machine, today is the first time I try to compile it after it has been moved in flutter/flutter repo.
The problem is that I'm not able to compile it anymore, because of a problem with Ninja
I follow the instruction to compile the engine as described here
https://github.com/flutter/flutter/blob/master/engine/src/flutter/docs/contributing/Compiling-the-engine.md
I have this error
depot_tools/ninja.py: Could not find Ninja in the third_party of the current project, nor in your PATH.
Please take one of the following actions to install Ninja:
- If your project has DEPS, add a CIPD Ninja dependency to DEPS.
- Otherwise, add Ninja to your PATH *after* depot_tools.
I guess it's because there are something wrong with the settings of gclient, depot_tools etc...
I've put my .gclient file in flutter/flutter (the root) as indicated here https://github.com/flutter/flutter/blob/master/engine/src/flutter/docs/contributing/Setting-up-the-Engine-development-environment.md
The gclient sync -D run correctly
I've tried to read the code of ninja.py inside depot_tools and, as far as I understand, there is no way that Ninja can work with this folders setup
But I'm not expert enough to really understand what's wrong
Is this my problem? Or there really are something wrong since the engine has been moved?
Activity
huycozy commentedon Feb 18, 2025
Hi @GiacomoPignoni
Currently, I'm setting
depot_toolsto.zshrc(i'm using macOS) as:Thus,
ninjaorgclientis available on my end:Please make sure you added
depot_toolsto your path and check Getting dependencies for more info.GiacomoPignoni commentedon Feb 18, 2025
Hello @huycozy
I have
depot_toolsin my PATH (I'm also on macOS)I'm able to run the
ninjascript insidedepot_toolsThe problem is that the
ninjapy script go to findninjasource code insidethird_partyfolder, but is not able to do it with the current folders setupThe only way I found to use
ninjais to install it with brew, but is not as it always beenWhen the engine was in old repository,
ninjasource code was taken from thethird_partyfolder. So it wasn't necessary to install it separately.I don't know if now is intended to work like this, but in this case the documentation should be updated, because is not indicated to install ninja separately
huycozy commentedon Feb 19, 2025
Thanks for the update. Do you see any error or warning when executing
gclient synccommand? Can you please also share.gclientfile content?GiacomoPignoni commentedon Feb 19, 2025
There are no errors or warnings when executing
gclient syncThis is the
.gclient filehuycozy commentedon Feb 19, 2025
Thanks for the updates. I can also reproduce this on Flutter stable
3.29.0and master versions3.30.0-1.0.pre.191.Flutter versions (stable and master)
4 remaining items
GiacomoPignoni commentedon Feb 21, 2025
@jonahwilliams
You have 2 ninja because the one inside
depot_toolsisn't the real one, it's just a script that go to find the real one insidethird_partyfolder@huycozy
Yes adding it to PATH from the
third_partyfolder works, but I don't think this is the right solution.When the
enginewas in the old repo,ninjawas automatically taken fromthird_partyfolder by the script insidedepot_tools, without the need to add it to the PATH.With this way a new configuration step is needed, I think a better solution is to make it work like before. However, I don't know enough about
gclientanddepot_toolsto know how to do it. I think it's just a configuration problem.Otherwise, if it has to stay like this, the documentation needs to be updated to include this extra step.
Add a buildtools directory and move third_party/ninja to the project …
Add a buildtools directory and move third_party/ninja to the project …
Add a buildtools directory and move third_party/ninja to the project …
Add a buildtools directory and move third_party/ninja to the project …
Add a buildtools directory and move third_party/ninja to the project …
Reverts "Add a buildtools directory and move third_party/ninja to the…
github-actions commentedon Mar 13, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.