From 57fb6fe0b1de475904f62ea7ee3b60ea7a4ad343 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 21:51:35 +0100 Subject: [PATCH 01/20] start experimenting --- azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b149f4bd4e..121b3f8b57 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,8 +1,13 @@ trigger: - master + +variables: +- group: cachix-write + jobs: - job: Linux + enabled: false pool: vmImage: 'ubuntu-20.04' steps: @@ -35,6 +40,7 @@ jobs: buildPlatform: 'x86_64-linux' - job: macOS + enabled: false pool: vmImage: 'macOS-10.15' steps: @@ -63,6 +69,7 @@ jobs: buildPlatform: 'x86_64-macos' - job: nix_68k + enabled: false pool: vmImage: 'ubuntu-20.04' steps: From cec02f8440656a42f537efada44242f0e3175c07 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 21:56:36 +0100 Subject: [PATCH 02/20] it's 'condition' --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 121b3f8b57..31e9796639 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ variables: jobs: - job: Linux - enabled: false + condition: false pool: vmImage: 'ubuntu-20.04' steps: @@ -40,7 +40,7 @@ jobs: buildPlatform: 'x86_64-linux' - job: macOS - enabled: false + condition: false pool: vmImage: 'macOS-10.15' steps: @@ -69,7 +69,7 @@ jobs: buildPlatform: 'x86_64-macos' - job: nix_68k - enabled: false + condition: false pool: vmImage: 'ubuntu-20.04' steps: From a397a048e25474993a58ee148e0d9b487e476fe8 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 22:28:39 +0100 Subject: [PATCH 03/20] try a secret --- azure-pipelines.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31e9796639..70000f9e5d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,6 +94,7 @@ jobs: - job: nix_ppc + condition: false pool: vmImage: 'ubuntu-20.04' steps: @@ -114,3 +115,13 @@ jobs: displayName: Copy result out of docker - publish: CompiledSamples artifact: PowerPC Samples + +-job: test + pool: + vmImage: 'ubuntu-20.04' + steps: + - script: | + echo Fooo + echo ${SECRETTEST} + env: + SECRETTEST: $[SecretTest] From 0ec7ceed397f36813dbed7670ebce49b359e9238 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 22:31:32 +0100 Subject: [PATCH 04/20] fix --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 70000f9e5d..93eef6ab1d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -116,7 +116,7 @@ jobs: - publish: CompiledSamples artifact: PowerPC Samples --job: test +- job: test pool: vmImage: 'ubuntu-20.04' steps: From da16249e0aff815500d05367dfa90ed518c2b341 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 22:32:11 +0100 Subject: [PATCH 05/20] remove vargroup --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93eef6ab1d..b2210bf12e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,9 +1,6 @@ trigger: - master -variables: -- group: cachix-write - jobs: - job: Linux From 4aae6074e55da8b14adec701a9cafe20f6af38c2 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 22:35:03 +0100 Subject: [PATCH 06/20] different brackets --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b2210bf12e..ba517a97dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -119,6 +119,6 @@ jobs: steps: - script: | echo Fooo - echo ${SECRETTEST} + echo $SECRETTEST env: - SECRETTEST: $[SecretTest] + SECRETTEST: $(SecretTest) From 6c8840ae2c49bce666b1e1ae80e86cd27c0126b9 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 23:06:07 +0100 Subject: [PATCH 07/20] deploy to cachix --- azure-pipelines.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba517a97dc..26525fe648 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,7 +91,6 @@ jobs: - job: nix_ppc - condition: false pool: vmImage: 'ubuntu-20.04' steps: @@ -112,13 +111,13 @@ jobs: displayName: Copy result out of docker - publish: CompiledSamples artifact: PowerPC Samples - -- job: test - pool: - vmImage: 'ubuntu-20.04' - steps: - script: | - echo Fooo - echo $SECRETTEST + docker start nix -i < Date: Mon, 3 Jan 2022 23:27:42 +0100 Subject: [PATCH 08/20] fix copy-paste-stupidity --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 26525fe648..4c9b1a0229 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -116,7 +116,7 @@ jobs: nix-env -iA cachix -f https://cachix.org/api/v1/install cd src nix-shell -A powerpc --command exit - nix-store -qR --include-outputs $(nix-instantiate default.nix -A powerpc) | cachix push $1 + nix-store -qR --include-outputs $(nix-instantiate default.nix -A powerpc) | cachix push autc04 EOF displayName: Push to Cachix env: From ffd9c09d1a9c992e6969952043690cefcb2f7ab6 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 3 Jan 2022 23:50:06 +0100 Subject: [PATCH 09/20] - pass token into docker - use cachix while building --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4c9b1a0229..e3c66e64dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -98,9 +98,9 @@ jobs: submodules: true - script: | docker run -i --name nix -v`pwd`:/src nixos/nix:latest < Date: Tue, 4 Jan 2022 00:18:30 +0100 Subject: [PATCH 10/20] ado: downgrade to nixos/nix:2.3.12 until the NixOS/nix#5797 fix arrives in a release --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e3c66e64dc..648956b22a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -97,7 +97,7 @@ jobs: - checkout: self submodules: true - script: | - docker run -i --name nix -v`pwd`:/src nixos/nix:latest < Date: Tue, 4 Jan 2022 00:38:48 +0100 Subject: [PATCH 11/20] add an escape --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 648956b22a..6acdf267c0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -116,7 +116,7 @@ jobs: export CACHIX_AUTH_TOKEN=$CACHIX_AUTH_TOKEN cd src nix-shell -A powerpc --command exit - nix-store -qR --include-outputs $(nix-instantiate default.nix -A powerpc) | cachix push autc04 + nix-store -qR --include-outputs \$(nix-instantiate default.nix -A powerpc) | cachix push autc04 EOF displayName: Push to Cachix env: From a810c7dde73a9884900badd3d7b73361323d09cb Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Tue, 4 Jan 2022 01:10:47 +0100 Subject: [PATCH 12/20] ue the same settings for nix/m68k --- azure-pipelines.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6acdf267c0..9899cb6d2b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -66,17 +66,15 @@ jobs: buildPlatform: 'x86_64-macos' - job: nix_68k - condition: false pool: vmImage: 'ubuntu-20.04' steps: - checkout: self submodules: true - script: | - docker run -i --name nix -v`pwd`:/src nixos/nix:latest < Date: Tue, 4 Jan 2022 01:12:56 +0100 Subject: [PATCH 13/20] fixup --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9899cb6d2b..8d56869d1e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -86,8 +86,6 @@ jobs: - publish: CompiledSamples artifact: 68K Samples - - publish: CompiledSamples - artifact: PowerPC Samples - script: | docker start nix -i < Date: Mon, 17 Jan 2022 00:12:35 +0100 Subject: [PATCH 14/20] fix MakeImport tool --- PEFTools/MakeImport.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PEFTools/MakeImport.cc b/PEFTools/MakeImport.cc index d5d5eeb3e2..1996dc402f 100755 --- a/PEFTools/MakeImport.cc +++ b/PEFTools/MakeImport.cc @@ -215,7 +215,13 @@ void MakeImportLibrary(char *pefptr, size_t pefsize, fs::path dest, fs::path tmp bool MakeImportLibraryMulti(fs::path path, fs::path libname) { ResourceFile resFile; - assert(resFile.read(path.string())); + bool readSuccess = resFile.read(path.string()); + + if (!readSuccess) + { + std::cerr << "Could not read input file.\n"; + return false; + } std::vector data(resFile.data.begin(), resFile.data.end()); From 7f8f47ca668cf37038666ab832bbbe53a15a0cb5 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 17 Jan 2022 00:17:02 +0100 Subject: [PATCH 15/20] enable powerpc universal interfaces via nix --- interfaces-and-libraries.sh | 5 +++-- nix/universal.nix | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/interfaces-and-libraries.sh b/interfaces-and-libraries.sh index 84c457eadb..c46b670919 100755 --- a/interfaces-and-libraries.sh +++ b/interfaces-and-libraries.sh @@ -259,6 +259,7 @@ function setup68KLibraries() function setupPPCLibraries() { + DEST=${1:-"$PREFIX/universal"} mkdir -p "$DEST/libppc" case `ResInfo -n "$INTERFACELIB" 2> /dev/null || echo 0` in 0) @@ -273,7 +274,7 @@ function setupPPCLibraries() echo "Building PowerPC import libraries..." for shlib in "${SHAREDLIBRARIES}/"*; do libname=`basename "$shlib"` - implib=lib${libname}.a + implib=lib${libname%.bin}.a printf " %30s => %-30s\n" ${libname} ${implib} MakeImport "$shlib" "$DEST/libppc/$implib" || true done @@ -288,7 +289,7 @@ function setupPPCLibraries() cp "$obj" "$DEST/libppc/" basename=`basename "${obj%.o}"` # and wrap it in a .a archive for convenience - lib="$PREFIX"/universal/libppc/lib$basename.a + lib="$DEST"/libppc/lib$basename.a rm -f "$lib" powerpc-apple-macos-ar cqs "$lib" "$obj" fi diff --git a/nix/universal.nix b/nix/universal.nix index b8e1239634..1f7df2856b 100644 --- a/nix/universal.nix +++ b/nix/universal.nix @@ -26,20 +26,31 @@ pkgs: prevPkgs: ConvertDiskImage $src decoded.dsk export HOME=. hmount decoded.dsk - mkdir -p CIncludes RIncludes lib68 + mkdir -p CIncludes RIncludes hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:CIncludes:*.h' CIncludes/ hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:RIncludes:*.r' RIncludes/ mkdir -p $out/include $out/RIncludes bash ${../prepare-headers.sh} CIncludes $out/include bash ${../prepare-rincludes.sh} RIncludes $out/RIncludes - hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:Libraries:*.o' lib68 - . ${../interfaces-and-libraries.sh} + '' + (pkgs.lib.optionalString (pkgs.targetPlatform.cmakeSystemName == "Retro68") '' + mkdir -p lib68 + hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:Libraries:*.o' lib68 M68KLIBRARIES=lib68 setup68KLibraries $out/ mv $out/lib68k $out/lib - ''; + '') + (pkgs.lib.optionalString (pkgs.targetPlatform.cmakeSystemName != "Retro68") '' + mkdir -p libppc peflibs + hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:PPCLibraries:*.o' libppc + hcopy -m 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:SharedLibraries:*' peflibs + PPCLIBRARIES=libppc + SHAREDLIBRARIES=peflibs + INTERFACELIB=peflibs/InterfaceLib.bin + + setupPPCLibraries $out/ + mv $out/libppc $out/lib + ''); }; }); } // prevPkgs.lib.optionalAttrs (prevPkgs.targetPlatform ? retro68) { From fb5be44cbda72b1217d8ce5a451ef5f7cfe53593 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 17 Jan 2022 00:17:48 +0100 Subject: [PATCH 16/20] build launchapplserver as parrt of samples --- nix/samples.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/samples.nix b/nix/samples.nix index e71bfaf15e..24f9ac71d7 100644 --- a/nix/samples.nix +++ b/nix/samples.nix @@ -11,6 +11,7 @@ pkgs: prevPkgs: { installPhase = '' mkdir $out cp *.bin $out/ + rm -f $out/*.code.bin $out/*.rsrc.bin ''; }) ({ dialog = ../Samples/Dialog; @@ -24,7 +25,7 @@ pkgs: prevPkgs: { } // lib.optionalAttrs (targetPlatform.cmakeSystemName == "Retro68") { systemextension = ../Samples/SystemExtension; launcher = ../Samples/Launcher; - }); + }) // { launchapplserver = self.launchapplserver; }; in runCommand "retro68.samples" { } '' mkdir -p $out/ @@ -40,7 +41,8 @@ pkgs: prevPkgs: { nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ]; installPhase = '' mkdir $out - cp *.bin $out/ + cp Server/*.bin $out/ + rm $out/*.code.bin $out/*.rsrc.bin ''; }; }); From c3c2b8723a1cf1a8642180f8a52f24118031f85a Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 17 Jan 2022 00:22:57 +0100 Subject: [PATCH 17/20] upload samples to cachix --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8d56869d1e..e98774deeb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,6 +90,7 @@ jobs: docker start nix -i < Date: Mon, 17 Jan 2022 00:32:51 +0100 Subject: [PATCH 18/20] fix build command --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e98774deeb..c7c9dd6166 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,7 +90,7 @@ jobs: docker start nix -i < Date: Mon, 17 Jan 2022 00:53:12 +0100 Subject: [PATCH 19/20] re-enable non-nix builds on azure --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c7c9dd6166..9bdd885725 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,6 @@ trigger: jobs: - job: Linux - condition: false pool: vmImage: 'ubuntu-20.04' steps: @@ -37,7 +36,6 @@ jobs: buildPlatform: 'x86_64-linux' - job: macOS - condition: false pool: vmImage: 'macOS-10.15' steps: From 123f0069d5ffc4537136fdb06484f413e761a5e5 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 17 Jan 2022 21:39:58 +0100 Subject: [PATCH 20/20] increase timeouts on azure --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9bdd885725..f7504897bf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,7 @@ jobs: - job: Linux pool: vmImage: 'ubuntu-20.04' + timeoutInMinutes: 90 steps: - checkout: self submodules: true @@ -38,6 +39,7 @@ jobs: - job: macOS pool: vmImage: 'macOS-10.15' + timeoutInMinutes: 90 steps: - checkout: self submodules: true