-
Notifications
You must be signed in to change notification settings - Fork 176
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
'File exists' error when building pkg_tar from srcs containing directories #135
Comments
@laurentlb why is this assigned to team-Remote-Exec? |
It sounds like an error related to execution. I don't know which exact team should look at this. Feel free to reassign. |
@laurentlb isn't that for the dev ex team, of who you are a member of, to find out? |
Please do not drop issues on the floor - keep them assigned to some team. |
Assigning to team-Rules-Server for initial investigation/triage. |
This got lost in the bazel repo but we move pkg_tar to this repo last year. I'm going through the issue backlog. Do you have a standalone repo for this, against a newer bazel than 0.27? |
Closing as obsolete |
This is still an issue. See https://github.com/ash2k/rules_pkg_bug.
|
Inlining the reproduction
I don't have an idea on the best fix right now. We're trying to get strip_prefix out of pkg_tar and add it to pkg_filegroup, so the shape of the usage is likely to be different. |
Before fixing this, let's agree on the expected output of broken_package. I am going to assert that any previous behavior which flatten the paths returned by the glob is incorrect. The output, strip_prefix=dir1 or not should include:
So that is what I am working towards. The snag I have hit is that the list of files in the glob appears to be broken. dir1 and dir1/dir2 are showing up as files with is_directory==False, instead of true. This is just broken. I'll have to investigate why. |
Any update on this? I did hit this when packaging |
I had a good discussion with the core team today. The fundamental problem is that directories as action inputs is a bad idea in Bazel (see this piece of the documentation). The
This might work for local execution, but it won't work for sandboxed execution. This is not likely to change for a long time. Choice 1: Let
|
Thank you, I've tested with Thank you for in-depth explanation! |
In the next release of rules_pkg you might see better results with space in target names. I've changed the way the rule passes the manifest of what goes into the tarball to the helper that builds it. Now everything should be unicode clean and not have problems with escaping on the command line. |
That could solve my issues, I'll make sure to test it when its out. Thank you for maintaining and developing My use case is fairly simple, I just want to use
Having that said, I do believe that |
Yes. This is really a job for rules_python. There should be a few options for py_binary (or other rules like py_hermetic_binary).
Case 1 is easy. Just pull in all the files |
Could not agree more and I've discovered that they have rules for packaging (rule_python/docs/packaging.md) which might do it.
That is actually part of |
There are 2 incompatibilities with the python install that pyenv creates: * empty directories - bazel's sandbox mode + rules_pkg doesn't work with them: bazelbuild/rules_pkg#135 * spaces in filenames - bazelbuild/bazel#374 So pass flags to glob() to exclude these sticking points, and you can now build a container (or tar) with rules_pyenv built python.
Description of the problem / feature request:
When building a pkg_tar from a filegroup defined in an external repository containing multiple files in a directory, PackgeTar throws an io exception because the directory already exists. However, the issue is not present when using
--spawn_strategy=local
.Bugs: what's the simplest, easiest way to reproduce this bug.
See reproduction below.
What's the output of
bazel info release
? Happens with Bazel up through 4.xHave you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
log.txt
Is there something that I am not understanding about how the rules should work or is this really a bug? If this is just not how the rules should work what is the solution?
The text was updated successfully, but these errors were encountered: