-
Notifications
You must be signed in to change notification settings - Fork 166
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
Runfiles are not included in pkg_tar. #392
Comments
Can someone help me out by describing the expected behavior? I am not going to have a lot of time explore the old behavior. If, for example, you had a package (my_app) with a py_binary (my_prog), with a data file (foo), would you expect it to appear in the tar file as
or as
or as something else? |
This was split out from bazelbuild#376 to make that easier. I want to get this in place before adding a fix for bazelbuild#392. The UTF8 tests can wait.
The default behaviour from the version 0.4.0 is to flatten all files by removing directories:
This is suboptimal and doesn't work in many reasons. So we have to use
So I hope |
It sounds like what you want is to mimic the runfiles layout that Bazel produces. I have a PR ready that mimics the old behavior. That can go in after I add tests. For the mimic bazel case, what I would do is move the functionality to a new rule, so it can be reused by all pkg_* rules.
|
Your PR(pkg_expand_runfiles) sounds good to me. Thanks for your works! |
Fixes bazelbuild#392 This does not address the deeper issues with include_runfiles not being convenient to use. It just gets back to parity with the legacy feature. Also fix: Do not complain on duplicates that are safe. Addresses part of bazelbuild#252
Fixes #392 This does not address the deeper issues with include_runfiles not being convenient to use. It just gets back to parity with the legacy feature. Also: - Do not complain on duplicates that are safe. Addresses part of #252 - run buildifier over the changed files, which created a little noise.
@aiuto we cannot update to 0.5.0 because of this issue, do you have a plan on when 0.6.0 would be created? Is there any ticket that I could follow? Thanks |
Can you try at the sources at head and see if they work for you?
There is a chance I can make a 0.5.1 patch over the next few days, but not
today.
…On Fri, Aug 13, 2021 at 8:02 AM Xavier Bonaventura ***@***.***> wrote:
@aiuto <https://github.com/aiuto> we cannot update to 0.5.0 because of
this issue, do you have a plan on when 0.6.0 would be created? Is there any
ticket that I could follow? Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHE3XXNYCZQV45W2R6LT4UCUDANCNFSM5BBRG44A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
I will see if I can give it a try. Anyway is not really blocking us, we were in a quite old version of rules_pkg and now we will update to 0.4.x. It was more to know if the next version from head would be something like 1 week or more like 5 months. |
I did a 0.5.1 release.
Versions from head are likely to be about a month apart for the next few
months.
Andrew and I are each only working on this in our spare time, so we don't
get a lot of features to push earlier than that.
…On Fri, Aug 13, 2021 at 11:14 AM Xavier Bonaventura < ***@***.***> wrote:
I will see if I can give it a try. Anyway is not really blocking us, we
were in a quite old version of rules_pkg and now we will update to 0.4.x.
It was more to know if the next version from head would be something like 1
week or more like 5 months.
The fact that we cannot update to 0.5 is not a big issue, just that we
need to add some patches that would not be needed otherwise.
My goal is that at some point we can use rules_pkg without patches. Once
we are in a post 0.5.x will be easier to see what we still miss and if we
should request some features or propose some upstream.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHF5EBIA6ERSND3GVGTT4UZD5ANCNFSM5BBRG44A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
I'm wondering with this issue, what would be the recommended way of packaging a |
I'm also having trouble using My C++ code is simply:
@aiuto , it seemed that your proposed If there's a better / different approach to accomplish my goal of packaging a cc binary and a data file, please let me know. Thanks, |
Adding on to my last note in case it's useful to others:
I then decided to roll my own image:
mkdir ./${TARGET}-runfiles
tar zcvhf - -C ./bazel-bin/${PACKAGE}/${TARGET}.runfiles . | tar zxvf - -C ./${TARGET}-runfiles
sudo docker build -t foo/${TARGET}:1.0 -f- . <<EOF
FROM ubuntu:jammy
COPY ./${TARGET}-runfiles /${TARGET}-runfiles
WORKDIR /${TARGET}-runfiles
ENV RUNFILES_DIR=/${TARGET}-runfiles
RUN ["/bin/rm", "MANIFEST"]
ENTRYPOINT ["${WORKSPACE}/${PACKAGE}/${TARGET}"]
EOF This appears to work. And /probably/ would work for any language (not just C++) but I'm not certain of that. I welcome any suggestions for improvements, and I apologize if this is off topic for rules_pkg. Thanks, |
Flattening the runfiles seems plain wrong. rules_docker is slowly becoming abandonware. |
It seems
include_runfiles = True
in pkg_tar() doesn't work after the PR, at least with py_binary. The resulting tar file doesn't include runfiles. And the release version 0.5.0 has the same issue.The text was updated successfully, but these errors were encountered: