thatisuday / go-cross-build

GitHub Action to build Go (Golang) modules.
https://itnext.io/how-to-set-up-github-workflows-and-create-github-actions-using-docker-3a5ba7ec0988
37 stars 29 forks source link

Cross build failing #13

Open lordofscripts opened 3 months ago

lordofscripts commented 3 months ago

Running go-cross-build@v1 on GitHub fails. My package builds properly__ yet running this action fails with this during the action's Generate Build Files phase:

An error occurred during build: exit status 1

A separate question... In Step 2 of the crossbuild.yml file there is a with: dest: setting. Must that directory exist in my repository, or is it created automatically?

lordofscripts commented 3 months ago

@thatisuday or @tobyxdd Here is the action part "Generate build files" that is failing. It doesn't give any useful information regarding the fault:

Run thatisuday/go-cross-build@v1
  with:
    platforms: linux/arm, linux/386, windows/386, darwin/amd64
    package: wipechromium
    name: wipechromium
    compress: true
    dest: distrib
/usr/bin/docker run --name efb4eff8efd9a87c4[2](https://github.com/lordofscripts/wipechromium/actions/runs/10586613982/job/29335747699#step:4:2)4008b68649a9[3](https://github.com/lordofscripts/wipechromium/actions/runs/10586613982/job/29335747699#step:4:3)6861213_567a89 --label efb4ef --workdir /github/workspace --rm -e "INPUT_PLATFORMS" -e "INPUT_PACKAGE" -e "INPUT_NAME" -e "INPUT_COMPRESS" -e "INPUT_DEST" -e "GO111MODULE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/wipechromium/wipechromium":"/github/workspace" efb[4](https://github.com/lordofscripts/wipechromium/actions/runs/10586613982/job/29335747699#step:4:4)ef:f8efd9a87c424008b68649a936861213
Creating a build using : /usr/local/go/bin/go build -buildmode exe -o /github/workspace/distrib/wipechromium ./wipechromium
An error occurred during build: exit status 1
exit status 1

Failed job

chenasraf commented 3 months ago

If you remove linux/arm does it work? For me arm builds don't work on GH Actions but amd ones do

lordofscripts commented 3 months ago

If you remove linux/arm does it work? For me arm builds don't work on GH Actions but amd ones do

I have Linux/arm working just fine with the other cross-build workflow I tweaked.

chenasraf commented 3 months ago

I added logging to my fork of this repo and found out my issue, for me I was getting a git error from go build:

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

    git config --global --add safe.directory /github/workspace
error obtaining VCS status: exit status 128
    Use -buildvcs=false to disable VCS stamping.

Fixing it worked for me, either do it on the workflow file before the cross build command, or use my fork chenasraf/go-cross-build which does this + add more logging to build output

Since there was no logging before I'm not sure it's the same issue, but maybe logging will help you track down the problem if not