Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions build fails when trying to use v8go #50

Closed
jimafisk opened this issue Jul 31, 2020 · 5 comments
Closed

GitHub Actions build fails when trying to use v8go #50

jimafisk opened this issue Jul 31, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@jimafisk
Copy link
Member

Failed build: https://github.com/plentico/plenti/runs/930279376#step:8:128

Error:

   ⨯ release failed after 87.44s error=failed to build for linux_amd64: # plenti/cmd/build
##[error]cmd/build/client.go:18:13: undefined: v8go.Context
##[error]cmd/build/client.go:39:12: undefined: v8go.NewContext
##[error]cmd/build/client.go:52:14: undefined: v8go.NewContext
##[error]cmd/build/client.go:92:25: undefined: v8go.Context

##[error]The process '/opt/hostedtoolcache/goreleaser-action/0.140.1/x64/goreleaser' failed with exit code 1
@jimafisk jimafisk added the bug Something isn't working label Jul 31, 2020
@jimafisk
Copy link
Member Author

rogchap/v8go#38

@jimafisk
Copy link
Member Author

jimafisk commented Aug 3, 2020

Looks like the issue is building binaries for windows or darwin (mac) with v8go:

See screenshot

windows_mac_builds

Tracking progress on rogchap/v8go#7

@jimafisk
Copy link
Member Author

jimafisk commented Aug 4, 2020

Cross compiling is an issue for all modules that rely on CGO (like v8go): rogchap/v8go#35 (comment)

There is a docker container we could use (see https://medium.com/@robdefeo/cross-compile-with-cgo-and-goreleaser-6af884731222 and goreleaser/goreleaser#708 (comment)).

It looks like a 2nd docker image was added to Goreleaser: goreleaser/goreleaser#795 (comment)

@jimafisk
Copy link
Member Author

I was able to get this working still using the Goreleaser GitHub Action. I needed to do the following things:

  1. Break goreleaser into multiple builds: Conditional build flags or per-build hooks. goreleaser/goreleaser#459
  2. Pass ldflags to fix errors like shown here: "failed to build for" error only in Github Action goreleaser/goreleaser-action#40 (comment)
  3. Create an osxcross target like this that we can pull into the project as a GitHub Action step (more details here):
     -
        name: OSXCross for CGO Support
        run: |
          mkdir ../plenti-osxcross
          git clone https://github.com/plentico/plenti-osxcross.git ../plenti-osxcross/target

@jimafisk
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant