resolves #170 build v8go for musl libc
What I Did
- create a new workflow to build GN on Alpine (build dependency of v8)
- it will automatically create a pull request
- if you don't trust the compiled file available at
deps/alpine_x84_64/gn, you can run the workflow again to replace this file
- add a new workflow to build v8 on Alpine
- get v8 dependencies from the GitHub runner (ubuntu-20.04) because the script does not work on Alpine
- use Docker to build v8 on Alpine
- copy files from the Docker container and create a pull request
- introduce two Python scripts to split the build task since we cannot get v8 dependencies from Alpine
- get_v8deps.py : get v8 dependencies
- compile_v8.py : compile v8
- build.py uses functions from the
get_v8deps.pyandcompile_v8.pyscripts to get dependencies and compile v8 (in one go)
- add cgo directive for
deps/alpine_x86_64(disclaimer: I don't know what I'm doing 🐶)- as far as I understand, it would allow to pass an environment variable
CC=musl-gccto install v8go on Alpine?
- as far as I understand, it would allow to pass an environment variable
- create a module
deps/alpine_x84_64/vendor.go
resolves #170
Note : I'm currently building libv8.a for Alpine on my fork
I've added deps/alpine_x86_64/libv8.a. How can I test that everything is running fine on Alpine?
Yay! tests are running fine on Alpine 🎉 I'm using a Docker container to run the test + coverage on Go 1.17.13 alpine3.16 and 1.19.3 alpine3.16.
You can see the result on my fork: https://github.com/Mogztter/v8go/pull/1
Will this fix 32 bit arm too? Or is there perhaps a way to put the build workflow in the process, so don't need to pre-vendor?
Not really but you can use the same approach to compile V8 on arm32 using Docker.
Yay! tests are running fine on Alpine 🎉 I'm using a Docker container to run the test + coverage on Go 1.17.13 alpine3.16 and 1.19.3 alpine3.16.
You can see the result on my fork: https://github.com/Mogztter/v8go/pull/1
@ggrossetie Hi there! The link for the result is not working. Could you please share the working example?
@ggrossetie Hi there! The link for the result is not working. Could you please share the working example?
I was trying to build a native binary for D2 but they are now using another library so I've deleted my fork 😞