Giter Site home page Giter Site logo

command not found: gn about skia HOT 2 OPEN

aseprite avatar aseprite commented on September 24, 2024
command not found: gn

from skia.

Comments (2)

ralgernon avatar ralgernon commented on September 24, 2024

A Bit of Background

GN is what generates the build files for Ninja. In the terminal, we've been typing or pasting in commands to run different executable files which the shell of our operating system then reads and executes. Our operating system has a variable called $PATH where it keeps a list of directories of all these files, separated by a colon. This resets every time your computer restarts or there's a new terminal instance.

Where to Look

When curious about what that list looks like, I like to use the echo command in the terminal like so:
echo $PATH

We'll see something like /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin, which are the usual suspects for where to find commands. We edit this using export. In the Aseprite Mac OS instructions, we used:
export PATH="${PWD}/depot_tools:${PATH}"

Which can be translated to:

"Dear shell,
Please check the directories in the $PATH variable list for a command called export.
Execute that to include the depot_tools directory found in the present working directory (PWD, which directory this command is being called from) in my $PATH at the beginning. I want this directory searched first for commands until I close this terminal or restart my computer. Finally, put back all the directories that were in the $PATH list at the end, so you know where else to look if a command isn't found in depot_tools."

The Problem

Your shell has replied that it couldn't find gn in all the directories listed in $PATH, which should have included where the depot_tools was installed after running the above command from the /home/your_user_name/deps directory. When you run echo $PATH, before the first colon should be /home/your_user_name/deps/depot_tools with your actual user name substituted in, so your shell checks the first directory cloned with Git.

Troubleshoot

ls ~/deps/depot_tools/ | grep gn
This command will ask your shell to print all files whose names contain "gn" inside the correct directory. If you get a gn in your response, move ahead to the PATH section. If nothing shows up, run:
ls ~/deps | grep depot_tools
to make sure depot_tools was installed in the right place. If nothing again, you might have missed the step to cd (change directories) to the newly made deps and installed depot_tools and skia to your home directory by accident. The following commands will copy them from home ("~") to the deps directory and delete the misplaced originals:
cp -R ~/depot_tools deps && rm -rf ~/depot_tools
cp -R ~/skia deps && rm -rf ~/skia

PATH to Success

Hopefully you are in the /home/your_user_name/deps/ directory. You can check with:
pwd
Run this command again:
export PATH="${PWD}/depot_tools:${PATH}"
and check again that the first entry matches /home/your_user_name/deps/depot_tools with:
echo $PATH

I don't think it's important to clear out the wrong entries, they'll be gone after the terminal window is closed. The shell checks directories in the same order they are listed in the $PATH and when it finds what it wants.

Success!

You can now change directories back to the skia one with:
cd skia
Skip running the python script again, and try running the command that starts with gn again! If it worked, you'll see something like:
Done. Made 60 targets from 44 files in 121ms

Hopefully this helps!

from skia.

nixgoat avatar nixgoat commented on September 24, 2024

I have the same issue on my musl libc install of Void Linux.

from skia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.