-
Notifications
You must be signed in to change notification settings - Fork 177
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 pkg_install(wipe_destdir: bool) #893
Comments
Sigh... Yes it is useful. but adding an |
That would be sub-optimal for our use case (and for some downstream partners), so I would love to add an attribute to "always wipe". But yeah it is better than nothing. I'll submit a PR to add the command line option (the option goes to the script, not to bazel, so it goes after the
Bikeshed: How do you like the command line option name to be? |
If specified, wipe destination directory before installing. Fixes bazelbuild#893.
* install: test uses pathlib. Cleans up a lot of code! * install: add --wipe_destdir option. If specified, wipe destination directory before installing. Fixes #893. * install: Update doc for --wipe_destdir. Clarify that this will delete the whole directory. --------- Co-authored-by: HONG Yifan <[email protected]>
I want to request a feature to add the following:
Default value is false. If true, pkg_install() script will wipe the given destdir before installing the files.
This is particularly useful if we want the resulting destdir to be always strictly containing the given list of files, but not any old files. For example, I have a pkg_install() rule that generates stardoc and put it in our source tree. If the list of generated file names changes, I need to manually delete the old documentation files now. But with this attribute, I can set it to True so I don't have to manually delete old documentation. The example is illustrated here: https://r.android.com/c/kernel/build/+/3273727/2/kleaf/docs/BUILD.bazel
@aiuto if you think this is a useful feature, I can start preparing a pull request; or please let me know if this does not fit in pkg_install(). Thanks!
The text was updated successfully, but these errors were encountered: