From e36db45ba6a5518d7951130fc9f220adcc04e221 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 9 Dec 2021 16:24:32 -0500 Subject: [PATCH] Fix compilation using build_examples on vscode (#12824) * Test group option is not valid for all applications. Only provide it for some apps * More changes to allow docker to build out of the box android/nrf/crosscompile * Restyle fixes --- .devcontainer/Dockerfile | 10 +++++++++- scripts/build/build/targets.py | 14 +++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c33b5913d62d1c..f64fd0a27f68fc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -53,8 +53,16 @@ RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/resty RUN chmod +x /home/$USERNAME/bin/restyle-path RUN chown -R $USERNAME:$USERNAME /home/$USERNAME RUN echo "PATH=/home/$USERNAME/bin:${PATH}" >> /home/$USERNAME/.bashrc + # $USERNAME needs to own the esp-idf and tools for the examples to build RUN chown -R $USERNAME:$USERNAME /opt/espressif/esp-idf RUN chown -R $USERNAME:$USERNAME /opt/espressif/tools + # $USERNAME needs to own west configuration to build nRF Connect examples -RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/.west +RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/ + +# allow read/write access to header and libraries +RUN chown -R $USERNAME:$USERNAME /opt/ubuntu-21.04-aarch64-sysroot/usr/ + +# allow licenses to be accepted +RUN chown -R $USERNAME:$USERNAME /opt/android/sdk diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index be82df0e4c56f6..e5d25f1b3ae126 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -99,12 +99,15 @@ def Accept(self, name: str): return True -class AcceptNameWithSubstring: - def __init__(self, substr: str): +class AcceptNameWithSubstrings: + def __init__(self, substr: List[str]): self.substr = substr def Accept(self, name: str): - return self.substr in name + for s in self.substr: + if s in name: + return True + return False class HostBuildVariant: @@ -155,9 +158,10 @@ def HostTargets(): HostBuildVariant(name="no-ble", enable_ble=False), HostBuildVariant(name="tsan", conflicts=['asan'], use_tsan=True), HostBuildVariant(name="asan", conflicts=['tsan'], use_asan=True), - HostBuildVariant(name="test-group", test_group=True), + HostBuildVariant(name="test-group", + validator=AcceptNameWithSubstrings(['-all-clusters', '-chip-tool']), test_group=True), HostBuildVariant(name="same-event-loop", - validator=AcceptNameWithSubstring('-chip-tool'), separate_event_loop=False), + validator=AcceptNameWithSubstrings(['-chip-tool']), separate_event_loop=False), ] glob_whitelist = set(['ipv6only'])