Why does my attempt to add "make" to path not let me use make - windows-10

Using a very helpful thread here and these steps, I added make to my path (as C:\Program Files (x86)\GnuWin32\bin\make.exe).When I call $Path this shows up. However when I try to run make S4_pyext in cmd.exe which I run from Anaconda3, I get an error
'make' is not recognized as an internal or external command, operable program or batch file.
I thought I may have not added make to the path correctly so ran
"C:\Program Files (x86)\GnuWin32\bin\make.exe" S4_pyext
Instead which resulted in an error
mkdir -p build A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file build already exists. Error occurred while processing: build. make: *** [objdir] Error 1
I can't seem to make heads or tails of this error message. Does anyone know what may be happening on either attempt?

Related

Nest js failed to execute command: with 'node'

I'm trying to init my first NestJS project but met this fail:
-----------------------------------------
$ nest new testproj
⚡ We will scaffold your app in a few seconds..
'node' is not recognized as an internal or external command,
operable program or batch file.
Failed to execute command: node #nestjs/schematics:application --name=testproj --directory=undefined --no-dry-run --no-skip-git --no-strict --package-manager=undefined --language="ts" --collection="#nestjs/schematics"
------------------------------------------
Tryed to reinstall NodeJS, but no luck.
$ node -v
v16.13.1
$ nest -v
8.1.6
$ npm -v
8.3.0
Any help will be appreciated.
tl;dr:
If your PATH somewhere has a file in it and not a folder (can also be in the middle of a path, with some \other\stuff appended like C:\stuff\somefile.txt\stuff), then this can happen due to an error when Git bash is translating PATH before calling cmd.exe, resulting in part of the PATH not being forwarded and making binaries in that part "not found".
Details:
After some investigation via chat, it turned out that the root cause was a bad GRADLE_HOME environment variable.
Yes, Gradle has nothing to do with node.js or nest, but bear with me, this is one of those moments where a TV episode starts with a totally crazy scene and you wonder what the heck happened that led to this, and then you get "6 hours earlier..." 😁
So, Git bash obviously succeeded in finding node, because it ran the nest CLI (which is a node script). But then, somehow, cmd (which is called by node when executing shell commands) did not find node. This normally should not happen.
Tracing the events with Process Monitor revealed that bash (sh.exe) passed a truncated PATH variable to node.exe. It just ended abruptly somewhere in the middle, and C:\Program Files\nodejs (which was towards the end of it) was not passed along.
The reason for this turned out to be an entry in the PATH that looked like this: C:\foobar\file.zip\bin. The transition into bash worked, as the full path (including this bad entry as /c/foobar/file.zip/bin) could be seen in bash's $PATH, and /c/Program Files/nodejs was there too.
But the transition from bash to node.exe failed. In the process of converting the Linux-style paths to Windows-style paths before passing the variable on to node.exe, bash silently failed in the middle of the string and stopped processing it - as soon as this /c/foobar/file.zip/bin entry was encountered. C:\foobar\file.zip did exist, and it turns out Git bash behaves like this when it unexpectedly encounters a "not a directory" error from the OS when querying the path segment ("file not found" is fine) - as a result of attempting to access a "subdirectory" of a file. Removing this entry from the PATH made everything work normally.
The source of this entry was actually %GRADLE_PATH%\bin in the Windows PATH, and the reason this caused the problem was that GRADLE_PATH itself was incorrectly set to a file (C:\foobar\file.zip) instead of a directory.
There are three ways to resolve this:
Remove %GRADLE_PATH%\bin from the PATH.
Fix GRADLE_PATH to point to a directory.
Delete or rename the C:\foobar\file.zip file.

Can Execute Commands in Terminal But Not from Text File

I'm running code using Ubuntu on a WSL. Every time I edit some C files I need to execute a makefile and run an installer to ensure that the changes are reflected in the python package that I am using. The set of commands I need to execute is
make clean
make
cd python
python setup.py install --user
This works perfectly when I execute them in the terminal. In order to make my life easier, I decided to put these commands in a text file Compile.txt to be executed whenever I need to compile the relevant files. I found this question and tried to replicate its solution. However, whenever I type ./Compile.txt into the terminal I get the error
'. Stop. No rule to make target 'clean
gcc -o .o
gcc: fatal error: no input files
compilation terminated.
make: *** [<builtin>: .o] Error 1
./Compile.txt: line 7: cd: $'python\r': No such file or directory
python: can't open file 'setup.py': [Errno 2] No such file or directory
Can anyone explain what I've done wrong? I apologise for any misuse of terminology as I'm still quite new to Linux.
Thanks in advance.

dmtracedump is not producing the output file

I have installed graphviz-2.38, and I have included the dmtracedump path inorder to execute from command line. I am trying to view call graph of the .trace file stored in my system. I executed the below command, but it seems to be not working as no output files have been generated. Please help in resolving the error.
C:\Users\rb>dmtracedump -ho -s D:\Android\logs\cpu-art-single-call.trace -g D:\Android\logs\be cpu-art-single-call.trace
C:\Users\rb>

SCons can't find cl when building TideSDK on Win8 w/ VS2010

I am following the directions on https://github.com/TideSDK/TideSDK/wiki/Windows7-x86-2010-Express, but when running:
scons debug=1
I get errors about SCons not being able to find cl so I added the following to SContruct:
if build.is_win32():
subprocess.call(path_to_vcvars32.bat)
But I am still getting the error:
'cl' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [build\win32\objs\installer\common.obj] Error 1
Any thoughts on why SCons can't find cl?
calling a windows batch file will execute it in its own shell so any environment variables it might set will be set in that shell and then forgotten. They won't be propogated to the scons environment, and even if they were, they'd go into the wrong place.
This bit:
Add the following to your PATH environment variable:
C:\Python27;C:\Python27\Scripts;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
(and possibly running the batch file) need to be done before you run scons

setup.exe results in silent installation error

I need to install setup.exe in silent mode. I have recorded the response by using "setup.exe /r" and it created the setup.iss in Windows directory. I copied that file into my working directory where setup.exe file exists. Then I gave the command setup.exe /s, it starts the installation but exit in a second.
There is a log file available in the same directory, it says error code = -3. While surfing in net, -3 refers not enough info available in the .iss file. But how can I find out what information is not available?
For Googlers: I got a -3 exit code when reinstalling a package that was already installed. If I uninstalled and installed again, the exit code would go back to 0.
Also note that InstallShield silent install packages create log files in C:\Windows\, but it doesn't seem to overwrite logged errors with successes e.g.
Install once and have an error, you get a log file with a non-zero exit code.
Install again successfully, you still have the old non-zero exit code in the log file. The time on the file hasn't changed, so it looks like it wasn't written to. If you delete the file, then successfully re-run the setup, you get a new log file with a successful exit code.
Your mileage may vary, but that was my experience.
Error code = -3, meaning is "Required data not found in the Setup.iss file. "

Resources