-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[feature] Internalize chmod as Conan tool #8003
Comments
I've wanted this kind of tool for my conan recipes in the past. I don't know enough about the various scenarios which require all the parameters of |
https://github.com/YakDriver/oschmod has 3 stars in Github, I wouldn't rely on this, version 0.3.12 in PyPI. I wouldn't rely on this yet. Plus I would like to know real cases in ConanCenter that requires this level of permission modification for Windows. This are the current occurrences in ConanCenter
It seems a wrapper that would simplify a bit the UI and avoid the |
We could internalize its code.
The |
I mean, what is the real need. What library or Conan package requires this level of changing permissions. What cannot be built in ConanCenter unless using this code. It doesn't matter much if it doesn't have effect on Windows as long as libraries link and executables run. |
Maybe not so focused on ConanCenter, but maybe for companies which are packaging internal packages. We have a thread on Conan Slack channel: https://cpplang.slack.com/archives/C41CWV9HA/p1604505594005800?thread_ts=1604505490.005700&cid=C41CWV9HA /cc @a4z |
It is not clear from that thread what is the companies use case either. I think it is fine to add a Conan tool to abstract away the details of os.chmod a bit, but so far I don't see enough evidence to add or to depend on YakDriver/oschmod into our codebase. |
as a package creator, when needing to be sure an executable has execution permission, it would be nice to have something like This will improve the readability dramatically, since today various names and solutions for the same thing are used About implementation details, I do not have any strong opinion on what the best way is, but it would deffinitely be nice to get rid of the if not windows then chmod (and hopefully get all the details right) and on windows no idea |
PS: my current use case the Windows .bat file is exactly the same file as the non .bat file, But please note, if you find that this use case is strange or too special |
Hi!
As you may know, chmod is a nice Unix tool, which is used to handle file permission.
On Python, we have os.chmod, but it's limited in terms of solution on Windows (see #7966).
Doing a quick search on CCI we have
os.chmod
present there, but there is no pattern for its usage, sometimes we force the permission number, sometimes we just update (add/remove) what we need.My suggestion is adding a wrapper for
chmod
:Or
Or
A plus for the third option: Windows users/developers may not know about numerical permission.
Also, as
os.chmod
is limited for Windows, we could include the project oschmod, which is able to fix the permission on Windows. Thus,tools.chmod
would be effective for any OS. There is a nice blog post aboutoschmod
on Medium./cc @a4z @solvingj
The text was updated successfully, but these errors were encountered: