From a5d166cf7118fb86b256616cda95447df3acb847 Mon Sep 17 00:00:00 2001 From: James Groom Date: Sat, 19 Sep 2020 11:08:34 +1000 Subject: [PATCH] Partial fix for #2353 (files in dev builds) (#2410) * Move .so libraries to dll dir, update some build scripts * Move OpenTK.dll.config with OpenTK.dll * Keep EmuHawkMono.sh in Windows-built artifacts * Add Package.sh to match QuickTestBuildAndPackage.bat used as `Dist/BuildRelease.sh && Dist/Package.sh` * Update GitLab CI to use Package.sh --- .gitignore | 1 + .gitlab-ci.yml | 35 ++++++++---------- Assets/{ => dll}/libbizlynx.dll.so | Bin Assets/{ => dll}/libbizswan.dll.so | Bin Assets/{ => dll}/libblip_buf.so | Bin Assets/{ => dll}/libgambatte.dll.so | Bin Assets/{ => dll}/libwaterboxhost.so | Bin Dist/Package.sh | 7 ++++ Dist/QuickTestBuildAndPackage.bat | 3 +- README.md | 2 +- .../build-debug-no-dirty-detection.sh | 4 +- waterbox/waterboxhost/build-debug.sh | 4 +- waterbox/waterboxhost/build-release.sh | 4 +- 13 files changed, 33 insertions(+), 27 deletions(-) rename Assets/{ => dll}/libbizlynx.dll.so (100%) rename Assets/{ => dll}/libbizswan.dll.so (100%) rename Assets/{ => dll}/libblip_buf.so (100%) rename Assets/{ => dll}/libgambatte.dll.so (100%) rename Assets/{ => dll}/libwaterboxhost.so (100%) create mode 100755 Dist/Package.sh diff --git a/.gitignore b/.gitignore index 3d079f86f4..6aaee7f494 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ **/obj/** /output/** /output64/** +/packaged_output /test_output **/Release/** **/Debug/** diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1055616483..2d25b371d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,31 +3,15 @@ image: mcr.microsoft.com/dotnet/core/sdk:3.1 stages: - build - test + - package -build_master: - artifacts: - expire_in: "1 month" - name: "BizHawk_devbuild_$CI_COMMIT_REF_SLUG" - paths: - - output - - test_output - rules: - - if: '$CI_COMMIT_REF_SLUG == "master"' - when: always - script: - - Dist/BuildRelease.sh - stage: build - -build_not_master: +build: artifacts: expire_in: "30 minutes" - name: "BizHawk_devbuild_$CI_COMMIT_REF_SLUG" + name: "BizHawk_tempbuild_${CI_COMMIT_REF_SLUG}_$CI_COMMIT_SHORT_SHA" paths: - output - test_output - rules: - - if: '$CI_COMMIT_REF_SLUG != "master"' - when: always script: - Dist/BuildRelease.sh stage: build @@ -42,6 +26,19 @@ check_style: - Dist/BuildRelease.sh -p:MachineRunAnalyzersDuringBuild=true || Dist/BuildRelease.sh -p:MachineRunAnalyzersDuringBuild=true stage: test +package: + artifacts: + expire_in: "1 month" + name: "BizHawk_devbuild_${CI_COMMIT_REF_SLUG}_$CI_COMMIT_SHORT_SHA" + paths: + - packaged_output/* + rules: + - if: '$CI_COMMIT_REF_SLUG == "master"' + when: always + script: + - Dist/Package.sh + stage: package + run_tests: artifacts: paths: diff --git a/Assets/libbizlynx.dll.so b/Assets/dll/libbizlynx.dll.so similarity index 100% rename from Assets/libbizlynx.dll.so rename to Assets/dll/libbizlynx.dll.so diff --git a/Assets/libbizswan.dll.so b/Assets/dll/libbizswan.dll.so similarity index 100% rename from Assets/libbizswan.dll.so rename to Assets/dll/libbizswan.dll.so diff --git a/Assets/libblip_buf.so b/Assets/dll/libblip_buf.so similarity index 100% rename from Assets/libblip_buf.so rename to Assets/dll/libblip_buf.so diff --git a/Assets/libgambatte.dll.so b/Assets/dll/libgambatte.dll.so similarity index 100% rename from Assets/libgambatte.dll.so rename to Assets/dll/libgambatte.dll.so diff --git a/Assets/libwaterboxhost.so b/Assets/dll/libwaterboxhost.so similarity index 100% rename from Assets/libwaterboxhost.so rename to Assets/dll/libwaterboxhost.so diff --git a/Dist/Package.sh b/Dist/Package.sh new file mode 100755 index 0000000000..34921861e9 --- /dev/null +++ b/Dist/Package.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +cd "$(dirname "$0")/.." +rm -fr "packaged_output" && mkdir -p "packaged_output" +find "output" -type f \( -wholename "output/EmuHawk.exe" -o -wholename "output/DiscoHawk.exe" -o -wholename "output/*.config" -o -wholename "output/defctrl.json" -o -wholename "output/EmuHawkMono.sh" -o -wholename "output/dll/*" -o -wholename "output/shaders/*" -o -wholename "output/gamedb/*" -o -wholename "output/Tools/*" -o -wholename "output/NES/Palettes/*" -o -wholename "output/Lua/*" -o -wholename "output/Gameboy/Palettes/*" \) -not -name "*.pdb" -not -name "*.lib" -not -name "*.pgd" -not -name "*.ipdb" -not -name "*.iobj" -not -name "*.exp" -not -wholename "output/dll/libsneshawk-64*.exe" -not -name "*.ilk" -not -wholename "output/dll/gpgx.elf" -not -wholename "output/dll/miniclient.*" -exec install -D -m644 -T "{}" "packaged_{}" \; +for f in output/*.dll; do cp "$f" "packaged_output/dll"; done && for f in output/*.dll.config; do cp "$f" "packaged_output/dll"; done # the Batch script does this; IMO this should be done in MSBuild +find "packaged_output" -type f -name "*.sh" -exec chmod +x {} \; # installed with -m644 but needs to be 755 diff --git a/Dist/QuickTestBuildAndPackage.bat b/Dist/QuickTestBuildAndPackage.bat index b7a08bc4b5..e071323654 100644 --- a/Dist/QuickTestBuildAndPackage.bat +++ b/Dist/QuickTestBuildAndPackage.bat @@ -30,9 +30,10 @@ rem that might be troublesome some day..... if it does get troublesome, then we' rem explicitly list the OK ones here as individual copies. until then.... copy *.dll dll +copy *.dll.config dll rem Now, we're about to zip and then unzip. Why, you ask? Because that's just the way this evolved. -..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe EmuHawk.exe.config DiscoHawk.exe DiscoHawk.exe.config defctrl.json dll shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x dll\libsneshawk-64*.exe -x *.ilk -x dll\gpgx.elf -x dll\miniclient.* +..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe EmuHawk.exe.config DiscoHawk.exe DiscoHawk.exe.config defctrl.json EmuHawkMono.sh dll shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x dll\libsneshawk-64*.exe -x *.ilk -x dll\gpgx.elf -x dll\miniclient.* cd ..\Dist .\unzip.exe %NAME% -d temp diff --git a/README.md b/README.md index 6829efb081..2463e23e45 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ Development builds are made automatically whenever someone contributes. Because Click one of the buttons above to download a dev build (they're also at the top of this readme). AppVeyor uses Windows and GitLab CI uses Linux, but they work all the same. * On the AppVeyor page for a Build, click "Artifacts", then `BizHawk_Developer--#.zip`. -* On the GitLab CI page for a Pipeline, click "Jobs", then the download button at the end of the entry with the name `build_master`/`build_not_master`. (On the Pipelines list page, there's also a download button on each Pipeline.) +* On the GitLab CI page for a Pipeline, click "Jobs", then the download button on the right under the heading "Package". (On the Pipelines list page, there's also a download button on each Pipeline—choose `package:archive` there.) To find the dev builds for a specific commit, you can click the green checkmark next to it (in the [commit history](https://github.com/TASVideos/BizHawk/commits/master), for example) for a dropdown, then click either "Details" link to go to AppVeyor/GitLab. diff --git a/waterbox/waterboxhost/build-debug-no-dirty-detection.sh b/waterbox/waterboxhost/build-debug-no-dirty-detection.sh index 5e4f4b061f..515de9e6f9 100644 --- a/waterbox/waterboxhost/build-debug-no-dirty-detection.sh +++ b/waterbox/waterboxhost/build-debug-no-dirty-detection.sh @@ -1,4 +1,4 @@ #!/bin/sh cargo b --features "no-dirty-detection" -cp target/debug/libwaterboxhost.so ../../Assets -cp target/debug/libwaterboxhost.so ../../output +cp target/debug/libwaterboxhost.so ../../Assets/dll +cp target/debug/libwaterboxhost.so ../../output/dll diff --git a/waterbox/waterboxhost/build-debug.sh b/waterbox/waterboxhost/build-debug.sh index 08e0108c6b..5c9bd3ffd2 100644 --- a/waterbox/waterboxhost/build-debug.sh +++ b/waterbox/waterboxhost/build-debug.sh @@ -1,4 +1,4 @@ #!/bin/sh cargo b -cp target/debug/libwaterboxhost.so ../../Assets -cp target/debug/libwaterboxhost.so ../../output +cp target/debug/libwaterboxhost.so ../../Assets/dll +cp target/debug/libwaterboxhost.so ../../output/dll diff --git a/waterbox/waterboxhost/build-release.sh b/waterbox/waterboxhost/build-release.sh index a9b285a094..ceb390b395 100644 --- a/waterbox/waterboxhost/build-release.sh +++ b/waterbox/waterboxhost/build-release.sh @@ -1,4 +1,4 @@ #!/bin/sh cargo b --release -cp target/release/libwaterboxhost.so ../../Assets -cp target/release/libwaterboxhost.so ../../output +cp target/release/libwaterboxhost.so ../../Assets/dll +cp target/release/libwaterboxhost.so ../../output/dll