Skip to content

Ninja not working to compile engine #163487

Description

@GiacomoPignoni

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

  1. added
    in triagePresently being triaged by the triage team
    on Feb 18, 2025
  2. huycozy commented on Feb 18, 2025

    @huycozy
    Member

    Hi @GiacomoPignoni
    Currently, I'm setting depot_tools to .zshrc (i'm using macOS) as:

    export PATH=/Users/huynq/Documents/GitHub/depot_tools:$PATH
    

    Thus, ninja or gclient is available on my end:

    ➜  ~ which Ninja
    /Users/huynq/Documents/GitHub/depot_tools/Ninja
    ➜  ~ which gclient
    /Users/huynq/Documents/GitHub/depot_tools/gclient

    Please make sure you added depot_tools to your path and check Getting dependencies for more info.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 18, 2025
  4. GiacomoPignoni commented on Feb 18, 2025

    @GiacomoPignoni
    Author

    Hello @huycozy
    I have depot_tools in my PATH (I'm also on macOS)
    I'm able to run the ninja script inside depot_tools

    The problem is that the ninja py script go to find ninja source code inside third_party folder, but is not able to do it with the current folders setup
    The only way I found to use ninja is to install it with brew, but is not as it always been
    When the engine was in old repository, ninja source code was taken from the third_party folder. 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

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 18, 2025
  6. huycozy commented on Feb 19, 2025

    @huycozy
    Member

    Thanks for the update. Do you see any error or warning when executinggclient sync command? Can you please also share .gclient file content?

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 19, 2025
  8. GiacomoPignoni commented on Feb 19, 2025

    @GiacomoPignoni
    Author

    There are no errors or warnings when executing gclient sync

    This is the .gclient file

    solutions = [
      {
        "managed": False,
        "name": ".",
        "url": "https://github.com/plx-tech/flutter.git",
        "custom_deps": {},
        "deps_file": "DEPS",
        "safesync_url": "",
        "custom_vars": {
          "download_emsdk": True,
        },
      },
    ]
    
  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 19, 2025
  10. huycozy commented on Feb 19, 2025

    @huycozy
    Member

    Thanks for the updates. I can also reproduce this on Flutter stable 3.29.0 and master versions 3.30.0-1.0.pre.191.

    Flutter versions (stable and master)
    [✓] Flutter (Channel stable, 3.29.0, on macOS 15.3.1 24D70 darwin-x64, locale en-VN) [701ms]
        • Flutter version 3.29.0 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 35c388afb5 (2 days ago), 2025-02-10 12:48:41 -0800
        • Engine revision f73bfc4522
        • Dart version 3.7.0
        • DevTools version 2.42.2
    [!] Flutter (Channel master, 3.30.0-1.0.pre.191, on macOS 15.3.1 24D70 darwin-x64, locale en-VN) [1,988ms]
        • Flutter version 3.30.0-1.0.pre.191 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision c7047d33c4 (24 hours ago), 2025-02-15 21:56:27 -0500
        • Engine revision c7047d33c4
        • Dart version 3.8.0 (build 3.8.0-91.0.dev)
        • DevTools version 2.43.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
  11. added
    engineflutter/engine related. See also e: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Feb 19, 2025
  12. 4 remaining items

  13. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 21, 2025
  14. GiacomoPignoni commented on Feb 21, 2025

    @GiacomoPignoni
    Author

    @jonahwilliams
    You have 2 ninja because the one inside depot_tools isn't the real one, it's just a script that go to find the real one inside third_party folder

    @huycozy
    Yes adding it to PATH from the third_party folder works, but I don't think this is the right solution.
    When the engine was in the old repo, ninja was automatically taken from third_party folder by the script inside depot_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 gclient and depot_tools to 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.

  15. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 21, 2025
  16. added
    P2Important issues not at the top of the work list
    on Feb 24, 2025
  17. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 27, 2025
  18. github-actions commented on Mar 13, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  19. locked as resolved and limited conversation to collaborators on Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: local-engine-developmentLocal builds of the engine working betterengineflutter/engine related. See also e: labels.found in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions