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
Add keyword for setting the mode of a file copied by fs.copyfile in the build directory #10744
base: master
Are you sure you want to change the base?
Conversation
This is ground work for more complex handling
This can be done by setting the `--file-mode` argument, and passing a numeric value suitable for passing to `os.chmod`. This will be used to allow `fs.copyfile` to set the mode of a file in the build directory, which is sometimes useful.
There are cases where scripts need to be copied into the build directory with specific file modes set. This allows this to be done in a platform agnostic way, without having to figure out chmod vs something else. See https://gitea.treehouse.systems/ariadne/pkgconf/pulls/246 for an example of this.
Codecov Report
@@ Coverage Diff @@
## master #10744 +/- ##
==========================================
- Coverage 68.93% 67.39% -1.55%
==========================================
Files 406 406
Lines 88402 88436 +34
Branches 19607 19615 +8
==========================================
- Hits 60944 59602 -1342
- Misses 22870 24288 +1418
+ Partials 4588 4546 -42
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@dcbaker just thinking out loud, but is there a use-case for install_mode != build_mode? Wondering if we should just set install_mode in the builddir and avoid adding extra kwarg? |
The biggest thing I can think of is that while you may want the mode to be the same, you may not want (or may not be able to) set the ownership the same (say because you expect |
Why not just change the executable bit in the source tree and check that into git? The rationale here seems weak. |
There are cases where users need to set the mode of a copied file in the build directory. This is actually rather painful to do in a cross platform way, so it would be nice if meson just provided this functionality. Since we already have everything in place to do this for install_mode, it's rather trivial to add support.
See https://gitea.treehouse.systems/ariadne/pkgconf/pulls/246, for an example of where this is useful.