Skip to content

Commit

Permalink
Problem: windows build in CI fails (#868)
Browse files Browse the repository at this point in the history
* Problem: windows build in CI fails

Solution:
- patch grocksdb to remove binding of not exported apis
- add workflow to test windows build in PR

* use crypto-org-chain fork
  • Loading branch information
yihuang authored Feb 14, 2023
1 parent 15cb808 commit 43e96a4
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 3,190 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
set +e
(git diff --no-ext-diff --exit-code)
echo "name=changed::$?" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: steps.changes.outputs.changed == 1
with:
name: gomod2nix.toml
Expand Down Expand Up @@ -158,11 +158,29 @@ jobs:
set +e
(git diff --no-ext-diff --exit-code)
echo "name=changed::$?" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: steps.changes.outputs.changed == 1
with:
name: contracts_out
path: ./contracts/out
if-no-files-found: ignore
- if: steps.changes.outputs.changed == 1
run: echo "Working directory is dirty" && exit 1

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: git msys2-devel base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-go mingw-w64-x86_64-jq mingw-w64-x86_64-dlfcn
- name: get rocksdb & build
env:
PLATFORM: Windows_x86_64
shell: msys2 {0}
run: |
./scripts/build-windows.sh
./build/cronosd.exe version --long
28 changes: 4 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,36 +144,16 @@ jobs:
- name: setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: MINGW64
update: false
install: git msys2-devel base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-rocksdb mingw-w64-x86_64-go mingw-w64-x86_64-jq mingw-w64-x86_64-dlfcn
install: git msys2-devel base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-go mingw-w64-x86_64-jq mingw-w64-x86_64-dlfcn
- name: get rocksdb & build
env:
PLATFORM: Windows_x86_64
shell: msys2 {0}
run: |
uname -a
export GOROOT=/mingw64/lib/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
export CGO_CFLAGS="-I/mingw64/include/rocksdb"
export CGO_LDFLAGS="-L/mingw64/lib -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd"
echo $PATH
go version
wget https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-rocksdb-7.9.2-1-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-rocksdb-7.9.2-1-any.pkg.tar.zst --noconfirm
COSMOS_BUILD_OPTIONS=rocksdb make build
ls -la ./build/
mv ./build/cronosd ./build/cronosd.exe
cp /mingw64/bin/libbz2-1.dll ./build
cp /mingw64/bin/libgcc_s_seh-1.dll ./build
cp /mingw64/bin/liblz4.dll ./build
cp /mingw64/bin/librocksdb.dll ./build
cp /mingw64/bin/libsnappy.dll ./build
cp /mingw64/bin/libstdc++-6.dll ./build
cp /mingw64/bin/libwinpthread-1.dll ./build
cp /mingw64/bin/libzstd.dll ./build
cp /mingw64/bin/zlib1.dll ./build
./scripts/build-windows.sh
./build/cronosd.exe version --long
cd ./build
tar cvfz ../cronos.tar.gz *
cd ..
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
echo ${{ job.status }} > status_build.txt
- name: Upload file status_build.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_build
path: status_build.txt
Expand All @@ -144,7 +144,7 @@ jobs:
echo ${{ job.status }} > status_install.txt
- name: Upload file status_install.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_install
path: status_install.txt
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
echo ${{ job.status }} > status_sim1.txt
- name: Upload file status_sim1.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_sim1
path: status_sim1.txt
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
echo ${{ job.status }} > status_sim2.txt
- name: Upload file status_sim2.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_sim2
path: status_sim2.txt
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
echo ${{ job.status }} > status_sim3.txt
- name: Upload file status_sim3.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_sim3
path: status_sim3.txt
Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
echo ${{ job.status }} > status_sim4.txt
- name: Upload file status_sim4.txt as an artifact
if: github.event_name == 'issue_comment'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: pass_status_sim4
path: status_sim4.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: 'Tar debug files'
if: failure()
run: tar cfz debug_files.tar.gz -C "${TMPDIR-/tmp}/pytest-of-runner" .
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: debug-files
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/crypto-org-chain/cronos
go 1.18

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.0-beta.4
github.com/armon/go-metrics v0.4.1
github.com/cosmos/cosmos-sdk v0.46.9
Expand Down Expand Up @@ -36,7 +37,6 @@ require (
cloud.google.com/go/compute/metadata v0.2.1 // indirect
cloud.google.com/go/iam v0.7.0 // indirect
cloud.google.com/go/storage v1.27.0 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand Down Expand Up @@ -205,7 +205,7 @@ replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// use replace to force update grocksdb dependency in tm-db
github.com/linxGnu/grocksdb => github.com/linxGnu/grocksdb v1.7.14
github.com/linxGnu/grocksdb => github.com/crypto-org-chain/grocksdb v1.7.11-0.20230214093311-ba44112a39c1
github.com/miguelmota/go-ethereum-hdwallet => github.com/crypto-org-chain/go-ethereum-hdwallet v0.1.2

// TODO: remove when gravity update dependencies
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ github.com/crypto-org-chain/go-ethereum v1.10.19-deepcopy-jumptable/go.mod h1:IJ
github.com/crypto-org-chain/go-ethereum-hdwallet v0.1.2 h1:Qu2GMavGHCcomdVWmZej76JpOO6uvII6IpPDdJUG+Qo=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20220815102151-48275db7e1ee h1:qzkim8QAf6AdRKlAPgLU5nI7S9JoefLDI76PmJeOTgk=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20220815102151-48275db7e1ee/go.mod h1:w/nb6f8UbrqqevKYQm/r+qjRl4WgxRlTC+l9dQ1wDfg=
github.com/crypto-org-chain/grocksdb v1.7.11-0.20230214093311-ba44112a39c1 h1:VClcM7YN+5SA46WPDWQVAycbegrTgVPv/wD895OXiAk=
github.com/crypto-org-chain/grocksdb v1.7.11-0.20230214093311-ba44112a39c1/go.mod h1:pY55D0o+r8yUYLq70QmhdudxYvoDb9F+9puf4m3/W+U=
github.com/crypto-org-chain/tm-db v0.6.8-0.20230118040049-14dc6b00a5b3 h1:msHkCjNEUSqknqzjBCQscfxVm1ifyxoRBb0goZKqGCU=
github.com/crypto-org-chain/tm-db v0.6.8-0.20230118040049-14dc6b00a5b3/go.mod h1:JOMwkZce6XmnsAfSRa3VSA/e2tV1R2y7lqljiw5STlQ=
github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc=
Expand Down Expand Up @@ -1631,8 +1633,6 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
github.com/linxGnu/grocksdb v1.7.14 h1:8lMZzyWeNP5lI0BIppX05DzmQzXj/Tgu82bgWYtowLY=
github.com/linxGnu/grocksdb v1.7.14/go.mod h1:pY55D0o+r8yUYLq70QmhdudxYvoDb9F+9puf4m3/W+U=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4=
github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM=
Expand Down
Loading

0 comments on commit 43e96a4

Please sign in to comment.