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

docker_build: unintuitive behavior if data_path isn't a prefix of added files' paths #1109

Closed
kamalmarhubi opened this issue Dec 3, 2015 · 5 comments

Comments

@kamalmarhubi
Copy link

If data_path is not a prefix of a file, that file gets inserted with its entire path form the repository root in tact. This can actually be exploited as a workaround for the bazelbuild/bazel#677 : set data_path to some absolute path that's not a prefix of the files you are adding.

@kamalmarhubi
Copy link
Author

I think this should be treated as an error. @damienmg thoughts?

@damienmg
Copy link
Contributor

damienmg commented Dec 6, 2015

This is working as designed but I have not given much though about what should be the correct behavior, an error might be wanted indeed.

@kamalmarhubi
Copy link
Author

As a data point, the analogous strip_prefix on new_http_archive fails if the prefix isn't found in the archive.

@kamalmarhubi
Copy link
Author

Actually not quite:

Note that if there are files outside of this directory, they will be discarded and inaccessible (e.g., a top-level license file). This includes files/directories that start with the prefix but are not in the directory (e.g., foo-lib-1.2.3.release-notes). If the specified prefix does not match a directory in the archive, Bazel will return an error.

http://bazel.io/docs/be/workspace.html#new_http_archive

@aiuto aiuto transferred this issue from bazelbuild/bazel Aug 26, 2019
@pcj
Copy link
Member

pcj commented Mar 14, 2021

Closing due to age.

@pcj pcj closed this as completed Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants