Skip to content

Commit a2547be

Browse files
committed
Add build-mac job
1 parent 4b392f4 commit a2547be

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
complete:
1616
if: always()
17-
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build]
17+
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build-linux, build-mac]
1818
runs-on:
1919
- namespace-profile-jammy-1-stellar-core
2020
- nscloud-cache-exp-do-not-commit
@@ -69,7 +69,7 @@ jobs:
6969
submodules: recursive
7070
- uses: stellar/actions/rust-check-git-rev-deps@main
7171

72-
build:
72+
build-linux:
7373
runs-on:
7474
- namespace-profile-jammy-32-stellar-core;overrides.cache-tag=config-${{ matrix.toolchain }}-${{ matrix.protocol }}
7575
strategy:
@@ -120,3 +120,51 @@ jobs:
120120
fi
121121
echo Build with $CC and $CXX
122122
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }}
123+
124+
build-mac:
125+
runs-on:
126+
- namespace-profile-macos-sequoia;overrides.cache-tag=config-macos-sequoia
127+
steps:
128+
129+
- name: Checkout with Namespace Git mirrors cache
130+
uses: namespacelabs/nscloud-checkout-action@v7
131+
with:
132+
fetch-depth: 1
133+
submodules: recursive
134+
135+
- name: Configure Namespace cache volume
136+
uses: namespacelabs/nscloud-cache-action@v1
137+
with:
138+
path: |
139+
~/.cargo
140+
build-clang-current
141+
142+
- name: install prerequisites and uninstall brew rust, add rustup
143+
run: |
144+
brew install libsodium libtool autoconf automake pkg-config libpq openssl parallel ccache bison gnu-sed perl coreutils
145+
brew uninstall rust rustup
146+
brew install rustup
147+
148+
- name: install rustup components
149+
run: |
150+
rustup-init -y
151+
rustup component add rustfmt rustc cargo clippy rust-src rust-std
152+
153+
- name: install cargo-cache
154+
run: |
155+
cargo install --locked cargo-cache --version 0.8.3
156+
157+
- name: install cargo-sweep
158+
run: |
159+
cargo install --locked cargo-sweep --version 0.7.0
160+
161+
- name: Build
162+
run: |
163+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/libpq/lib/pkgconfig"
164+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/openssl@3/lib/pkgconfig"
165+
export PATH="$(brew --prefix bison)/bin:$PATH"
166+
export CC='clang'
167+
export CXX='clang++'
168+
export CLANG_VERSION=none
169+
export SKIP_FORMAT_CHECK=1
170+
./ci-build.sh --disable-postgres --protocol current

src/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ CARGOFLAGS_BUILDSTD := $(if $(findstring sanitizer,$(RUSTFLAGS_SANI)),-Zbuild-st
276276
RUSTFLAGS_CFGS := $(if $(findstring sanitizer,$(RUSTFLAGS_SANI)),--cfg curve25519_dalek_backend=\"serial\",)
277277

278278
$(LIBRUST_STELLAR_CORE): $(RUST_HOST_DEPFILES) $(SRC_RUST_FILES) Makefile $(RUST_TOOLCHAIN_FILE)
279+
cd $(abspath $(top_srcdir))/src/rust && \
279280
CC="$(CC)" CXX="$(CXX)" LD="$(LD)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXXSTDLIB="$(CXXSTDLIB)" LDFLAGS="$(LDFLAGS)" \
280281
RUSTFLAGS="$(RUSTFLAGS_SANI) $(RUSTFLAGS_CFGS)" \
281282
CARGO_NET_GIT_FETCH_WITH_CLI=true \
@@ -382,6 +383,7 @@ $(SOROBAN_LIBS_STAMP): $(wildcard rust/soroban/p*/Cargo.lock) Makefile $(RUST_DE
382383
LIBRUST_STELLAR_CORE=$(RUST_TARGET_DIR)/$(RUST_PROFILE_DIR)/librust_stellar_core.a
383384

384385
$(LIBRUST_STELLAR_CORE): $(RUST_HOST_DEPFILES) $(SRC_RUST_FILES) Makefile $(SOROBAN_LIBS_STAMP) $(RUST_TOOLCHAIN_FILE)
386+
cd $(abspath $(top_srcdir))/src/rust && \
385387
CC="$(CC)" CXX="$(CXX)" LD="$(LD)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXXSTDLIB="$(CXXSTDLIB)" LDFLAGS="$(LDFLAGS)" \
386388
CARGO_NET_GIT_FETCH_WITH_CLI=true \
387389
$(CARGO) rustc \

0 commit comments

Comments
 (0)