Skip to content
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

pkg_tar package_dir parameter is encoded with the platform specific folder delimiters #297

Closed
konste opened this issue Feb 22, 2021 · 3 comments · Fixed by #618
Closed
Assignees
Labels
P1 An issue that must be resolved. Must have an assignee
Milestone

Comments

@konste
Copy link
Contributor

konste commented Feb 22, 2021

When pkg_tar is executed on Windows host and it has package_dir specified (like a/b/c) folder separators in package_dir are encoded in the resulting TAR in a platform specific way, i.e. on Windows they are encoded as backslashes. When that TAR is then expanded on Linux or Mac they don't understand backslashes and the content gets expanded to the wrong folder tree.

The result of pkg_tar should not depend on the platform it runs on. Folder separators should always be slashes, not backslashes, and then the resulting TAR would be perfectly usable on all platforms.

@aiuto
Copy link
Collaborator

aiuto commented Feb 24, 2021

Hmmm... I thought I had that right the first time. I'm trying to rebuild my windows environment (lost when working from home started) and don't have a dev machine right now. Can you send along a small tar file produced on windows so I can do some forensics?

@aiuto aiuto self-assigned this Feb 24, 2021
@aiuto aiuto added the P1 An issue that must be resolved. Must have an assignee label Feb 24, 2021
@konste
Copy link
Contributor Author

konste commented Feb 24, 2021

Repro is trivial, but still I added one to make sure we are on the same page: https://github.com/Bazel-snippets/pkg_tar_windows

I have zipped the TAR produced on Windows and attached here.
bazel-bin.zip

Regarding access to Windows environment AFAIR anybody can create a free account on Azure and get some amount of computational resources (which can be Windows VM) for free. If you don't have easier access to Windows I can look into it and probably create one for you.

@aiuto
Copy link
Collaborator

aiuto commented Feb 25, 2021 via email

@aiuto aiuto added this to the 1.0 milestone Jul 28, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this issue Sep 23, 2022
aiuto added a commit that referenced this issue Sep 23, 2022
* Adjust tar test to show #297
I tried to revert many pieces of code which should have fixed the problem, but could not reproduce 297. I'm fairly confident the root cause was eliminated a while ago.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 An issue that must be resolved. Must have an assignee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants