herumi / bls-go-binary

22 stars 22 forks source link

feat(devops): added release.yml #18

Closed cnlangzi closed 1 year ago

cnlangzi commented 1 year ago

Changes

How it works

Examples

Notes

herumi commented 1 year ago

Thank you for the pull request. But your commitments are too many. Can you please submit another pull request after you have finished fixing and merging them into one?

cnlangzi commented 1 year ago

Thank you for the pull request. But your commitments are too many. Can you please submit another pull request after you have finished fixing and merging them into one?

I will rebase it, I am testing on more build jobs

all libs will be built, committed, push and released automatically.

@herumi could you let me know how to build it on windows? I can't find docs on README.md

herumi commented 1 year ago

I installed msys2/mingw64 and clang++ and some tools to build and

cd bls-go-binary
make CXX=clang++ -j
cnlangzi commented 1 year ago

msys2/mingw64 and clang++

@herumi which versions it works on?

herumi commented 1 year ago

I downloaded msys2 from https://www.msys2.org/ . I think it will work with any version.

$ cat /proc/version
MINGW64_NT-10.0-22621 version 3.4.5.x86_64 (runneradmin@fv-az411-742) (gcc version 11.3.0 (GCC) ) 2023-01-20 09:17 UTC

$ clang++ -v
clang version 15.0.5
cnlangzi commented 1 year ago

make CXX=clang++ -j

getting some errors on windows. @herumi do you know what things are missed? is it related to posix?

gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

clang version 15.0.7
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
mingw32-make[2]: *** [makefile:148: obj/bint64.o] Error 2
mingw32-make[1]: *** [src//bls/Makefile.onelib:82: src//bls/mcl/obj/bint64.o] Error 2
mingw32-make[1]: *** Waiting for unfinished jobs....
clang++clang++clang++: : : error: unsupported option '-fpic' for target 'x86_64-pc-windows-msvc'
error: unsupported option '-fpic' for target 'x86_64-pc-windows-msvc'
error: unsupported option '-fpic' for target 'x86_64-pc-windows-msvc'
mingw32-make[2]: *** [makefile:109: obj/base64.o] Error 1
mingw32-make[2]: Leaving directory 'D:/a/bls-go-binary/bls-go-binary/src/bls/mcl'
mingw32-make[1]: *** [src//bls/Makefile.onelib:77: obj/fp.o] Error 1
mingw32-make[1]: *** [src//bls/Makefile.onelib:85: src//bls/mcl/obj/base64.o] Error 2
mingw32-make[1]: *** [src//bls/Makefile.onelib:79: obj/bls_c384_256.o] Error 1
mingw32-make[1]: Leaving directory 'D:/a/bls-go-binary/bls-go-binary'
mingw32-make: *** [makefile:6: all] Error 2

https://github.com/cnlangzi/bls-go-binary/actions/runs/4530981490/jobs/7980578020

Screenshot 2023-03-27 at 17 50 22
cnlangzi commented 1 year ago

@herumi I will try to integrate build-windows in a new PR. if it is fine, let's merge this PR for linux, macos, android, ios and ios simulator.

cnlangzi commented 1 year ago

latest demo:

herumi commented 1 year ago

Thank you for the nice contribution. I'm busy now, so please wait a moment to check it.

getting some errors on windows. @herumi do you know what things are missed? is it related to posix?

The version of GCC is different from mine.

 gcc --version
gcc.exe (Rev6, Built by MSYS2 project) 12.2.0
 /c/prog/bls-go-binary
$ make -j CXX=clang++
make -f src//bls/Makefile.onelib BLS_DIR=src//bls MCL_DIR=src//bls/mcl OUT_DIR=/c/prog/bls-go-binary ETH_CFLAGS= all
make[1]: Entering directory '/c/prog/bls-go-binary'
clang++ -c src//bls/src/bls_c384_256.cpp -o obj/bls_c384_256.o -O3 -fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-stack-protector -DNDEBUG -DMCL_DONT_USE_OPENSSL -DMCL_SIZEOF_UNIT=8 -DMCL_MAX_BIT_SIZE=384 -DCYBOZU_DONT_USE_EXCEPTION -DCYBOZU_DONT_USE_STRING -D_FORTIFY_SOURCE=0 -Isrc//bls/include -Isrc//bls/mcl/include   -std=c++03 -DMCL_USE_LLVM=1
clang++ -c src//bls/mcl/src/fp.cpp -o obj/fp.o -O3 -fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-stack-protector -DNDEBUG -DMCL_DONT_USE_OPENSSL -DMCL_SIZEOF_UNIT=8 -DMCL_MAX_BIT_SIZE=384 -DCYBOZU_DONT_USE_EXCEPTION -DCYBOZU_DONT_USE_STRING -D_FORTIFY_SOURCE=0 -Isrc//bls/include -Isrc//bls/mcl/include   -std=c++03 -DMCL_USE_LLVM=1
make -C src//bls/mcl obj/bint64.o CPU=x86-64 OS=mingw64 BIT=64
make -C src//bls/mcl obj/base64.o CPU=x86-64 OS=mingw64 BIT=64
make[2]: Entering directory '/c/prog/bls-go-binary/src/bls/mcl'
make[2]: Entering directory '/c/prog/bls-go-binary/src/bls/mcl'
cc -D__USE_MINGW_ANSI_STDIO=1 -g3 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef -m64 -I include -I test -fomit-frame-pointer -DNDEBUG -fno-stack-protector -O3  -fpic -DMCL_BINT_ASM=1 -c src/asm/bint-x64.S -o obj/bint64.o
clang++ -c src/base64.ll -o obj/base64.o -D__USE_MINGW_ANSI_STDIO=1 -g3 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef -m64 -I include -I test -fomit-frame-pointer -DNDEBUG -fno-stack-protector -O3  -fpic -DMCL_BINT_ASM=1
clang++: warning: argument unused during compilation: '-I include' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-I test' [-Wunused-command-line-argument]
warning: overriding the module target triple with x86_64-w64-windows-gnu [-Woverride-module]
make[2]: Leaving directory '/c/prog/bls-go-binary/src/bls/mcl'
1 warning generated.
make[2]: Leaving directory '/c/prog/bls-go-binary/src/bls/mcl'
mkdir -p /c/prog/bls-go-binary/bls/lib/windows/amd64
ar -rv /c/prog/bls-go-binary/bls/lib/windows/amd64/libbls384_256.a obj/bls_c384_256.o obj/fp.o src//bls/mcl/obj/bint64.o src//bls/mcl/obj/base64.o
r - obj/bls_c384_256.o
r - obj/fp.o
r - src//bls/mcl/obj/bint64.o
r - src//bls/mcl/obj/base64.o
make[1]: Leaving directory '/c/prog/bls-go-binary'
herumi commented 1 year ago

Thank you for the PR. I'm adding Windows binary at the dev branch of https://github.com/herumi/test-bls-go-binary . https://github.com/herumi/test-bls-go-binary/blob/dev/.github/workflows/win.yml But it causes an error at the last step of making the library. I don't know why ar command fails.

Run gcc --version
gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Python 3.9.13
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make.exe -C src//bls/mcl clean
mingw32-make[1]: Entering directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
rm -rf lib/*.a lib/*.so obj/*.o obj/*.obj obj/*.d bin/*.exe src/gen obj/base64.o obj/fp.o obj/bint64.o obj/bn_c256.o obj/bn_c384.o obj/bn_c512.o lib/*.a src/static_code.asm src/dump_code
rm -rf src/gen_bint.exe
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make.exe clean_standalone
mingw32-make[2]: Entering directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
rm -rf libmcl.a libmcl384_256.a *.o
mingw32-make[2]: Leaving directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
mingw32-make[1]: Leaving directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make.exe -C src//bls clean
mingw32-make[1]: Entering directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls'
rm -rf obj/*.d obj/*.o bin/*.exe     lib/libbls256.a lib/libbls256.so lib/libbls384.a lib/libbls384.so lib/libbls384_256.a lib/libbls384_256.so lib/libbls512.a lib/libbls512.so
mingw32-make[1]: Leaving directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls'
rm -f -rf obj/*.o android/obj/* bls/lib/android/*
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make.exe -f src//bls/Makefile.onelib BLS_DIR=src//bls MCL_DIR=src//bls/mcl OUT_DIR=/d/a/test-bls-go-binary/test-bls-go-binary ETH_CFLAGS= all
mingw32-make[1]: Entering directory 'D:/a/test-bls-go-binary/test-bls-go-binary'
g++ -c src//bls/src/bls_c384_256.cpp -o obj/bls_c384_256.o -O3 -fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-stack-protector -DNDEBUG -DMCL_DONT_USE_OPENSSL -DMCL_SIZEOF_UNIT=8 -DMCL_MAX_BIT_SIZE=384 -DCYBOZU_DONT_USE_EXCEPTION -DCYBOZU_DONT_USE_STRING -D_FORTIFY_SOURCE=0 -Isrc//bls/include -Isrc//bls/mcl/include   -std=c++03
g++ -c src//bls/mcl/src/fp.cpp -o obj/fp.o -O3 -fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-stack-protector -DNDEBUG -DMCL_DONT_USE_OPENSSL -DMCL_SIZEOF_UNIT=8 -DMCL_MAX_BIT_SIZE=384 -DCYBOZU_DONT_USE_EXCEPTION -DCYBOZU_DONT_USE_STRING -D_FORTIFY_SOURCE=0 -Isrc//bls/include -Isrc//bls/mcl/include   -std=c++03
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make.exe -C src//bls/mcl obj/bint64.o CPU=x86-64 OS=mingw64 BIT=64
mingw32-make[2]: Entering directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
python3 src/gen_bint_x64.py -m gas -win > src/asm/bint-x64.S
g++ -D__USE_MINGW_ANSI_STDIO=1 -g3 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef -m64 -I include -I test -fomit-frame-pointer -DNDEBUG -fno-stack-protector -O3  -fpic -DMCL_BINT_ASM=1 -c src/asm/bint-x64.S -o obj/bint64.o
mingw32-make[2]: Leaving directory 'D:/a/test-bls-go-binary/test-bls-go-binary/src/bls/mcl'
mkdir -p /d/a/test-bls-go-binary/test-bls-go-binary/bls/lib/windows/amd64
ar rv /d/a/test-bls-go-binary/test-bls-go-binary/bls/lib/windows/amd64/libbls384_256.a obj/bls_c384_256.o obj/fp.o src//bls/mcl/obj/bint64.o
C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\bin\ar.exe: /d/a/test-bls-go-binary/test-bls-go-binary/bls/lib/windows/amd64/libbls384_256.a: No such file or directory
mingw32-make[1]: *** [src//bls/Makefile.onelib:82: /d/a/test-bls-go-binary/test-bls-go-binary/bls/lib/windows/amd64/libbls384_256.a] Error 1
mingw32-make[1]: Leaving directory 'D:/a/test-bls-go-binary/test-bls-go-binary'
mingw32-make: *** [makefile:6: all] Error 2
On branch release-v1.29.0
Your branch is up to date with 'origin/release-v1.29.0'.
herumi commented 1 year ago

Hi @cnlangzi , thanks to you, I could release a release.yml, which can build a Windows binary. actions. But v.1.30.0 contains previously committed binaries. What is wrong?

cnlangzi commented 1 year ago

@herumi we should deleted all old committed binaries from master first.

herumi commented 1 year ago

Thank you for the advice. I could release it. https://github.com/herumi/bls-go-binary/releases/tag/v1.30.3 .

herumi commented 1 year ago

I've merged your patch into the master branch, so I'll close this PR.

herumi commented 1 year ago

Hi @cnlangzi , could you help me again? https://github.com/herumi/bls-go-binary/blob/master/.github/workflows/release.yml generates all binaries, but I found that https://github.com/herumi/bls-go-binary/releases/tag/v1.30.3 did not contain those binaries. What should I fix?

cnlangzi commented 1 year ago

Hi @cnlangzi , could you help me again? https://github.com/herumi/bls-go-binary/blob/master/.github/workflows/release.yml generates all binaries, but I found that https://github.com/herumi/bls-go-binary/releases/tag/v1.30.3 did not contain those binaries. What should I fix?

I will.

herumi commented 1 year ago

I could resolve the problem using gh release create.