Skip to content

Commit d4e0969

Browse files
committed
Add build-mac job
1 parent 5d42724 commit d4e0969

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

.github/workflows/build.yml

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

1919
complete:
2020
if: always()
21-
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build]
21+
needs: [fmt, cargo-deny, rust-check-git-rev-deps, build-linux, build-mac]
2222
runs-on:
2323
- namespace-profile-jammy-1-stellar-core
2424
- nscloud-cache-exp-do-not-commit
@@ -73,7 +73,7 @@ jobs:
7373
submodules: recursive
7474
- uses: stellar/actions/rust-check-git-rev-deps@main
7575

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