Skip to content

Zip Java tools for windows - #7708

Closed
iirina wants to merge 11 commits into
bazelbuild:masterfrom
iirina:java-tools-windows
Closed

iirina wants to merge 11 commits into
bazelbuild:masterfrom
iirina:java-tools-windows

Conversation

@iirina

@iirina iirina commented Mar 13, 2019 •

Copy link
Copy Markdown
Contributor

Create a zip archive for the remote Java tools for Windows instead of a tar, which can not be parsed on some other platforms.

Bazel doesn't have the equivalent of a pkg_zip rule and this PR introduces two new scripts that use zip directly:
third_party/merge_zip_files.sh: merges all the given zip files into a single zip
third_party/zip_files.sh: archives all the inputs files under the given directory structure in the output zip file

@aiuto
aiuto requested a review from laszlocsomor March 13, 2019 18:18
@aiuto aiuto added the area-Windows Windows-specific issues and feature requests label Mar 13, 2019
@iirina
iirina requested a review from lberki March 14, 2019 09:16
Comment thread third_party/BUILD Resolved
@iirina
iirina requested a review from lberki March 14, 2019 13:57

@lberki lberki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly shell style nits.

Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/zip_files.sh Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/zip_files.sh Resolved

@laszlocsomor laszlocsomor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to send my comments yesterday. :(

Comment thread third_party/zip_files.sh Resolved
Comment thread src/main/cpp/util/BUILD Resolved
Comment thread third_party/merge_zip_files.sh Resolved
Comment thread third_party/java/java_tools/BUILD Resolved
Comment thread third_party/zip_files.sh
tmp_dir=$(mktemp -d -t 'tmpdirXXXXX')
tmp_zip="$tmp_dir/archive.zip"

zip -j -q "$tmp_zip" "$@"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort input files for determinism; consider using -D

Comment thread third_party/zip_files.sh

mkdir -p "$tmp_dir/$directory_structure"
cd "$tmp_dir/$directory_structure"
unzip -q "$tmp_zip"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why unzip and zip again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unzipping everything under the given directory_prefixso that when zipping directory_prefix the zip content has the same directory structure. I couldn't find a way to get the same results only by using zip. If you have any experience with this I'm happy to replace this part of the script.

Comment thread third_party/java/java_tools/BUILD Resolved
@iirina
iirina requested a review from lberki March 18, 2019 08:38
@iirina

iirina commented Mar 18, 2019

Copy link
Copy Markdown
Contributor Author

@lberki all comments addressed, ready for re-review

Comment thread src/merge_zip_files.sh Resolved
Comment thread src/merge_zip_files.sh Resolved
Comment thread src/merge_zip_files.sh Resolved
bazel-io pushed a commit that referenced this pull request Mar 18, 2019
Create a zip archive for the remote Java tools for Windows instead of a tar, which can not be parsed on some other platforms.

Bazel doesn't have the equivalent of a `pkg_zip` rule and this PR introduces two new scripts that use `zip` directly:
`third_party/merge_zip_files.sh`: merges all the given `zip` files into a single `zip`
`third_party/zip_files.sh`: archives all the inputs files under the given directory structure in the output `zip` file

Partial merge of #7708.

PiperOrigin-RevId: 238969545
bazel-io pushed a commit that referenced this pull request Mar 19, 2019
Partial commit of third_party/*. See #7708.

Signed-off-by: iirina <[email protected]>
@iirina

iirina commented Mar 19, 2019

Copy link
Copy Markdown
Contributor Author

All changes merged.

@iirina iirina closed this Mar 19, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Windows Windows-specific issues and feature requests cla: yes team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants