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 package installs a broken ninja command #31

Closed
1 task done
PythonCHB opened this issue Feb 19, 2023 · 2 comments
Closed
1 task done

ninja package installs a broken ninja command #31

PythonCHB opened this issue Feb 19, 2023 · 2 comments
Labels

Comments

@PythonCHB
Copy link

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

Installing ninja does not result in a functional ninja command:

(junk) chris@Chris-MacBook pytype % conda list ninja
# packages in environment at /Users/chris/miniconda3/envs/junk:
#
# Name                    Version                   Build  Channel
ninja                     1.11.0               h1b54a9f_0    conda-forge
(junk) chris@Chris-MacBook pytype % ninja
ninja: error: loading 'build.ninja': No such file or directory

NOTE: this example is with a bare-bones environment -- but I'm had teh same issue using it with other environments, e.g, with pytype (also broken:-( )

Installed packages

% conda list
# packages in environment at /Users/chris/miniconda3/envs/junk:
#
# Name                    Version                   Build  Channel
libcxx                    14.0.6               hccf4f1f_0    conda-forge
ninja                     1.11.0               h1b54a9f_0    conda-forge

Environment info

% conda info

     active environment : junk
    active env location : /Users/chris/miniconda3/envs/junk
            shell level : 1
       user config file : /Users/chris/.condarc
 populated config files : /Users/chris/.condarc
          conda version : 22.9.0
    conda-build version : not installed
         python version : 3.9.13.final.0
       virtual packages : __osx=11.6.2=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/chris/miniconda3  (writable)
      conda av data dir : /Users/chris/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/chris/miniconda3/pkgs
                          /Users/chris/.conda/pkgs
       envs directories : /Users/chris/miniconda3/envs
                          /Users/chris/.conda/envs
               platform : osx-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Darwin/20.6.0 OSX/11.6.2
                UID:GID : 501:20
             netrc file : None
           offline mode : False
@PythonCHB PythonCHB added the bug label Feb 19, 2023
@PythonCHB PythonCHB changed the title ninja pacakge installs a broken ninja command ninja package installs a broken ninja command Feb 19, 2023
@eli-schwartz
Copy link

NOTE: this example is with a bare-bones environment -- but I'm had teh same issue using it with other environments, e.g, with pytype (also broken:-( )

The pytype problem is claiming that no "ninja" module exists when trying to run python -m ninja (this attempts to import ninja as a python package, then run its __main__ entrypoint.

This error is reporting that ninja ran successfully, but the purpose of ninja is to load a file called build.ninja and evaluate it as a kind of Makefile. And that file didn't exist, so it had nothing to do.

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

$ ninja -f custom_rules.ninja
ninja: error: loading 'custom_rules.ninja': No such file or directory

$ python myscript.py
python: can't open file '/tmp/myscript.py': [Errno 2] No such file or directory

It's all the same class of error -- but neither python nor ninja is broken just because the file it tries to load doesn't exist.

(But ninja has a default file it will load if you don't pass -f to it. Python doesn't have a default file, it just opens an interactive REPL.)

@PythonCHB
Copy link
Author

My mistake -- pardon my ignorance.

Closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants