|
| 1 | +Set-PSDebug -Trace 1 |
| 2 | + |
| 3 | +# Avoid long paths on Windows |
| 4 | +$env:STACK_ROOT="D:\s" |
| 5 | +$env:STACK_WORK=".w" |
| 6 | +$env:WORK_DIR="D:\w" |
| 7 | +# Override the temp directory to avoid sed escaping issues |
| 8 | +# See https://github.com/haskell/cabal/issues/5386 |
| 9 | +$env:TMP="D:\\tmp" |
| 10 | + |
| 11 | +# Store the original checkout directory |
| 12 | +$env:CHECKOUT_PATH=(Get-Item -Path ".\").FullName |
| 13 | + |
| 14 | +# Temp directory needs to exist |
| 15 | +New-Item -ItemType Directory -Force -Path $env:TMP |
| 16 | + |
| 17 | +# Setup stuff (commented out) |
| 18 | +#mkdir d:\ghc |
| 19 | +# |
| 20 | +#Invoke-WebRequest "https://s3.eu-central-1.amazonaws.com/ci-static/ghc-8.2.2-x86_64-unknown-mingw32.tar.xz" -OutFile "D:\ghc\ghc.tar.xz" -UserAgent "Curl" |
| 21 | +# |
| 22 | +#7z x D:\ghc\ghc.tar.xz -oD:\ghc |
| 23 | +# |
| 24 | +#7z x D:\ghc\ghc.tar -oD:\ghc |
| 25 | + |
| 26 | +# OpenSSL |
| 27 | +# |
| 28 | +#$env:USERPROFILE |
| 29 | +#(New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2p.exe', "D:\Downloads\Win64OpenSSL.exe") |
| 30 | +#cmd /c start /wait "D:\Downloads\Win64OpenSSL.exe" /silent /verysilent /sp- /suppressmsgboxes /DIR=D:\OpenSSL-Win64-v102 |
| 31 | +## Install stack |
| 32 | +#Start-FileDownload http://www.stackage.org/stack/windows-x86_64 -FileName D:\Downloads\stack.zip |
| 33 | +#curl.exe http://www.stackage.org/stack/windows-x86_64 -o d:\Downloads\stack.zip -L |
| 34 | +#7z -oD:\stack x D:\Downloads\stack.zip |
| 35 | + |
| 36 | +$env:PATH="$env:PATH;D:\ghc\ghc-8.2.2\bin;D:\stack;$Env:Programfiles\7-Zip;D:\w" |
| 37 | + |
| 38 | +# Install liblzma/xz |
| 39 | +#curl -L https://tukaani.org/xz/xz-5.2.3-windows.zip -o xz-5.2.3-windows.zip |
| 40 | +#7z -oD:\xz_extracted x xz-5.2.3-windows.zip |
| 41 | + |
| 42 | +rd -r -fo $env:WORK_DIR |
| 43 | +mkdir $env:WORK_DIR |
| 44 | +copy-item $env:CHECKOUT_PATH\* $env:WORK_DIR -force -recurse |
| 45 | +cd $env:WORK_DIR |
| 46 | + |
| 47 | +git.exe clone https://github.com/facebook/rocksdb.git --branch v4.13.5 |
| 48 | +# curl.exe -L 'https://s3.eu-central-1.amazonaws.com/ci-static/serokell-rocksdb-haskell-325427fc709183c8fdf777ad5ea09f8d92bf8585.zip' -o D:\Downloads\rocksdb.zip |
| 49 | +7z x D:\Downloads\rocksdb.zip |
| 50 | + |
| 51 | +# CSL-1509: After moving the 'cardano-sl' project itself into a separate folder ('lib/'), the 'cardano-text.exe' executable fails on AppVeyor CI. |
| 52 | +# After some investigation, it was discovered that this was because 'rocksdb.dll' has to be located in this folder as well, or else the test executable doesn't work. |
| 53 | +copy rocksdb.dll node |
| 54 | +copy rocksdb.dll lib |
| 55 | +copy rocksdb.dll wallet-new |
| 56 | + |
| 57 | +# Start doing stuff |
| 58 | + |
| 59 | +stack.exe config --system-ghc set system-ghc --global true |
| 60 | +# stack.exe config --system-ghc set programs c:\s\programs --global true |
| 61 | +stack.exe path |
| 62 | +stack.exe exec -- ghc-pkg recache |
| 63 | +stack.exe --verbosity warn setup --no-reinstall |
| 64 | +# Install happy separately: https://github.com/commercialhaskell/stack/issues/3151#issuecomment-310642487. Also install cpphs because it's a build-tool and Stack can't figure out by itself that it should be installed |
| 65 | +stack.exe --verbosity warn install happy cpphs -j 2 --no-terminal --local-bin-path $env:SYSTEMROOT\system32 --extra-include-dirs="D:\OpenSSL-Win64-v102\include" --extra-lib-dirs="D:\OpenSSL-Win64-v102" --extra-include-dirs="D:\xz_extracted\include" --extra-lib-dirs="D:\xz_extracted\bin_x86-64" --extra-include-dirs="$env:WORK_DIR\rocksdb\include" --extra-lib-dirs="$env:WORK_DIR" |
| 66 | +# TODO: CSL-1133. To be reenabled. |
| 67 | +# stack.exe test --coverage |
| 68 | +# stack.exe hpc report cardano-sl cardano-sl-txp cardano-sl-core cardano-sl-db cardano-sl-update cardano-sl-infra cardano-sl-lrc cardano-sl-ssc |
| 69 | + |
| 70 | +#We intentionally don't build auxx here, because this build is for installer. |
| 71 | +stack.exe --dump-logs install cardano-sl cardano-sl-tools cardano-sl-wallet-new -j 3 --no-terminal --local-bin-path $env:WORK_DIR --no-haddock-deps --flag cardano-sl-core:-asserts --flag cardano-sl-tools:for-installer --extra-include-dirs="D:\OpenSSL-Win64-v102\include" --extra-lib-dirs="D:\OpenSSL-Win64-v102" --extra-include-dirs="D:\xz_extracted\include" --extra-lib-dirs="D:\xz_extracted\bin_x86-64" --extra-include-dirs="$env:WORK_DIR\rocksdb\include" --extra-lib-dirs="$env:WORK_DIR" |
| 72 | + |
| 73 | +# from here onwards, errors terminate the script |
| 74 | +$ErrorActionPreference = "Stop" |
| 75 | + |
| 76 | +#Cardano pieces, modulo the frontend |
| 77 | +mkdir daedalus |
| 78 | +## log config is called `log-config-prod.yaml` just in case, it's the old name |
| 79 | +copy log-configs\daedalus.yaml daedalus\log-config-prod.yaml |
| 80 | +copy lib\configuration.yaml daedalus\ |
| 81 | +copy lib\*genesis*.json daedalus\ |
| 82 | +copy cardano-launcher.exe daedalus\ |
| 83 | +copy cardano-node.exe daedalus\ |
| 84 | +copy cardano-x509-certificates.exe daedalus\ |
| 85 | +cd daedalus |
| 86 | +$env:BUILDKITE_BUILD_NUMBER | Out-File build-id |
| 87 | +$env:BUILDKITE_COMMIT | Out-File commit-id |
| 88 | +cd .. |
| 89 | + |
| 90 | +$daedaluszip = "$env:BUILDKITE_COMMIT.zip" |
| 91 | +7z.exe a $daedaluszip .\daedalus\* |
| 92 | +buildkite-agent artifact upload $daedaluszip |
0 commit comments