From f6ee377f68d45e95d6a542419e48f4f5854e6868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Taylor=20Ienczak=20Zanette?= Date: Tue, 20 Oct 2020 20:30:20 -0300 Subject: [PATCH 01/17] win32: Replace scripts with native/cross-files definitions By creating so many build scripts, they must be maintained, which considering the current scripts are batch-scripts it means it will sometimes be too hard to fix/update them to get too little benefit. There were two main purposes in having those scripts: - Ensuring pre-build procedures (setting environment variables and running vcvars64) have been done. - Setting windows-specific project option values, such as disabling wayland/x11 support and some Unix-specific EFL modules. For the first one, after quite a lot of changes in the codebase, there's only one environment variable to be set: CMAKE_TOOLCHAIN_FILE, which must then be passed to -Dcmake_args project option to meson. This is now done by creating a simple native-file with the cmake_args value on it, so a script to check/define it is above overkill. About vcvars64, this might be a simple "run vcvars64" (or "start a Develop Console from Visual Studio") instruction in compile and installation guides. For the second one, since meson 0.55 and further more on 0.56, there were some serious updates on cross/native-file definitions, which now fixes the issue https://github.com/mesonbuild/meson/issues/6783 that was the one that blocked EFL most from relying solely on native/cross-files. Given these, there's no good reason left to keep relying on these scripts, thus simplifying the build procedure a lot and making it more reliable and customizable, since now we only depend on meson defaults and not on another language (in this case, batch-script). --- .gitignore | 2 +- build.bat | 14 --- configure.bat | 209 ----------------------------------- ensure-vcvars64.bat | 64 ----------- install.bat | 14 --- native-file-windows.txt | 13 --- platforms/windows-cross.txt | 5 + platforms/windows-native.txt | 35 ++++++ test.bat | 26 ----- 9 files changed, 41 insertions(+), 341 deletions(-) delete mode 100644 build.bat delete mode 100644 configure.bat delete mode 100644 ensure-vcvars64.bat delete mode 100644 install.bat delete mode 100644 native-file-windows.txt create mode 100644 platforms/windows-cross.txt create mode 100644 platforms/windows-native.txt delete mode 100644 test.bat diff --git a/.gitignore b/.gitignore index 6bbbb0f5fa..08ee6c7c3f 100644 --- a/.gitignore +++ b/.gitignore @@ -97,7 +97,7 @@ efl_libs.csv .uuid #native windows files -env.bat +custom-native-properties.txt # Subprojects subprojects/* diff --git a/build.bat b/build.bat deleted file mode 100644 index 61e2ae2dd0..0000000000 --- a/build.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -set __OLD_vcvars64=%vcvars64% -set CLICOLOR_FORCE=1 - -set NINJAFLAGS=%* - -call ensure-vcvars64 - -ninja %NINJAFLAGS% -C build - -set vcvars64=%__OLD_vcvars64% -set __OLD_vcvars64= -exit /B %ERRORLEVEL% diff --git a/configure.bat b/configure.bat deleted file mode 100644 index 57eef43029..0000000000 --- a/configure.bat +++ /dev/null @@ -1,209 +0,0 @@ -@echo off - -call :has_arg --help %* || call :has_arg -h %* -if %errorlevel% == 0 ( - echo Usage: configure [-h] [--verbose] [--builddir BUILDDIR] [any extra arguments for meson] - echo: - echo Optional arguments: - echo -h, --help Shows this message and leaves - echo --verbose Verbose compilation (shows compile flags when building targets^) - echo --builddir BUILDDIR Sets custom build directory - exit /B 0 -) - -:: Receive extra-flags -set MESONFLAGS_EXTRA=%* - -:: Check if a custom build dir is being passed in args -set BUILDDIR=build - -:: Look for verbosity of this script and additional flags for meson -(echo %MESONFLAGS_EXTRA% | findstr /i /c:"--verbose" >nul) && set VERBOSE=ON - -if defined VERBOSE ( - echo Verbose ON. - set MESONFLAGS_EXTRA=%MESONFLAGS_EXTRA:--verbose=% -) else ( - echo Verbose OFF. -) - -call :main || (echo Build configure failed.) -exit /B %errorlevel% - -:: Removes head from a list of args and stores in a variable. -:: For example, by running: -:: `call :remove_head tail first second third` -:: A variable `tail` will be created with the value `second third`. -:remove_head - set tail_variable=%1 - - call set _all=%* - if not "%3" == "" ( - call set tail=%%_all:*%2=%% - set "%tail_variable% = %tail%" - ) else ( - call set %tail_variable% = - ) - set tail_variable= -exit /B 0 - -:: Checks if a specific argument is in argument-list. -:: Returns (sets errorlevel) to 0 if it is, 1 otherwise. -:: -:: has_arg -:has_arg - setlocal - set argname="%1" - set argname=%argname:"=% - - call :remove_head tail %* - - call set tail=" %%tail%% " - - setlocal EnableDelayedExpansion - call set cutted=%%tail: %argname% = %% - if x!cutted!x == x!tail!x ( - exit /B 1 - ) -exit /B 0 - -:check_env_vars - @echo Checking if necessarry environment variables were set... - - set envfile=env.bat - if exist %envfile% ( - @echo - Found %envfile% file. - call %envfile% - echo vcpkg_toolchain_file: %vcpkg_toolchain_file% - ) else ( - @echo - File %envfile% doesn't exists. Relying on previously set environment variables... - ) - set envfile= - - if not defined openssl_dir ( - echo [INFO] "OPENSSL_DIR" environment variable is not defined. Relying - echo on meson to properly find OpenSSL with standard - echo `dependency('openssl'^)` command. If meson does not find OpenSSL, - echo consider setting it to your current OPENSSL library directory. In - echo this case, you may consider creating a env.bat file containing: - echo - echo @set OPENSSL_DIR=^ - ) - - set pkg_config_libdir=thistotallydoesnotexist -exit /B 0 - - -:setup_flags - @echo ------------------------------ - @echo Setting up build flags... - - :: --------------------------------- - :: Compilers - set CC=clang-cl - @echo - C Compiler: %CC% - set CXX=clang-cl - @echo - C++ Compiler: %CXX% - - :: --------------------------------- - :: Windows terminal specific options - set CFLAGS=-fansi-escape-codes %CFLAGS% - - - if defined VERBOSE ( - set CFLAGS=-v %CFLAGS% - ) - - @echo - Using CFLAGS=%CFLAGS% - - :: ------------------------------------------------------ - set MESONFLAGS=^ - -Dnls=false^ - -Dsystemd=false^ - -Dgstreamer=false^ - -Ddbus=false^ - -Daudio=false^ - -Davahi=false^ - -Dv4l2=false^ - -Delua=false^ - -Dx11=false^ - -Dphysics=false^ - -Dethumb=false^ - -Demotion=false^ - -Deeze=false^ - -Dpulseaudio=false^ - -Dharfbuzz=false^ - -Dfribidi=false^ - -Dfontconfig=false^ - -Dedje-sound-and-video=false^ - -Dlibmount=false^ - "-Devas-loaders-disabler=gst,pdf,ps,raw,svg,rsvg,xcf,bmp,dds,generic,gif,ico,jp2k,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm,json"^ - -Dopengl=none^ - "-Demotion-loaders-disabler=gstreamer1,libvlc,xine"^ - -Dbindings=^ - --buildtype=debug^ - --native-file native-file-windows.txt - - echo %vcpkg_toolchain_file% - call set MESONFLAGS=%MESONFLAGS% -Dcmake_args="-DCMAKE_TOOLCHAIN_FILE=%vcpkg_toolchain_file%" - - if defined openssl_dir ( - set MESONFLAGS=-Dopenssl_dir="%OPENSSL_DIR:"=%" %MESONFLAGS% - ) - - ( - setlocal EnableDelayedExpansion - echo ------------------------------ - echo Meson flags: - echo %MESONFLAGS: =% - echo ------------------------------ - echo Extra flags: !MESONFLAGS_EXTRA! - echo ------------------------------ - endlocal - ) - set MESONFLAGS=%MESONFLAGS: = % -exit /B 0 - -:generate_build - setlocal EnableDelayedExpansion - @echo ------------------------------ - @echo Generating build... - call ensure-vcvars64 - if not defined devenvdir ( - echo Failed: DevEnvDir still not accessible - exit /B 0 - ) - meson !BUILDDIR! !MESONFLAGS! !MESONFLAGS_EXTRA! -exit /B 0 - -:save_old_vars - @echo ------------------------------ - set __OLD_vcvars64=%vcvars64% - set __OLD_CC=%CC% - set __OLD_CXX=%CXX% - set __OLD_CFLAGS=%CFLAGS% - set __OLD_MESONFLAGS=%MESONFLAGS% -exit /B 0 - -:restore_old_vars - @echo ------------------------------ - set vcvars64=%__OLD_vcvars64% - set CC=%__OLD_CC% - set CXX=%__OLD_CXX% - set CFLAGS=%__OLD_CFLAGS% - set MESONFLAGS=%__OLD_MESONFLAGS% - - set __OLD_vcvars64= - set __OLD_CC= - set __OLD_CXX= - set __OLD_CFLAGS= - set __OLD_MESONFLAGS= -exit /B 0 - -:main - call :save_old_vars - call :check_env_vars || (echo Environment Variables check failed) && exit /B 1 - call :setup_flags - call :generate_build || (echo Meson failed) && exit /B 1 - call :restore_old_vars -exit /B 0 diff --git a/ensure-vcvars64.bat b/ensure-vcvars64.bat deleted file mode 100644 index 2a99cdb603..0000000000 --- a/ensure-vcvars64.bat +++ /dev/null @@ -1,64 +0,0 @@ -@echo off -:: About `setlocal EnableDelayedExpansion`: -:: Needed because batch reads lines long before executing them, which means -:: it will expand variables before it has even been set (yes), so sometimes -:: they will come with trash-or-none value. This enables the usage of -:: `!variable!`, which (differently from `%variable%`) expands the variable -:: value when executing. - -call :main || (echo Failed to ensure vcvars64 is found) -exit /B %errorlevel% - -:check_path - set vcvars_in_path=0 - ( - where vcvars64 2>nul - call set vcvars_in_path=%%errorlevel%% - ) - if "%vcvars_in_path%" == "0" ( - echo [GOOD] vcvars64 found in PATH. - vcvars64 - exit /B 0 - ) else ( - echo [INFO] vcvars64 not found in PATH. - ) -exit /B 0 - -:try_version - set edition=%~1 - set _vcvars64="C:\Program Files (x86)\Microsoft Visual Studio\2019\%edition%\VC\Auxiliary\Build\vcvars64.bat" - if not exist %_vcvars64% ( - exit /B 1 - ) - call set vcvars64=%%_vcvars64%% -exit /B 0 - -:find_vs_vcvars64 - echo Searching for vcvars64 in VS installations... - - for %%v in (Enterprise Professional Community) do ( - echo Trying edition: %%v - call :try_version %%v - if not defined vcvars64 ( - echo [INFO] No vcvars64 for "%%v" edition - ) else ( - call echo [GOOD] Found vcvars in %%vcvars64%% - exit /B 0 - ) - ) -exit /B 0 - -:main - if not defined DevEnvDir ( - echo DevEnvDir not set, looking for vcvars64... - call :check_path - - if not defined vcvars64 ( - call :find_vs_vcvars64 - ) - call echo vcvars64: %%vcvars64%% - call %%vcvars64%% - ) else ( - echo DevEnvDir already set. Nothing to be done here. - ) -exit /B 0 diff --git a/install.bat b/install.bat deleted file mode 100644 index a202b65b9a..0000000000 --- a/install.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -set __OLD_vcvars64=%vcvars64% -set CLICOLOR_FORCE=1 - -set NINJAFLAGS=%* - -call ensure-vcvars64 - -ninja %NINJAFLAGS% -C build install - -set vcvars64=%__OLD_vcvars64% -set __OLD_vcvars64= -exit /B %ERRORLEVEL% diff --git a/native-file-windows.txt b/native-file-windows.txt deleted file mode 100644 index 69cf9e8e4d..0000000000 --- a/native-file-windows.txt +++ /dev/null @@ -1,13 +0,0 @@ -[binaries] -c = 'clang-cl' -cpp = 'clang-cl' - -[host_machine] -system = 'windows' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -c_args = ['-D_WIN32_WINNT=0x0601', '-march=x86-64'] -cpp_args = ['-D_WIN32_WINNT=0x0601', '-march=x86-64'] diff --git a/platforms/windows-cross.txt b/platforms/windows-cross.txt new file mode 100644 index 0000000000..9dc365bae8 --- /dev/null +++ b/platforms/windows-cross.txt @@ -0,0 +1,5 @@ +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' diff --git a/platforms/windows-native.txt b/platforms/windows-native.txt new file mode 100644 index 0000000000..827e467dac --- /dev/null +++ b/platforms/windows-native.txt @@ -0,0 +1,35 @@ +[constants] +common_flags = ['-D_WIN32_WINNT=0x0601', '-march=x86-64', '-fansi-escape-codes'] + +[binaries] +c = 'clang-cl' +cpp = 'clang-cl' + +[project options] +nls = 'false' +systemd = 'false' +gstreamer = 'false' +dbus = 'false' +audio = 'false' +avahi = 'false' +v4l2 = 'false' +elua = 'false' +x11 = 'false' +physics = 'false' +ethumb = 'false' +emotion = 'false' +eeze = 'false' +pulseaudio = 'false' +harfbuzz = 'false' +fribidi = 'false' +fontconfig = 'false' +edje-sound-and-video = 'false' +libmount = 'false' +evas-loaders-disabler = 'gst,pdf,ps,raw,svg,rsvg,xcf,bmp,dds,generic,gif,ico,jp2k,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm,json' +opengl = 'none' +emotion-loaders-disabler = 'gstreamer1,libvlc,xine' +bindings= + +[properties] +c_args = common_flags +cpp_args = common_flags diff --git a/test.bat b/test.bat deleted file mode 100644 index ed91d23c8e..0000000000 --- a/test.bat +++ /dev/null @@ -1,26 +0,0 @@ -@echo off - -set __OLD_vcvars64=%vcvars64% -set vcvars64="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" -set CLICOLOR_FORCE=1 - -set NINJAFLAGS=%* - -if [%ninjaflags%] == [] ( - set ninjaflags=-C build -) - -set vcvars64="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" -set CLICOLOR_FORCE=1 - -if not defined DevEnvDir ( - echo DevEnvDir not defined. Running vcvars64... - call %vcvars64% - @set DevEnvDir=%cd% -) - -ninja %NINJAFLAGS% test - -set vcvars64=%__OLD_vcvars64% -set __OLD_vcvars64= -exit /B %ERRORLEVEL% From 442cdbaabddbd754973d73acbd52748ccb34db2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 18 Nov 2020 12:28:02 -0300 Subject: [PATCH 02/17] win32: Fix unassigned parameter --- platforms/windows-native.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/windows-native.txt b/platforms/windows-native.txt index 827e467dac..1958dd58b7 100644 --- a/platforms/windows-native.txt +++ b/platforms/windows-native.txt @@ -28,7 +28,7 @@ libmount = 'false' evas-loaders-disabler = 'gst,pdf,ps,raw,svg,rsvg,xcf,bmp,dds,generic,gif,ico,jp2k,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm,json' opengl = 'none' emotion-loaders-disabler = 'gstreamer1,libvlc,xine' -bindings= +bindings = '' [properties] c_args = common_flags From f72d5e9c0ba6b2342f34b38b70eef429df76b61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 15:54:15 -0300 Subject: [PATCH 03/17] win32: Add a custom native-file for windows ci --- platforms/windows-ci-custom-native-properties.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 platforms/windows-ci-custom-native-properties.txt diff --git a/platforms/windows-ci-custom-native-properties.txt b/platforms/windows-ci-custom-native-properties.txt new file mode 100644 index 0000000000..4d14b32b10 --- /dev/null +++ b/platforms/windows-ci-custom-native-properties.txt @@ -0,0 +1,5 @@ +[properties] +cmake_toolchain_file = 'D:/a/efl/efl/vcpkg/scripts/buildsystems/vcpkg.cmake' + +[project options] +buildtype = 'debug' From c3c86bbf4a4bc5e5c8ec7e665e379636740e43cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 15:55:40 -0300 Subject: [PATCH 04/17] win32: use build-in options instead of properties for c_args/cpp_args --- platforms/windows-native.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/windows-native.txt b/platforms/windows-native.txt index 1958dd58b7..f5fde271a6 100644 --- a/platforms/windows-native.txt +++ b/platforms/windows-native.txt @@ -30,6 +30,6 @@ opengl = 'none' emotion-loaders-disabler = 'gstreamer1,libvlc,xine' bindings = '' -[properties] +[built-in options] c_args = common_flags cpp_args = common_flags From cb0c11a86d5f7dbed9cf96e344283f9c673d5cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:16:39 -0300 Subject: [PATCH 05/17] win32: update upload/download artifact to v2 --- .github/workflows/windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 83bc9a40bc..4c4b48aa3c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -105,7 +105,7 @@ jobs: - name: Build run: .\build.bat - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v2 with: name: build path: build @@ -140,9 +140,10 @@ jobs: - name: Test meson run: meson -v - name: Download build artifact - uses: actions/download-artifact@v1.0.0 + uses: actions/download-artifact@v2 with: name: build + path: build - name: Check directory tree (for debugging purposes) run: tree . - name: Add vcpkg installed package dirs to path From 1f4e438c4bea1b994bc9c6965c6fd04935bb280a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:31:58 -0300 Subject: [PATCH 06/17] win32: Directly invoke Meson instead of custom .bat scripts --- .github/workflows/windows.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4c4b48aa3c..fa327d67ad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -98,12 +98,10 @@ jobs: run: echo "::add-path::${{ github.workspace }}/vcpkg/installed/x64-windows/bin" - name: Add vcpkg installed package dirs to path (debug libs) run: echo "::add-path::${{ github.workspace }}/vcpkg/installed/x64-windows/debug/bin" - - name: configure - run: .\configure.bat - env: - vcpkg_toolchain_file: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + - name: Configure + run: meson build --native-file platforms/windows-native.txt --native-file platforms/windows-ci-custom-native-properties.txt - name: Build - run: .\build.bat + run: meson compile -C build - name: Upload artifact uses: actions/upload-artifact@v2 with: From 51f73128b3b3584c2e60d4b8f489d6db9c48c122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:34:21 -0300 Subject: [PATCH 07/17] win32: Prevent Strawberry packages from being used by Meson --- .github/workflows/windows.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fa327d67ad..4d99315c38 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,6 +10,14 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + + # Remove Strawberry + # Strawberry is added by default to the PATH environmment, and it happens + # that the Meson inconveniently preffer its packages over those installed + # with vcpkg, so we just rename Strawberry folder so it can't be found. + - name: Remove Strawberry + run: mv C:\Strawberry C:\Strawberry.disabled + - name: Cache LLVM install uses: actions/cache@v2 id: cache-llvm From 3dab9fd808e892f65d8d9c4c9326748343c33ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:26:08 -0300 Subject: [PATCH 08/17] win32: Replace add-path by pipe Out-File technique --- .github/workflows/windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4d99315c38..59422f0d87 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,7 +41,7 @@ jobs: if: steps.cache-llvm.outputs.cache-hit != 'true' run: choco install llvm - name: Add clang-cl to PATH - run: echo "::add-path::C:\Program Files\LLVM\bin" + run: echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Search clang-cl run: clang-cl -v - name: add python scripts to path @@ -103,9 +103,9 @@ jobs: if: steps.cache-vcpkg.outputs.cache-hit != 'true' run: .\vcpkg\vcpkg install curl:x64-windows - name: Add vcpkg installed package dirs to path - run: echo "::add-path::${{ github.workspace }}/vcpkg/installed/x64-windows/bin" + run: echo "${{ github.workspace }}/vcpkg/installed/x64-windows/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Add vcpkg installed package dirs to path (debug libs) - run: echo "::add-path::${{ github.workspace }}/vcpkg/installed/x64-windows/debug/bin" + run: echo "${{ github.workspace }}/vcpkg/installed/x64-windows/debug/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Configure run: meson build --native-file platforms/windows-native.txt --native-file platforms/windows-ci-custom-native-properties.txt - name: Build @@ -154,16 +154,16 @@ jobs: run: tree . - name: Add vcpkg installed package dirs to path run: | - echo "::add-path::${{ github.workspace }}\vcpkg\installed\x64-windows\bin" - echo "::add-path::${{ github.workspace }}\vcpkg\installed\x64-windows\debug\bin" + echo "${{ github.workspace }}\vcpkg\installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "${{ github.workspace }}\vcpkg\installed\x64-windows\debug\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Check installed vcpkg libs run: | dir "${{ github.workspace }}\vcpkg\installed\x64-windows\bin" dir "${{ github.workspace }}\vcpkg\installed\x64-windows\debug\bin" - name: Add build libs to path run: | - echo "::add-path::${{ github.workspace }}\build\subprojects\getopt" - echo "::add-path::${{ github.workspace }}\build\subprojects\pcre-8.37" + echo "${{ github.workspace }}\build\subprojects\getopt" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "${{ github.workspace }}\build\subprojects\pcre-8.37" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Check built EFL libs run: | dir "${{ github.workspace }}\build\subprojects\getopt" From 118d45951fb937ea772df30585dc1f634e1ec097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:27:21 -0300 Subject: [PATCH 09/17] win32: Let setup-python add python to path --- .github/workflows/windows.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 59422f0d87..245d44fa58 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -44,11 +44,10 @@ jobs: run: echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Search clang-cl run: clang-cl -v - - name: add python scripts to path - run: | - $python_version = (py -3 --version).replace("Python ", "") - $python_scripts_path = ($(echo C:\hostedtoolcache\windows\Python\$python_version\x64\Scripts ) -join "") - echo "::add-path::$python_scripts_path" + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' - name: install ninja run: py -3 -m pip install ninja - name: test ninja @@ -121,11 +120,10 @@ jobs: needs: build steps: - uses: actions/checkout@v2 - - name: Add python scripts to path - run: | - $python_version = (py -3 --version).replace("Python ", "") - $python_scripts_path = ($(echo C:\hostedtoolcache\windows\Python\$python_version\x64\Scripts ) -join "") - echo "::add-path::$python_scripts_path" + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' - name: Cache vcpkg uses: actions/cache@v2 id: cache-vcpkg From 6e73eebee46ef399d2241d86a90f4ac06ade6780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:39:31 -0300 Subject: [PATCH 10/17] win32: Rename cache-llvm. --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 245d44fa58..8aefa3561a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -25,8 +25,8 @@ jobs: cache-name: cache-llvm with: path: "C:\\Program Files\\LLVM" - key: cache-llvm-v10.0.0.0-1 - restore-keys: cache-llvm-v10.0.0.0-1 + key: cache-llvm + restore-keys: cache-llvm - name: Cache vcpkg uses: actions/cache@v2 id: cache-vcpkg From 41a52b6415b9d46bdbbffee2501425d4cd89c312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:42:40 -0300 Subject: [PATCH 11/17] win32: combine all packages into one vcpkg cmd --- .github/workflows/windows.yml | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8aefa3561a..c59c0067e9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -61,6 +61,7 @@ jobs: arch: x64 - name: Show from where clang-cl run: where clang-cl + - name: Check if vcpkg is already installed if: steps.cache-vcpkg.outputs.cache-hit == 'true' run: .\vcpkg\vcpkg version @@ -74,33 +75,9 @@ jobs: - name: Run vcpkg bootstrap if: steps.cache-vcpkg.outputs.cache-hit != 'true' run: .\vcpkg\bootstrap-vcpkg.bat - - name: Install openssl (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install openssl:x64-windows - - name: Install freetype (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install freetype:x64-windows - - name: Install libjpeg (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install libjpeg-turbo:x64-windows - - name: Install lua (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install lua:x64-windows - - name: Install luajit (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install luajit:x64-windows - - name: Install zlib (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install zlib:x64-windows - - name: Install check (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install check:x64-windows - - name: Install getopt (vcpkg) - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install getopt:x64-windows - - name: Install curl (vcpkg) + - name: Install vcpkg packages if: steps.cache-vcpkg.outputs.cache-hit != 'true' - run: .\vcpkg\vcpkg install curl:x64-windows + run: .\vcpkg\vcpkg --triplet x64-windows install openssl freetype libjpeg-turbo lua luajit zlib check getopt curl - name: Add vcpkg installed package dirs to path run: echo "${{ github.workspace }}/vcpkg/installed/x64-windows/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Add vcpkg installed package dirs to path (debug libs) From 3055ee5af6c9522af22b1064e23f8e2efe9792e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:44:19 -0300 Subject: [PATCH 12/17] win32: Upgrade packages and integrate vcpkg --- .github/workflows/windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c59c0067e9..b3ebbc632f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -82,6 +82,11 @@ jobs: run: echo "${{ github.workspace }}/vcpkg/installed/x64-windows/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Add vcpkg installed package dirs to path (debug libs) run: echo "${{ github.workspace }}/vcpkg/installed/x64-windows/debug/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Upgrade Cached Packages + if: steps.cache-vcpkg.outputs.cache-hit == 'true' + run: .\vcpkg\vcpkg --triplet x64-windows upgrade + - name: Run vcpkg integrate install + run: .\vcpkg\vcpkg integrate install - name: Configure run: meson build --native-file platforms/windows-native.txt --native-file platforms/windows-ci-custom-native-properties.txt - name: Build From 87d8e8f7e95f023ea52127856f94ee516ef5b1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:45:52 -0300 Subject: [PATCH 13/17] win32: Run VCVARS64 before Meson --- .github/workflows/windows.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b3ebbc632f..1293a0d5a5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -87,6 +87,9 @@ jobs: run: .\vcpkg\vcpkg --triplet x64-windows upgrade - name: Run vcpkg integrate install run: .\vcpkg\vcpkg integrate install + - name: Run VCVARS64 + shell: cmd + run: '"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"' - name: Configure run: meson build --native-file platforms/windows-native.txt --native-file platforms/windows-ci-custom-native-properties.txt - name: Build @@ -148,6 +151,9 @@ jobs: run: | dir "${{ github.workspace }}\build\subprojects\getopt" dir "${{ github.workspace }}\build\subprojects\pcre-8.37" + - name: Run VCVARS64 + shell: cmd + run: '"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"' - name: Check path run: $env:PATH - name: Run tests From b104cc6333e621c37ff01ba69baf6a5624c0f33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:47:45 -0300 Subject: [PATCH 14/17] win32: Add comments with tips for debugging vcpkg and Meson --- .github/workflows/windows.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1293a0d5a5..5a27585b53 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -87,11 +87,21 @@ jobs: run: .\vcpkg\vcpkg --triplet x64-windows upgrade - name: Run vcpkg integrate install run: .\vcpkg\vcpkg integrate install + # Usefull for debugging vcpkg: +# - name: List packages +# run: .\vcpkg\vcpkg list +# - name: List installed packages structure +# run: tree vcpkg\installed\x64-windows /F - name: Run VCVARS64 shell: cmd run: '"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"' - name: Configure run: meson build --native-file platforms/windows-native.txt --native-file platforms/windows-ci-custom-native-properties.txt + # Usefull for debuggin Meson: +# - name: Show meson config +# run: meson configure build +# - name: Show all meson introspect +# run: meson introspect --all --indent build - name: Build run: meson compile -C build - name: Upload artifact From 872dc0737b9104ba689d9cefa079ee2bd8058d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 16:50:16 -0300 Subject: [PATCH 15/17] win32: cache installed pip packages --- .github/workflows/windows.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5a27585b53..1ee855fb84 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -48,12 +48,13 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' - - name: install ninja - run: py -3 -m pip install ninja - - name: test ninja - run: ninja --version - - name: install meson - run: py -3 -m pip install meson + - name: Cache pip + uses: actions/cache@v2 + with: + path: (py -3 -m pip cache dir) + key: cache-pip + - name: Install python dependencies + run: py -3 -m pip install --upgrade --upgrade-strategy eager pip ninja meson - name: test meson run: meson -v - uses: ilammy/msvc-dev-cmd@v1 @@ -119,6 +120,13 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' + - name: Cache pip + uses: actions/cache@v2 + with: + path: (py -3 -m pip cache dir) + key: cache-pip + - name: Install python dependencies + run: py -3 -m pip install --upgrade --upgrade-strategy eager pip ninja meson - name: Cache vcpkg uses: actions/cache@v2 id: cache-vcpkg @@ -129,9 +137,6 @@ jobs: env: VCPKG_INFO: ${{ toJSON(steps.cache-vcpkg) }} run: echo "${VCPKG_INFO}" - - name: Install ninja - # unexplicably, installation returns error code 1 if a cache location is used - run: py -3 -m pip install ninja - name: Test ninja run: ninja --version - name: Install meson From b5593bd7ec1b83971aeae40ce8eacac28cb03eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 18:38:05 -0300 Subject: [PATCH 16/17] win32: use msvc-dev-cmd action from the beginning --- .github/workflows/windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1ee855fb84..1d8e96bf32 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,6 +10,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 # Remove Strawberry # Strawberry is added by default to the PATH environmment, and it happens @@ -57,9 +60,6 @@ jobs: run: py -3 -m pip install --upgrade --upgrade-strategy eager pip ninja meson - name: test meson run: meson -v - - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - name: Show from where clang-cl run: where clang-cl From ad9d1f4cfa4bb8ffa22f2593a39a32ba01bd9f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Wed, 25 Nov 2020 18:47:09 -0300 Subject: [PATCH 17/17] win32: Separate sub-sections with comments --- .github/workflows/windows.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1d8e96bf32..848e5ab21d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,6 +21,7 @@ jobs: - name: Remove Strawberry run: mv C:\Strawberry C:\Strawberry.disabled + # CACHE LLVM - name: Cache LLVM install uses: actions/cache@v2 id: cache-llvm @@ -30,6 +31,8 @@ jobs: path: "C:\\Program Files\\LLVM" key: cache-llvm restore-keys: cache-llvm + + # CACHE VCPKG - name: Cache vcpkg uses: actions/cache@v2 id: cache-vcpkg @@ -40,6 +43,8 @@ jobs: env: VCPKG_INFO: ${{ toJSON(steps.cache-vcpkg) }} run: echo "${VCPKG_INFO}" + + # INSTALL LLVM - name: Install LLVM if: steps.cache-llvm.outputs.cache-hit != 'true' run: choco install llvm @@ -47,15 +52,21 @@ jobs: run: echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Search clang-cl run: clang-cl -v + + # SETUP PYTHON - name: Setup Python uses: actions/setup-python@v2 with: python-version: '3.x' + + # CACHE PYTHON - name: Cache pip uses: actions/cache@v2 with: path: (py -3 -m pip cache dir) key: cache-pip + + # INSTALL PYTHON PACKAGES - name: Install python dependencies run: py -3 -m pip install --upgrade --upgrade-strategy eager pip ninja meson - name: test meson @@ -63,6 +74,7 @@ jobs: - name: Show from where clang-cl run: where clang-cl + # INSTALL VCPKG - name: Check if vcpkg is already installed if: steps.cache-vcpkg.outputs.cache-hit == 'true' run: .\vcpkg\vcpkg version @@ -76,6 +88,8 @@ jobs: - name: Run vcpkg bootstrap if: steps.cache-vcpkg.outputs.cache-hit != 'true' run: .\vcpkg\bootstrap-vcpkg.bat + + # INSTALL VCPKG PACKAGES - name: Install vcpkg packages if: steps.cache-vcpkg.outputs.cache-hit != 'true' run: .\vcpkg\vcpkg --triplet x64-windows install openssl freetype libjpeg-turbo lua luajit zlib check getopt curl @@ -93,6 +107,8 @@ jobs: # run: .\vcpkg\vcpkg list # - name: List installed packages structure # run: tree vcpkg\installed\x64-windows /F + + # BUILD EFL - name: Run VCVARS64 shell: cmd run: '"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"' @@ -110,6 +126,7 @@ jobs: with: name: build path: build + tests: name: Tests runs-on: windows-latest @@ -120,6 +137,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' + + # CACHE PIP PACKAGES - name: Cache pip uses: actions/cache@v2 with: @@ -127,6 +146,8 @@ jobs: key: cache-pip - name: Install python dependencies run: py -3 -m pip install --upgrade --upgrade-strategy eager pip ninja meson + + # CACHE VCPKG - name: Cache vcpkg uses: actions/cache@v2 id: cache-vcpkg @@ -137,12 +158,16 @@ jobs: env: VCPKG_INFO: ${{ toJSON(steps.cache-vcpkg) }} run: echo "${VCPKG_INFO}" + + # CHECK PYTHON PACKAGES - name: Test ninja run: ninja --version - name: Install meson run: py -3 -m pip install meson - name: Test meson run: meson -v + + # GET EFL BUILT ARTIFACTS - name: Download build artifact uses: actions/download-artifact@v2 with: @@ -150,6 +175,8 @@ jobs: path: build - name: Check directory tree (for debugging purposes) run: tree . + + # SETUP VCPKG PACKAGES - name: Add vcpkg installed package dirs to path run: | echo "${{ github.workspace }}\vcpkg\installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append @@ -158,6 +185,8 @@ jobs: run: | dir "${{ github.workspace }}\vcpkg\installed\x64-windows\bin" dir "${{ github.workspace }}\vcpkg\installed\x64-windows\debug\bin" + + # SETUP BUILT EFL - name: Add build libs to path run: | echo "${{ github.workspace }}\build\subprojects\getopt" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append @@ -166,6 +195,8 @@ jobs: run: | dir "${{ github.workspace }}\build\subprojects\getopt" dir "${{ github.workspace }}\build\subprojects\pcre-8.37" + + # TEST EFL - name: Run VCVARS64 shell: cmd run: '"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"'