From 68c52c0af3b9561227331b4a6276197c20c34389 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Thu, 27 Jul 2023 21:52:26 +0300 Subject: [PATCH 1/4] Simplify commands for build steps --- .github/workflows/push.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 639ecc9c1b..9486ae7516 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -30,9 +30,7 @@ jobs: run: cd source && ./build.sh -m ${{ matrix.model }} - name: Copy license files - run: | - cp LICENSE source/Hexfile/LICENSE - cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -47,7 +45,7 @@ jobs: if-no-files-found: error - name: Generate json index file - run: cd source && python3 metadata.py ${{ matrix.model }}.json + run: ./source/metadata.py ${{ matrix.model }}.json - name: Archive ${{ matrix.model }} index file uses: actions/upload-artifact@v3 @@ -79,12 +77,11 @@ jobs: run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" - name: Build ${{ matrix.model }} - run: cd source && make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese + run: make -C source/ -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese - name: Copy license files run: | - cp LICENSE source/Hexfile/LICENSE - cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -99,7 +96,7 @@ jobs: if-no-files-found: error - name: Generate json index file - run: cd source && python3 metadata.py ${{ matrix.model }}_multi-lang.json + run: ./source/metadata.py ${{ matrix.model }}_multi-lang.json - name: Archive ${{ matrix.model }} index file uses: actions/upload-artifact@v3 @@ -125,15 +122,10 @@ jobs: run: python3 -m pip install bdflib - name: Run python tests - run: cd Translations && chmod +x make_translation_test.py && ./make_translation_test.py + run: ./Translations/make_translation_test.py - name: Run BriefLZ tests - run: | - cd source - make Objects/host/brieflz/libbrieflz.so - cd ../Translations - chmod +x brieflz_test.py - ./brieflz_test.py + run: make -C source/ Objects/host/brieflz/libbrieflz.so && ./Translations/brieflz_test.py check_c-cpp: @@ -150,7 +142,7 @@ jobs: submodules: true - name: Check format style with clang-format - run: cd source && make clean && make check-style + run: make -C source/ clean check-style check_python: From cb1b64b38690a66275352faef784c374e54ed011 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 28 Jul 2023 01:41:50 +0300 Subject: [PATCH 2/4] Fixing multi-lang builds for Pinecil & PinecilV2 --- .github/workflows/push.yml | 9 ++++----- source/Makefile | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9486ae7516..f81458583c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -30,7 +30,7 @@ jobs: run: cd source && ./build.sh -m ${{ matrix.model }} - name: Copy license files - run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ + run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -77,11 +77,10 @@ jobs: run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" - name: Build ${{ matrix.model }} - run: make -C source/ -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese + run: make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese - name: Copy license files - run: | - cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ + run: cp LICENSE scripts/LICENSE_RELEASE.md source/Hexfile/ - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -142,7 +141,7 @@ jobs: submodules: true - name: Check format style with clang-format - run: make -C source/ clean check-style + run: make clean check-style check_python: diff --git a/source/Makefile b/source/Makefile index 3726cce43c..1eee255283 100644 --- a/source/Makefile +++ b/source/Makefile @@ -765,15 +765,15 @@ Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o @test -d $(@D) || mkdir -p $(@D) @echo Generating BriefLZ compressed translation for $* @OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \ - --macros $(PWD)/Core/Gen/macros.txt \ - -o $(PWD)/Core/Gen/Translation_brieflz.$*.cpp \ + --macros $(CURDIR)/Core/Gen/macros.txt \ + -o $(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp \ --input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \ --strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/$*.o \ $* Core/Gen/Translation_brieflz_font.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt @test -d $(@D) || mkdir -p $(@D) - @echo Generating BriefLZ compressed translation for $* + @echo Generating BriefLZ compressed translation font for $* @$(HOST_PYTHON) ../Translations/make_translation.py \ --macros $(PWD)/Core/Gen/macros.txt \ -o $(PWD)/Core/Gen/Translation_brieflz_font.$*.cpp \ @@ -820,8 +820,8 @@ Core/Gen/Translation_multi.$(1).cpp: $(patsubst %,../Translations/translation_%. @test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files @echo 'Generating translations for multi-language $(2)' @$(HOST_PYTHON) ../Translations/make_translation.py \ - --macros $(PWD)/Core/Gen/macros.txt \ - -o $(PWD)/Core/Gen/Translation_multi.$(1).cpp \ + --macros $(CURDIR)/Core/Gen/macros.txt \ + -o $(CURDIR)/Core/Gen/Translation_multi.$(1).cpp \ --output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \ $(3) @@ -831,8 +831,8 @@ Core/Gen/Translation_brieflz_multi.$(1).cpp: $(OUTPUT_DIR)/Core/Gen/translation. @test -d $$(@D) || mkdir -p $$(@D) @echo Generating BriefLZ compressed translation for multi-language $(2) @OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \ - --macros $(PWD)/Core/Gen/macros.txt \ - -o $(PWD)/Core/Gen/Translation_brieflz_multi.$(1).cpp \ + --macros $(CURDIR)/Core/Gen/macros.txt \ + -o $(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp \ --input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \ --strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o \ --compress-font \ From c6495e9e6c9edb555e57d81edc9d41a443998bc1 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 28 Jul 2023 01:51:55 +0300 Subject: [PATCH 3/4] Makefile: fix multi-thread building support --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d7a4a0c5dd..3f9f7498fa 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,7 @@ test-py: @echo "" flake8 Translations black --check Translations - @make -C source/ Objects/host/brieflz/libbrieflz.so + @$(MAKE) -C source/ Objects/host/brieflz/libbrieflz.so ./Translations/brieflz_test.py ./Translations/make_translation_test.py @@ -149,7 +149,7 @@ test-ccpp: @echo "" @echo "---- Checking C/C++ code... ----" @echo "" - make -C source/ clean check-style + $(MAKE) -C source/ clean check-style # meta target for tests & checks based on .github/workflows/push tests: test-md test-sh test-py test-ccpp @@ -159,11 +159,11 @@ tests: test-md test-sh test-py test-ccpp # pass-through target for Makefile inside source/ dir %: - make -C source/ $@ + $(MAKE) -C source/ $@ # global clean-up target for produced/generated files inside tree clean-build: - make -C source/ clean-all + $(MAKE) -C source/ clean-all rm -Rf site rm -Rf scripts/ci/artefacts From 2f9b3392edb957b3bae90f2b1d7cf968c8e04a54 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 28 Jul 2023 02:49:04 +0300 Subject: [PATCH 4/4] source/Makefile: fix formatting --- source/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Makefile b/source/Makefile index 1eee255283..8efbc415b8 100644 --- a/source/Makefile +++ b/source/Makefile @@ -875,9 +875,9 @@ style: # * process STOP env variable check-style: @error=0; export LIST=$$LIST; for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \ - ../scripts/deploy.sh check_style_file "$$src" ; \ - test "$${?}" -eq 1 && export error=1 ; \ - test "$${error}" -eq 1 && test -n "$${STOP}" && break; \ + ../scripts/deploy.sh check_style_file "$$src" ; \ + test "$${?}" -eq 1 && export error=1 ; \ + test "$${error}" -eq 1 && test -n "$${STOP}" && break; \ done; \ if [ $$error -eq 0 ] ; then echo "" && echo "" && echo "Style check: PASS" && echo "" && echo "" && exit 0 ; \ else echo "" && echo "" && echo "Style check: FAIL! Please, check the log above for the details." && echo "If there is a false-negative trigger, please, report an issue attaching the log or link to the log!" && echo "" && echo "" && exit 1 ; \