From 4e3d4221a7063dcbabf85b249a8dcd3a499c30c9 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 29 Mar 2024 17:15:36 +0900 Subject: [PATCH] [ci] Remove check symbol workflow check-symbol workflow is a task to check for verify the API of Galaxy Store for Galaxy Watch series(Tizen wearable profile). Due to the planned end of wearable profile support, check-symbol is no longer needed in flutter-tizen. https://github.com/flutter-tizen/flutter-tizen/issues/526 --- .github/workflows/check-symbols.yml | 63 ------------------------ README.md | 1 - tools/check_symbols.py | 75 ----------------------------- 3 files changed, 139 deletions(-) delete mode 100644 .github/workflows/check-symbols.yml delete mode 100755 tools/check_symbols.py diff --git a/.github/workflows/check-symbols.yml b/.github/workflows/check-symbols.yml deleted file mode 100644 index a671e12..0000000 --- a/.github/workflows/check-symbols.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check symbols - -on: - workflow_run: - workflows: - - Build - types: - - completed - -jobs: - check: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - repository: flutter-tizen/tizen_allowlist - token: ${{ secrets.TIZENAPI_TOKEN }} - path: tizen_allowlist - - - name: Download artifacts - uses: TizenAPI/tizenfx-build-actions/download-workflow-artifacts@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - name: tizen-5.5-arm - path: artifacts - - - name: Check symbols - run: | - python3 tools/check_symbols.py \ - --allowlist=tizen_allowlist/5.5.0_native_whitelist_wearable_v7.txt \ - artifacts/libflutter_tizen_wearable.so - - - name: Commit success status - if: ${{ success() }} - uses: actions/github-script@v6 - with: - script: | - github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.payload.workflow_run.head_sha, - context: 'Check symbols', - state: 'success', - description: 'All symbols are valid', - }); - - - name: Commit failure status - if: ${{ failure() }} - uses: actions/github-script@v6 - with: - script: | - github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha: context.payload.workflow_run.head_sha, - context: 'Check symbols', - state: 'failure', - description: 'Failed in checking symbols', - target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}', - }); diff --git a/README.md b/README.md index 3862e6f..1e8582c 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ This repository contains the following files and directories. - `public`: The public API of the embedder. - `third_party/accessibility`: A fork of the chromium accessibility library. Copied from [flutter/engine](https://github.com/flutter/engine/tree/main/third_party/accessibility). - `//tools` - - `check_symbols.py`: A script to check whether the build artifacts contain symbols not defined in the allowlist. Used by continuous integration. - `download_engine.py`: A script to download engine artifacts required for linking. Executed as a hook by `gclient sync`. The downloaded artifacts can be found in `//engine`. - `generate_sysroot.py`: A script to generate Tizen sysroots for arm/arm64/x86. Executed as a hook by `gclient sync`. The sysroots are by default generated in `//sysroot`. - `gn`: A script to automate running `gn gen`. diff --git a/tools/check_symbols.py b/tools/check_symbols.py deleted file mode 100755 index 9f897dd..0000000 --- a/tools/check_symbols.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import argparse -import os -import subprocess -import sys - - -class Symbol: - - def __init__(self, addr, type, name): - self.addr = addr - self.type = type - self.name = name - - def __str__(self): - return '{} {} {}'.format(self.addr, self.type, self.name) - - @staticmethod - def parse(line): - # Format: " U abort@GLIBC_2.4" (addr can be empty) - return Symbol(line[:8].strip(), line[9], line[11:].strip().split('@')[0]) - - -def check_symbol(sofile, allowlist): - if not os.access(sofile, os.R_OK): - sys.exit('{} is not a valid file.'.format(sofile)) - if not os.access(allowlist, os.R_OK): - sys.exit('{} is not a valid file.'.format(allowlist)) - - try: - symbols_raw = subprocess.check_output( - ['nm', '-gDC', sofile]).decode('utf-8').splitlines() - symbols = [Symbol.parse(line) for line in symbols_raw] - except subprocess.CalledProcessError as error: - sys.exit('nm failed: {}'.format(error)) - - with open(allowlist, 'r') as file: - allowlist = [line.strip() for line in file.readlines()] - - not_allowed = [] - for symbol in symbols: - if symbol.addr: - continue - if symbol.name.startswith('FlutterEngine'): - continue - if symbol.name in allowlist: - continue - not_allowed.append(symbol) - - if not_allowed: - print('Symbols not allowed ({}):'.format(sofile)) - for symbol in not_allowed: - print(symbol) - sys.exit(1) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--allowlist', type=str, required=True, - help='Path to the allowlist file') - parser.add_argument('sofile', type=str, nargs='+', - help='Path to the .so file') - args = parser.parse_args() - - for sofile in args.sofile: - check_symbol(sofile, args.allowlist) - - -# Execute only if run as a script. -if __name__ == '__main__': - main()