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

fix: correct go build error passing #1067

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ on:
default: '/ipns/dist.ipfs.tech'

env:
DIST_ROOT: ${{ github.event.inputs.custom_dist_root || '/ipns/dist.ipfs.tech' }} # content root used for calculating diff to build
KUBO_VER: 'v0.24.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.7' # ipfs-cluster-ctl used for pinning
DIST_ROOT: '/ipfs/QmaSbz55W2q74SzMDYxLuwCwvfYwaHQrz5uHsyzonPUSUH' # TODO ${{ github.event.inputs.custom_dist_root || '/ipns/dist.ipfs.tech' }} # content root used for calculating diff to build
KUBO_VER: 'v0.26.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.8' # ipfs-cluster-ctl used for pinning

jobs:
build:
runs-on: ${{ fromJSON(vars.CI_BUILD_RUNS_ON || '"ubuntu-latest"') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- env:
Expand All @@ -46,8 +46,8 @@ jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- run: npm ci --no-audit --progress=false
Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: "macos-latest"
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Retrieve unsigned artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
environment: Deploy
steps:
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Retrieve signed artifacts
uses: actions/download-artifact@v3
continue-on-error: true # skip if no releases
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
prepare-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: awk 'NR == FNR {f1[$0] = 1; next}; !($0 in f1)' ignored-during-nightly <(ls ./dists -1) > nightlies-to-run
- id: set-matrix
run: echo "::set-output name=matrix::$(jq -nc '$ARGS.positional' --args $(cat nightlies-to-run))"
Expand All @@ -38,7 +38,7 @@ jobs:
matrix:
dist_name: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- env:
CLUSTER_USER: ${{ secrets.CLUSTER_USER }}
CLUSTER_PASSWORD: ${{ secrets.CLUSTER_PASSWORD }}
Expand Down
9 changes: 5 additions & 4 deletions build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ function goBuild() {

local output
output="$(pwd)/$(basename "$package")$(go env GOEXE)"
go build -mod=mod -o "$output" \
-trimpath \
"${package}"
if ! (go build -mod=mod -o "$output" -trimpath "${package}"); then
warn " go build of $output failed."
return 1
fi
Comment on lines +109 to +112
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ error handling here was missing


if [ -x "$(which glibc-check)" ] && [ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ]; then
echo "GLIBC versions:"
Expand Down Expand Up @@ -144,7 +145,7 @@ function doBuild() {

mkdir -p "$dir"

if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > build-log; then
if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > "$build_dir_name/build-log" 2>&1; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ why error logs were not created correctly OR were missing stderr

local logfi="$dir/build-log-$goos-$goarch"
cp "$build_dir_name/build-log" "$logfi"
warn " $binname failed. logfile at '$logfi'"
Expand Down
Loading