diff --git a/.github/workflows/check-symbols.yml b/.github/workflows/check-symbols.yml deleted file mode 100644 index 4af60f0582e13..0000000000000 --- 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-arm-release - path: artifacts - - - name: Check symbols - run: | - python3 ci/tizen/check_symbols.py \ - --allowlist=tizen_allowlist/4.0.0_native_whitelist_wearable_v12.txt \ - artifacts/libflutter_engine.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/ci/tizen/check_symbols.py b/ci/tizen/check_symbols.py deleted file mode 100755 index 94620dd654432..0000000000000 --- a/ci/tizen/check_symbols.py +++ /dev/null @@ -1,72 +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()