chocolatey-community / chocolatey-packages

Chocolatey Community Maintainers Team Packages - packages that are managed and maintained by core community team for community package repository (https://community.chocolatey.org/packages)
https://community.chocolatey.org/profiles/chocolatey-community
Apache License 2.0
435 stars 374 forks source link

(cmake) Not in Path #2442

Closed nazar-pc closed 3 months ago

nazar-pc commented 3 months ago

Checklist

Chocolatey Version

2.2.2

Chocolatey License

None

Package Version

3.28.3

Current Behaviour

CMake was the only package out of many that I installed that wasn't added to Path automatically by default. I have found old https://github.com/chocolatey-community/chocolatey-packages/issues/1444, but looks like back then it worked correctly.

Expected Behaviour

CMake is added to Path on installation

Steps To Reproduce

  1. choco install cmake
  2. cmake in newly open PowerShell window

Environment

- Operating System: Windows 11 23H2 Microsoft Windows NT 10.0.22631.0
- PowerShell Version: 5.1.22621.2506
- Shell: PowerShell

Chocolatey Log

https://gist.github.com/nazar-pc/ede66d3fe2c366a48c306c3636a51123

Anything else?

No response

stenolog commented 3 months ago

Confirming, just ran into this.

Fix it by manually updating the path variable

Chocolatey Project Process

Wondering why the choco project closes issues that casually, degrading choco's quality:

stenolog commented 3 months ago

@AdmiringWorm, issues do not disappear by writing some comments, closing and locking issues.

pauby commented 3 months ago

@stenolog This is a community maintained repository. Packages are maintained by volunteers and anything done is on a best effort basis.

If you need an issue fixed, then it is expected that you jump in and submit a PR.

If you want a new feature, the same is expected.

Posting sarcastic comments about something from 5 3.5 years ago doesn't help anybody, but does annoy and demotivate the team, which is unacceptable.

I've removed your comment above as it's unneeded and contributes nothing to the issue.

Wondering why the choco project closes issues that casually, degrading choco's quality:

As mentioned above, this is a community maintained repository of packages. While some Chocolatey Team members work on this repository, and is done primarily in their own time. It is not a choco project. It is a community maintained effort.

Please refer to our Code of Conduct before posting further.

pauby commented 3 months ago

@nazar-pc as there was a previous issue for this. It was made clear there that the package is following the default behaviour of the installer (which does not add cmake to the path). As this is default behaviour, this will be expected behaviour by those who have used that same installer outside Chocolatey CLI.

@AdmiringWorm, would a PR, adding a package parameter and making it clear in the output that the software is not on the path because of this default behaviour, be an option here?

UPDATE: Looking at the package page documentation, the arguments make it clear what needs to be done. Writing --installargs 'ADD_CMAKE_TO_PATH=System' is just as much work as --package-parameters="'/AddToPath'". Perhaps we just have a warning output to say that the cmake.exe is not on the PATH and to use --installargs 'ADD_CMAKE_TO_PATH=System' if you want it to be? And update the package description to say why this isn't by default added to the PATH?

nazar-pc commented 3 months ago

Even if it is the default upstream, I would argue is the wrong default. Anyone who installs CMake likely wants to use it in PowerShell or some other tooling and in most of those cases cmake.exe is expected to be in PATH. If it is not there, it just makes software harder to use.

I basically expect both apt-get install cmake and choco install cmake have about the same result and currently it is not the case. Especially so because I installed other dev tooling like git and make and they all were added to PATH just like I expected.

pauby commented 3 months ago

Even if it is the default upstream, I would argue is the wrong default. Anyone who installs CMake likely wants to use it in PowerShell or some other tooling and in most of those cases cmake.exe is expected to be in PATH. If it is not there, it just makes software harder to use.

I would argue that too. I don't think it makes much sense for the executable to not be on the path. But that is an installer decision. And therefore should be fixed in the installer.

The Chocolatey package is following that expected and project defined, behaviour. But if you want it on the path, then we have detailed the parameter to add to the command line - --installargs 'ADD_CMAKE_TO_PATH=System'.

I basically expect both apt-get install cmake and choco install cmake

Then I would suggest you contact the maintainer of cmake and ask them to make adding to the PATH the default behaviour for both.

Especially so because I installed other dev tooling like git and make and they all were added to PATH just like I expected.

The Chocolatey package does not have any special handling for either of those.

The cmake installer is an MSI. It is trivial to add handling in this to add cmake.exe to the path. That is the root problem and that's where it should be fixed.

Meanwhile, if you want it on the path add --installargs 'ADD_CMAKE_TO_PATH=System' to the command line (you can swap 'System' for 'User' if you want it only on the User PATH).

nazar-pc commented 3 months ago

Created upstream issue here: https://gitlab.kitware.com/cmake/cmake/-/issues/25795

pauby commented 3 months ago

Awesome. Thanks for doing that @nazar-pc.

stenolog commented 3 months ago

Wondering why the choco project closes issues that casually, degrading choco's quality:

This is a valid statement

Please refer to our Code of Conduct before posting further.

You should read it. It's a bidirectional agreement.

And spare me the usual "own time" "community" etc. excuses.

You provide a package-manager, yet you're not able to listen(!) to users, in order to fix your processes, thus you ~provide~ reach similar quality than other package managers.

Is it so difficult to see what needs to happen here?

Anyway, those are rhetorical comments/questions.

Not expecting any actions.

Cu around.

stenolog commented 3 months ago

--installargs 'ADD_CMAKE_TO_PATH=System'

that did not work on my side (similar to other users).

'choco' project must(!) enforce a standard-policy for standar-functionality (adding to path is absolute basic standard fucntionality, opt-out should be enforced).

nazar-pc commented 3 months ago

Upstream issue was closed as duplicate of https://gitlab.kitware.com/cmake/cmake/-/issues/21465, maintainer there basically says that if Chocolatey users expect cmake to be in Path by default, then that it is on Chocolatey to do that :confused:

stenolog commented 3 months ago

@AdmiringWorm, issues do not disappear by writing some comments, closing and locking issues.

this is not off-topic. Ask the hundred of users that hit on that issue if it is off-topic.

what a joke.

pauby commented 3 months ago

This issue isn't a Chocolatey package issue. This is a Windows PATH issue. That's a pretty poor response.

TheCakeIsNaOH commented 3 months ago

@nazar-pc @stenolog try the cmake.portable package, which does shim the executable to the path.

nazar-pc commented 3 months ago

Frankly speaking, I don't think I know or care about it enough to invest time. I only use Windows when debugging Windows-specific issues or packaging something for users.

But I do appreciate that Chocolatey exists, it made my life much easier installing various things on dev machines, thank you!

pauby commented 3 months ago

@nazar-pc it's my finish time (actually it was that over an hour ago) but I'll create an account over there tomorrow and see if I can lend any weight to it as I don't agree with some of what is being said over there. It doesn't make a lot of sense.

pauby commented 3 months ago

Problem is that the next user will run into the same issue.

I agree. Hence my comment about adding output on package install and my suggestion to tackle the problem where it lies, in the installer.

If you really believe this, then you should stop responding on a user-facing issue-tracker. Surely there are other (chocolatey) team-members with better product-management/user-interaction skills.

This isn't my opinion. This is what we have said for a very long time. Packages should follow expected behaviour of the software.

This isn't something we are going to keep debating. I appreciate you're unlikely to like that, but that is where we stand. The issue lies in the installer, and it must be tackled there.

Your weight would be better added to the issue linked to the cmake project, above.

pauby commented 3 months ago

@TheCakeIsNaOH I didn't know about that package. Thanks for highlighting it.

So there are two solutions to this:

  1. Use the cmake.portable package.
  2. Use the --installer-args option mentioned above with the cmake.install package (cmake is a meta package).

I think we need to update the description of cmake to use the --installer-args-global option, or better still point people at cmake.install if they want to add it to the PATH. And to make it clear the installer does not add the tool to the PATH, both in the description and in the chocolateyInstall.ps1.

If somebody could raise a PR for that, it would be appreciated.

nazar-pc commented 3 months ago

I personally didn't actually look at any descriptions, I just assumed that most of the packages are available and blindly ran choco install cmake hoping for the best :see_no_evil: And it worked :slightly_smiling_face:

pauby commented 3 months ago

If we made it clearer that the installer does not add the tool to the PATH and to try cmake.portable, when installing the package, it would help others in future who do this too.

pauby commented 3 months ago

I added a comment to the cmake GitLab repository which I hope at least helps. In the meantime, I raised a PR to clarify the text.

As this is a heated topic, we will continue to remove or mark comments accordingly.

pauby commented 3 months ago

A comment was left over on the cmake GitLab site regarding updating the MSI in future.

Now that the PR has been merged to clarify the text around the PATH, I'm going to go ahead and close this. I'm also going to lock it due to the heated nature of the conversation.

TL;DR for people finding this in the future, the cmake.install Chocolatey package follows the behaviour of the installer, which currently does not add the tool to the PATH. If you want to have the tool added to the path, see the package page for cmake or cmake.install, or install the cmake.portable package. Any future issues raised about this will be marked as a duplicate of this one and closed.