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

(cmake) not in PATH #987

Closed
mcandre opened this issue Mar 16, 2018 · 17 comments
Closed

(cmake) not in PATH #987

mcandre opened this issue Mar 16, 2018 · 17 comments
Labels
Invalid / Not Issue / No repro / Not Implementing invalid This is used to mark Hacktoberfest PR's as invalid

Comments

@mcandre
Copy link

mcandre commented Mar 16, 2018

ay make sure cmake perists in PATH upon installation, so that project builds can find it

@AdmiringWorm
Copy link
Member

you can already do this (or should anyhow).

install cmake like this to have it added to PATH for all users:

choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"'

or the following to have it added to PATH for the current user only

choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'

There isn't any intention of adding it by default, as it isn't added by default in the installer.

@AdmiringWorm AdmiringWorm changed the title cmake not in PATH (cmake) not in PATH Mar 16, 2018
@AdmiringWorm AdmiringWorm added invalid This is used to mark Hacktoberfest PR's as invalid Invalid / Not Issue / No repro / Not Implementing labels Mar 16, 2018
@manhnt9
Copy link

manhnt9 commented May 1, 2019

This is different from website. Which leads me to failure in adding CMake to PATH.

On Web: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'

Effective: choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'

Please update the website.

@AdmiringWorm
Copy link
Member

@manhnt9 Just tested the example shown in the package, and everything works as it should.
After installing cmake, did you reload the environment variables? (either by using refreshenv or by closing and re-opening the command prompt)

@manhnt9
Copy link

manhnt9 commented May 1, 2019

Maybe it's because you already had the vars set. I tried uninstall CMake and reinstall several times. Choco didn't even warn me to refreshenv (and I did try that too).

The command here solved my problem.

@AdmiringWorm
Copy link
Member

I did not. Whenever I test packages, this is done in a completely bare-bones VM with next to nothing installed in it. (The VM in question is: https://github.com/chocolatey-community/chocolatey-test-environment)

@manhnt9
Copy link

manhnt9 commented May 1, 2019

Well that's interesting though. Maybe there's something wrong with my environment.

@AdmiringWorm
Copy link
Member

Well, everything is possible. You may also have had a typo, or maybe there is a difference in what command prompt was used (in my case, I tested it in powershell).

@manhnt9
Copy link

manhnt9 commented May 1, 2019

Probably there's difference between cmd and powershell.

@Groostav
Copy link

I ended up uninstalling and reinstalling cmake (and cmake.install --im not sure how choco packages work here) several times.

Turns out refreshenv simply wasnt doing its job. choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' did indeed install cmake to C:\Program files\CMake\ and it did update the System's PATH variable such that its last entry was C:\Program Files\CMake\bin.

The problem was that refreshenv was not adaquately refreshing my environment. Restarting the shell worked.

@AdmiringWorm
Copy link
Member

@Groostav if you were running powershell, then it could be that the necessary module isn't loaded in your profile, and instead it used the bash edition of refreshenv (which don't work in powershell).

See https://chocolatey.org/docs/troubleshooting#refreshenv-has-no-effect for more information.

@Timmmm
Copy link

Timmmm commented Mar 25, 2020

I had to uninstall CMake and then reinstall it with:

choco install cmake --installargs 'ADD_CMAKE_TO_PATH=User'

Just reinstalling it with --force didn't work. Also this seems like a mad design. Does every package have a different variable to add it to the PATH? Do I have to look up ADD_GIT_TO_PATH too? It would be much better if it prompted you "Do you want to add CMake to the PATH: *system, *user, *no"

@CybershoesVR
Copy link

I ran into this problem today
I took me some time to figure it out
I would expect to be able to execute cmake after installing cmake
can we have this as a default?

@saolof
Copy link

saolof commented Aug 7, 2020

This. The entire point of a package manager is being just an "install x" away from being able to type "x args" in the command line, with sane defaults.

If I didn't want to add it to path, I'd look up flags. But the default with no flags should be a usable setup out of the box.

@Luvideria
Copy link

Luvideria commented Sep 16, 2020

I agree on this. At least some way to add it after install, instead of having to uninstall and re-install with the ADD_CMAKE_TO_PATH.
But maybe it's not clear why it is not the default. Someone care to explain?
on the first response we see:
from @AdmiringWorm

There isn't any intention of adding it by default, as it isn't added by default in the installer.

Why is this so?
Is it a requirement from choco itself?
I had expected that everything choco installs is automatically referenced somehow.

@AdmiringWorm
Copy link
Member

Why is this so?
Is it a requirement from choco itself?

Not specifically a requirement, however in general chocolatey packages are expected to behave similar to the defaults of an installer.
There are a few exceptions, but this is unfortunately not one of them.

@aminya
Copy link

aminya commented Sep 23, 2020

How can I do this in ChocolateyGUI?

The default behavior should add cmake to the PATH. It is strange that this package does not add cmake to the path. All the other chocolatey packages do this by default!

@AdmiringWorm
Copy link
Member

@aminya you can't, not until chocolatey/ChocolateyGUI#545 is implemented.
Use the cli until then.

@chocolatey-community chocolatey-community locked and limited conversation to collaborators Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Invalid / Not Issue / No repro / Not Implementing invalid This is used to mark Hacktoberfest PR's as invalid
Projects
None yet
Development

No branches or pull requests

9 participants