//cuttlefish/package:package_files overhaul - #2984
Conversation
7e7a090 to
0d9ddff
Compare
jmacnak
left a comment
There was a problem hiding this comment.
- Most of the implementation is moved to a C++ executable
Sorry if I am missing something. Is there a motivation for this? Couldn't _package_files_impl be upated to perform the rm -rf ctx.attr.base_dir as the first step?
|
Should have mentioned, one of the issues I ran into is https://www.github.com/bazelbuild/bazel/issues/21782 : if the entire directory is considered the output with I think #2998 is the strategy you're proposing, for running This can be worked around by disabling the sandbox using Using |
|
Ahh makes sense. Could you add a comment either around |
Bug: b/429012834
cd70aa3 to
f63cdf5
Compare
|
Added a comment, and pushed some more fixes to the debian Also added a workaround for Bazel chmod-ing all output files ( https://www.github.com/bazelbuild/bazel/issues/5588 ) which can propagate back to any source files hard linked in. |
|
Thanks for the reviews! Also added a fix to - ctx.actions.symlink(
- output = executable_link,
- target_path = base_dir.basename + "/" + ctx.attr.executable,
+ ctx.actions.run_shell(
+ mnemonic = "OutputSymlink",
+ outputs = [executable_link],
+ inputs = ctx.attr.package[DefaultInfo].files,
+ command = "ln -s " + base_dir.basename + "/" + ctx.attr.executable + " " + executable_link.path,
)With |
bd67f60 to
0370371
Compare
- base_dir is recreated on every rule evaluation, fixing an outstanding issue where files would persist in the output directory beyond being deleted in the build target - Most of the implementation is moved to a C++ executable - package_executable is separated from package_files. this allows referencing 0 to many executables from a package, rather than always exactly one. - When possible, hard links are created instead of copies. Bug: b/429012834
Bug: b/429012834