Skip to content

Add support for macOS and allow building stacks-core from commit hash#39

Open
radu-stacks wants to merge 4 commits into
stacks-network:masterfrom
radu-stacks:feat/mac-os-support
Open

Add support for macOS and allow building stacks-core from commit hash#39
radu-stacks wants to merge 4 commits into
stacks-network:masterfrom
radu-stacks:feat/mac-os-support

Conversation

@radu-stacks
Copy link
Copy Markdown

Continuation of #29 which became stale.

@radu-stacks radu-stacks requested a review from wileyj May 12, 2026 10:28
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 12, 2026

CLA assistant check
All committers have signed the CLA.

@radu-stacks radu-stacks changed the title This PR adds support for macOS and allows building stacks-core from commit hash Add support for macOS and allows building stacks-core from commit hash May 12, 2026
ASuciuX and others added 3 commits May 12, 2026 13:34
@radu-stacks radu-stacks force-pushed the feat/mac-os-support branch from 207ea2f to b78fbfb Compare May 12, 2026 10:34
@radu-stacks
Copy link
Copy Markdown
Author

radu-stacks commented May 12, 2026

The @ASuciuX email address was mapping to @BowTiedDeployer which didn't sign the CLA. To allow this PR to be merged I rebased the commits, replacing the email address with the no-reply one and signed with my signature. Hope that's ok @wileyj.

@radu-stacks radu-stacks changed the title Add support for macOS and allows building stacks-core from commit hash Add support for macOS and allow building stacks-core from commit hash May 12, 2026
Comment thread docker/stacks/Dockerfile
RUN git clone --branch $STACKS_CORE_BASE_BRANCH --single-branch --depth=1 https://github.com/stacks-network/stacks-core.git /code/stacks-core
WORKDIR /code/stacks-core
RUN apt-get update && apt-get install -y git libclang-dev llvm
RUN apt-get update && apt-get install -y libclang-dev llvm
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this ordering is weird (and is present in the default branch, so i'll take ownership for this lol).

i think we should move the apt-get commands to the top of the file before starting the git clone/init. i also think we should keep the git package install. it may be present in the current base image rust:bookworm, but there is no promise that it will always be present there.

Comment thread docker/docker-compose.yml
- &REWARD_RECIPIENT_2 ${REWARD_RECIPIENT_2:-ST2FW15NGB4H76FMVXKHYYSM865YVS6V3SA1GNABC} # priv: fe3087801196d8027008146b13e6d365920c2e4b7bc9969729ec2f0f22ef74fc01
- &REWARD_RECIPIENT_3 ${REWARD_RECIPIENT_3:-ST2MES40ZEXTX9M4YXW9QSWHRVC9HYT419S198VPM} # priv: ed7eb063c61b8e892987228f1fcfb74eab5009568861613dc4b074b708a7893701
- &STACKS_CORE_BASE_BRANCH ${STACKS_CORE_BASE_BRANCH:-3.4.0.0.1}
- &STACKS_CORE_BASE_BRANCH ${STACKS_CORE_BASE_BRANCH:-3.4.0.0.1} # branch, tag, or commit SHA
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- &STACKS_CORE_BASE_BRANCH ${STACKS_CORE_BASE_BRANCH:-3.4.0.0.1} # branch, tag, or commit SHA
- &STACKS_CORE_BASE_BRANCH ${STACKS_CORE_BASE_BRANCH:-3.4.0.0.2} # branch, tag, or commit SHA

bump to latest version

Comment thread Makefile
# restores archive ownership and leaves bind-mount sources unwritable.
# Extract as the current user so everything lands user-owned.
TAR_EXTRACT := tar -xf
else
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be sufficient, but we should add a disclaimer in the README that this Makefile will only work on linux/macos. if someone were to run this on windows for example, this else section would fail.

i think it's ok, but better to document that only linux/macos are supported here.

Comment thread Makefile
Comment thread Makefile
Comment on lines +55 to +66
$(CHAINSTATE_DIR):
@if [ ! -d "$(CHAINSTATE_DIR)" ]; then \
mkdir -p $(CHAINSTATE_DIR); \
if [ "$(TARGET)" = "up" ]; then \
if [ -f "$(CHAINSTATE_ARCHIVE)" ]; then \
$(TAR_EXTRACT) $(CHAINSTATE_ARCHIVE) -C $(CHAINSTATE_DIR) || exit 1; \
else \
echo "Chainstate archive ($(CHAINSTATE_ARCHIVE)) not found. Exiting"; \
rm -rf $(CHAINSTATE_DIR); \
exit 1; \
fi; \
fi; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this section be changed to conform to the original syntax? requiring an escape on each line of the conditional is not ideal.

Comment thread Makefile
# Boot the network from a local chainstate archive
up: check-not-running | build $(CHAINSTATE_DIR)
@echo "Starting $(PROJECT) network from chainstate archive"
@echo " OS: $(OS)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, but i would use UNAME_S here since it's the data directly from the system vs a hardcoded value

Comment thread Makefile
docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) down
@if [ -f .current-chainstate-dir ]; then \
rm -f .current-chainstate-dir
rm -f .current-chainstate-dir; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comment as before- is there a compelling reason to keep the ; \ chars here? does macos make handle the existing syntax differently?

adding these is not wrong necessarily, but it does add maintenance overhead and errors won't be apparent (e.g. you make a change and forget to add the ; \ where needed in the proposed syntax change.

Comment thread Makefile
docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) down
@if [ -f .current-chainstate-dir ]; then \
rm -f .current-chainstate-dir
rm -f .current-chainstate-dir; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see line 145 comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to reduce spam - assume this applies to all other similar changes, as i see several more

@wileyj
Copy link
Copy Markdown
Contributor

wileyj commented May 12, 2026

The @ASuciuX email address was mapping to @BowTiedDeployer which didn't sign the CLA. To allow this PR to be merged I rebased the commits, replacing the email address with the no-reply one and signed with my signature. Hope that's ok @wileyj.

i see @ASuciuX is credited as co-author so it's perfectly fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants