Various tweaks to get m1 self hosted build working

- Set CPATH and LIBRARY_PATH for lotus m1 build
- support dry-run on new release job
This commit is contained in:
Ian Davis 2022-10-27 11:15:29 +01:00
parent 568cd38b0f
commit 7afa5c9255
2 changed files with 56 additions and 12 deletions

View File

@ -67,7 +67,7 @@ commands:
- run: go version - run: go version
- run: - run:
name: Install dependencies with Homebrew name: Install dependencies with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils hwloc jq command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc
- run: - run:
name: Install Rust name: Install Rust
command: | command: |
@ -372,7 +372,10 @@ jobs:
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
- run: make lotus lotus-miner lotus-worker - run: |
export CPATH=$(brew --prefix)/include
export LIBRARY_PATH=$(brew --prefix)/lib
make lotus lotus-miner lotus-worker
- run: | - run: |
mkdir -p /tmp/workspace/darwin_arm64 && \ mkdir -p /tmp/workspace/darwin_arm64 && \
mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_arm64/ mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_arm64/
@ -389,15 +392,33 @@ jobs:
- run: - run:
command: make clean command: make clean
when: always when: always
- run:
name: cleanup homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc
when: always
release: release:
executor: golang executor: golang
parameters:
dry-run:
default: false
description: should this release actually publish it's artifacts?
type: boolean
steps: steps:
- attach_workspace: - attach_workspace:
at: /tmp/workspace at: /tmp/workspace
- run: goreleaser release --rm-dist --snapshot - when:
- run: ./scripts/generate-checksums.sh condition: << parameters.dry-run >>
- run: ./scripts/publish-checksums.sh steps:
- run: goreleaser release --rm-dist --snapshot
- run: ./scripts/generate-checksums.sh
- when:
condition:
not: << parameters.dry-run >>
steps:
- run: goreleaser release --rm-dist
- run: ./scripts/generate-checksums.sh
- run: ./scripts/publish-checksums.sh
build-appimage: build-appimage:
machine: machine:
@ -1122,7 +1143,8 @@ workflows:
only: only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ - /^v\d+\.\d+\.\d+(-rc\d+)?$/
- release: - release:
name: "Release" name: "Release (dry-run)"
dry-run: true
requires: requires:
- "Build ( darwin / amd64 )" - "Build ( darwin / amd64 )"
- "Build ( linux / amd64 )" - "Build ( linux / amd64 )"

View File

@ -67,7 +67,7 @@ commands:
- run: go version - run: go version
- run: - run:
name: Install dependencies with Homebrew name: Install dependencies with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils hwloc jq command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc
- run: - run:
name: Install Rust name: Install Rust
command: | command: |
@ -372,7 +372,10 @@ jobs:
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
- run: make lotus lotus-miner lotus-worker - run: |
export CPATH=$(brew --prefix)/include
export LIBRARY_PATH=$(brew --prefix)/lib
make lotus lotus-miner lotus-worker
- run: | - run: |
mkdir -p /tmp/workspace/darwin_arm64 && \ mkdir -p /tmp/workspace/darwin_arm64 && \
mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_arm64/ mv lotus lotus-miner lotus-worker /tmp/workspace/darwin_arm64/
@ -389,15 +392,33 @@ jobs:
- run: - run:
command: make clean command: make clean
when: always when: always
- run:
name: cleanup homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc
when: always
release: release:
executor: golang executor: golang
parameters:
dry-run:
default: false
description: should this release actually publish it's artifacts?
type: boolean
steps: steps:
- attach_workspace: - attach_workspace:
at: /tmp/workspace at: /tmp/workspace
- run: goreleaser release --rm-dist --snapshot - when:
- run: ./scripts/generate-checksums.sh condition: << parameters.dry-run >>
- run: ./scripts/publish-checksums.sh steps:
- run: goreleaser release --rm-dist --snapshot
- run: ./scripts/generate-checksums.sh
- when:
condition:
not: << parameters.dry-run >>
steps:
- run: goreleaser release --rm-dist
- run: ./scripts/generate-checksums.sh
- run: ./scripts/publish-checksums.sh
build-appimage: build-appimage:
machine: machine:
@ -847,7 +868,8 @@ workflows:
only: only:
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ - /^v\d+\.\d+\.\d+(-rc\d+)?$/
- release: - release:
name: "Release" name: "Release (dry-run)"
dry-run: true
requires: requires:
- "Build ( darwin / amd64 )" - "Build ( darwin / amd64 )"
- "Build ( linux / amd64 )" - "Build ( linux / amd64 )"