-
Notifications
You must be signed in to change notification settings - Fork 878
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
[Android] Fix warning from pack symbols of android_clang_* dir #26587
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
set -euo pipefail | ||
|
||
mkdir -p dist | ||
tar -czvf $1 --ignore-failed-read *.so apks android_clang_*/*.so android_clang_*/lib.unstripped lib.unstripped android_chrome_versions.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're using bash here, you could keep the script as is and just add shopt -s nullglob
before this line (and drop the --ignore-failed-read
).
Example:
$ ls
foo.txt
$ echo *.txt *.sh
foo.txt *.sh
$ shopt -s nullglob
$ echo *.txt *.sh
foo.txt
$
If you don't want to use nullglob
for some reason, an alternative would be to put the existing files in an array and then pass that to tar:
files=(apks lib.unstripped android_chrome_versions.txt)
for f in *.so android_clang_*/*.so android_clang_*/lib.unstripped; do
[[ ! -e "$f" ]] || files+=("$f")
done
tar -czvf "${1:?}" "${files[@]}"
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
set -euo pipefail | ||
|
||
mkdir -p dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here? I don't see any reference to this directory in the script. If this is used elsewhere, then maybe the directory should also be created elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest always running shell scripts through shellcheck
and fixing any findings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if there's a way to know which files are expected to exist and which aren't (e.g. based on the architecture, or something), then it would be better to pass that information to the script and avoid situations where some files don't exist and it's ignored. That's unnecessarily loose and could end up causing problems down the line.
This PR suppresses the warning from pack symbols script.
Resolves brave/brave-browser#42317
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
npm run create_dist -- Release --target_os=android --target_arch=arm --target_android_base=mono --target_android_output_format=aab