-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[fuchsia] [packaging] Layout debug symbols for Fuchsia #13338
[fuchsia] [packaging] Layout debug symbols for Fuchsia #13338
Conversation
This packages and moves the relevant symbols to the right locations in root_out_dir, but doesn't upload them to CIPD yet. That will be done in a following change. Refer: go/flutter-fuchsia-packaging for more information.
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.
All minor nits. Looks good overall.
tools/fuchsia/debug_symbols.gni
Outdated
|
||
# Takes a binary and generates its debug symbols following | ||
# the Fuchsia packaging convention. | ||
template("debug_symbols") { |
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.
fuchsia_debug_symbols
for clarity. Also, please document the invoker arguments necessary.
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.
Makes sense
tools/fuchsia/debug_symbols.gni
Outdated
] | ||
|
||
outputs = [ | ||
"${_dest_base}/.${target_name}_success", |
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 think the convention is .stamp
. Also, why is the file hidden?
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 was making these hidden to avoid the noise when you try to inspect the directories. .stamp
seems to have a special meaning as far as gn
is concerned - there is a tool (" "stamp": Tool for creating stamp files") that gn uses to generate these, so I tried to avoid that. If that is the convention, i'm happy to change it to .stamp
.
tools/fuchsia/debug_symbols.gni
Outdated
} | ||
|
||
action(target_name) { | ||
testonly = defined(invoker.testonly) && invoker.testonly |
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.
Here and elsewhere, prefer forward_variables_from
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.
Done
def main(): | ||
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument( |
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.
Can you add help=
arguments to these please?
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.
Done.
tools/fuchsia/copy_debug_symbols.py
Outdated
|
||
|
||
def GetBuildIdParts(exec_path): | ||
file_out = subprocess.check_output(['file', exec_path]) |
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.
Dang, is there no other way to get the build ID for an ELF binary?
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.
This doesn't seem to work on cirrus for some reason. I'm wondering if file
is sandboxed away from us. I will look for alternatives.
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.
The Fuchsia toolchain includes a version of llvm-readelf
.
Try extracting the build ID with:
llvm-readelf --hex-dump=.note.gnu.build-id [executable]
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.
Great idea, I switched to using this,
tools/fuchsia/copy_debug_symbols.py
Outdated
assert os.path.exists(args.dest) | ||
|
||
parts = GetBuildIdParts(args.exec_path) | ||
dbg_prefix_base = '%s/%s' % (args.dest, parts['prefix_dir']) |
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.
Prefer os.path.join
. Here and 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.
Done
tools/fuchsia/copy_debug_symbols.py
Outdated
|
||
parser.add_argument('--stripped', dest='stripped', action='store_true') | ||
parser.add_argument('--unstripped', dest='stripped', action='store_false') | ||
parser.set_defaults(stripped=True) |
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.
You can specify the default in the add_argument
line itself.
|
||
args = parser.parse_args() | ||
assert os.path.exists(args.exec_path) | ||
assert os.path.exists(args.dest) |
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.
This is redundant with required=True
.
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.
required=True
says that the argument exists, not the path.
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
""" Gather the build_id, prefix_dir, and exec_name given the path to executable | ||
also copies to the specified destination. |
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.
Can you also add a line about how the build ID directory is structure. That section from the presentation will work great :)
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.
Done
tools/fuchsia/debug_symbols.gni
Outdated
bin_path = invoker.binary_path | ||
|
||
_args = [] | ||
if (defined(invoker.unstripped) && invoker.unstripped) { |
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 generally about optional invoker arguments. Especially in this case where the template is private.
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.
Good call.
[email protected]:flutter/engine.git/compare/7a9c86b8d5e9...89731ae git log 7a9c86b..89731ae --no-merges --oneline 2019-10-25 [email protected] Intercept SystemSound.play platform message before it's sent. (flutter/engine#13342) 2019-10-25 [email protected] [fuchsia] [packaging] Layout debug symbols for Fuchsia (flutter/engine#13338) 2019-10-25 [email protected] Roll fuchsia/sdk/core/linux-amd64 from Dr9GE... to fHxWy... (flutter/engine#13358) 2019-10-25 [email protected] Roll fuchsia/sdk/core/mac-amd64 from KC8wX... to Tbg2V... (flutter/engine#13357) 2019-10-25 [email protected] Bump dart/language_model to 9fJQZ0TrnAGQKrEtuL3-AXbUfPzYxqpN_OBHr9P4hE4C (flutter/engine#13337) 2019-10-25 [email protected] Roll src/third_party/skia a7f3157ac012..d0a404e84d47 (6 commits) (flutter/engine#13356) 2019-10-25 [email protected] Roll src/third_party/dart d576ce69e1..5ba6fb73ec (3 commits) 2019-10-25 [email protected] Create a separate directory for the intermediate outputs of each Fuchsia archive build action (flutter/engine#13341) 2019-10-25 [email protected] Fix the output filename of the Fuchsia archive build template (flutter/engine#13339) 2019-10-25 [email protected] Roll src/third_party/dart b42c2af535..d576ce69e1 (10 commits) 2019-10-25 [email protected] Roll src/third_party/skia 24a409611f24..a7f3157ac012 (1 commits) (flutter/engine#13353) 2019-10-25 [email protected] Roll src/third_party/skia 28a8f28b3eaf..24a409611f24 (2 commits) (flutter/engine#13352) 2019-10-25 [email protected] Roll fuchsia/sdk/core/linux-amd64 from 9m5ec... to Dr9GE... (flutter/engine#13351) 2019-10-25 [email protected] Roll fuchsia/sdk/core/mac-amd64 from yuA3r... to KC8wX... (flutter/engine#13350) 2019-10-25 [email protected] Roll src/third_party/skia 6f1c20f01fa9..28a8f28b3eaf (2 commits) (flutter/engine#13348) 2019-10-25 [email protected] Expose platform view ID on embedder semantics node (flutter/engine#13345) 2019-10-25 [email protected] Remove TODO on embedder a11y unit tests (flutter/engine#13346) 2019-10-25 [email protected] Roll src/third_party/dart 1bc9fba660..b42c2af535 (12 commits) 2019-10-25 [email protected] Android embedding API updates for plugin ecosystem - plugin facade, split Lifecycle, save state callbacks to plugins (#43241, #43242, #43295) (flutter/engine#13280) 2019-10-24 [email protected] Roll src/third_party/skia 740f85949db2..6f1c20f01fa9 (16 commits) (flutter/engine#13343) 2019-10-24 [email protected] Roll src/third_party/dart 1bd6e20d76..1bc9fba660 (14 commits) 2019-10-24 [email protected] Roll src/third_party/skia 4ab4e641f151..740f85949db2 (12 commits) (flutter/engine#13336) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
[email protected]:flutter/engine.git/compare/7a9c86b8d5e9...89731ae git log 7a9c86b..89731ae --no-merges --oneline 2019-10-25 [email protected] Intercept SystemSound.play platform message before it's sent. (flutter/engine#13342) 2019-10-25 [email protected] [fuchsia] [packaging] Layout debug symbols for Fuchsia (flutter/engine#13338) 2019-10-25 [email protected] Roll fuchsia/sdk/core/linux-amd64 from Dr9GE... to fHxWy... (flutter/engine#13358) 2019-10-25 [email protected] Roll fuchsia/sdk/core/mac-amd64 from KC8wX... to Tbg2V... (flutter/engine#13357) 2019-10-25 [email protected] Bump dart/language_model to 9fJQZ0TrnAGQKrEtuL3-AXbUfPzYxqpN_OBHr9P4hE4C (flutter/engine#13337) 2019-10-25 [email protected] Roll src/third_party/skia a7f3157ac012..d0a404e84d47 (6 commits) (flutter/engine#13356) 2019-10-25 [email protected] Roll src/third_party/dart d576ce69e1..5ba6fb73ec (3 commits) 2019-10-25 [email protected] Create a separate directory for the intermediate outputs of each Fuchsia archive build action (flutter/engine#13341) 2019-10-25 [email protected] Fix the output filename of the Fuchsia archive build template (flutter/engine#13339) 2019-10-25 [email protected] Roll src/third_party/dart b42c2af535..d576ce69e1 (10 commits) 2019-10-25 [email protected] Roll src/third_party/skia 24a409611f24..a7f3157ac012 (1 commits) (flutter/engine#13353) 2019-10-25 [email protected] Roll src/third_party/skia 28a8f28b3eaf..24a409611f24 (2 commits) (flutter/engine#13352) 2019-10-25 [email protected] Roll fuchsia/sdk/core/linux-amd64 from 9m5ec... to Dr9GE... (flutter/engine#13351) 2019-10-25 [email protected] Roll fuchsia/sdk/core/mac-amd64 from yuA3r... to KC8wX... (flutter/engine#13350) 2019-10-25 [email protected] Roll src/third_party/skia 6f1c20f01fa9..28a8f28b3eaf (2 commits) (flutter/engine#13348) 2019-10-25 [email protected] Expose platform view ID on embedder semantics node (flutter/engine#13345) 2019-10-25 [email protected] Remove TODO on embedder a11y unit tests (flutter/engine#13346) 2019-10-25 [email protected] Roll src/third_party/dart 1bc9fba660..b42c2af535 (12 commits) 2019-10-25 [email protected] Android embedding API updates for plugin ecosystem - plugin facade, split Lifecycle, save state callbacks to plugins (flutter#43241, flutter#43242, flutter#43295) (flutter/engine#13280) 2019-10-24 [email protected] Roll src/third_party/skia 740f85949db2..6f1c20f01fa9 (16 commits) (flutter/engine#13343) 2019-10-24 [email protected] Roll src/third_party/dart 1bd6e20d76..1bc9fba660 (14 commits) 2019-10-24 [email protected] Roll src/third_party/skia 4ab4e641f151..740f85949db2 (12 commits) (flutter/engine#13336) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
This packages and moves the relevant symbols to the right
locations in root_out_dir, but doesn't upload them to CIPD
yet. That will be done in a following change.
Refer: go/flutter-fuchsia-packaging for more information.