Skip to content

GCC: Fix the toolchain LTO workaround for Python 3 #12526

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

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

fkjagodzinski
Copy link
Member

@fkjagodzinski fkjagodzinski commented Feb 27, 2020

Summary of changes

Fix the GCC_ARM's check_if_obj_from_asm() to work properly with Python3.
Nightly tests failed with:

Traceback (most recent call last):
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/test_api.py", line 2091, in build_test_worker
    bin_file, _ = build_project(*args, **kwargs)
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/build_api.py", line 610, in build_project
    res = toolchain.link_program(resources, build_path, name)
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/toolchains/mbed_toolchain.py", line 778, in link_program
    self.link(elf, objects, libraries, lib_dirs, linker_script)
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/toolchains/gcc.py", line 326, in link
    asm_objects = self.get_asm_objects(objects)
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/toolchains/gcc.py", line 422, in get_asm_objects
    return [o for o in objects if self.check_if_obj_from_asm(o)]
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/toolchains/gcc.py", line 422, in <listcomp>
    return [o for o in objects if self.check_if_obj_from_asm(o)]
  File "/builds/ws/mbed-os-ci_build-GCC_ARM-nightly@4/mbed-os/tools/toolchains/gcc.py", line 415, in check_if_obj_from_asm
    match = self.DWARF_PRODUCER_RE.search(stdout.encode('utf-8'))
TypeError: cannot use a string pattern on a bytes-like object

In the Python3 version of the re module, the Unicode strings (str) and 8-bit strings (bytes) cannot be mixed.

Impact of changes

Migration actions required

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[x] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@0xc0170, @adbridge, @jamesbeyond, @maciejbocianski


In the Python3 version of re module, the Unicode strings (str) and 8-bit
strings (bytes) cannot be mixed.
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2020

Test run: FAILED

Summary: 1 of 8 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-pytest

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 28, 2020

Known issue, client restarted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants