FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Feat(support): mac os + stacks node from commit by ASuciuX · Pull Request #29 · stacks-network/hacknet · GitHub

Feat(support): mac os + stacks node from commit - #29

Closed
ASuciuX wants to merge 3 commits into
stacks-network:masterfrom
hirosystems:feat/mac-os-support
Closed

Feat(support): mac os + stacks node from commit#29
ASuciuX wants to merge 3 commits into
stacks-network:masterfrom
hirosystems:feat/mac-os-support

Conversation

ASuciuX commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Description

This PR adds support for running this environment on mac os.
It also adds support to run the nodes from a given commit, as until now it was only working with branches and github tags.

Type of Change

  • New feature

Does this introduce a breaking change?

It shouldn't break anything.

Testing information

Provide context on how tests should be performed.
Run each functionality on both linux and mac os and check the environment is behaving as it was before(on linux).

BowTiedRadone left a 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you for opening the PR! I believe it brings much value. Left a few comments, but I'd also wait for @wileyj to check as well 🙏

Comment thread Makefile
Comment thread Makefile
$(CHAINSTATE_DIR):
@if [ ! -d "$(CHAINSTATE_DIR)" ]; then \
mkdir -p $(CHAINSTATE_DIR); \
if [ "$(TARGET)" = "up" ]; then \

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we re-add @ and remove all the nested \s? It's visually better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I added the backslashes manually because they make the intent explicit by defining how multi-line commands are interpreted. I've followed the documented convention https://www.gnu.org/software/make/manual/html_node/Splitting-Recipe-Lines.html

The previous implementation was functioning correctly, so we can keep it as it was if you prefer.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd say let's keep as it was before (only to minimize the current PR's diff), and eventually consider making Makefile more explicit in a separate issue.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this addition needed?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

technically no, since it's the end of the conditional

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same here.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same here regarding \.

BowTiedRadone Dec 4, 2025
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I guess all these side changes were created by a formatter. I'm curious what's the formatter, maybe we can take it into account for our CI. We're currently using dclint for docker-compose related files, but one for Makefile would be a great idea.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

makefile linter would be great! i think it would be challenging since we use a "shell-ified" makefile though

Comment thread docker/stacks/Dockerfile
Comment on lines +13 to +19
# Clone efficiently: shallow for branches/tags, targeted fetch for commits
# This avoids downloading the full 2GB+ history
RUN git init /code/stacks-core && \
cd /code/stacks-core && \
git remote add origin https://github.com/stacks-network/stacks-core.git && \
git fetch --depth=1 origin $STACKS_CORE_BASE_BRANCH && \
git checkout FETCH_HEAD

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I like this a lot! 💯

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

alternatively, what about cloning a single branch and then checkout? this will work, but wouldn't git clone --single-branch work and use less lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this would require in the setup to specify for a wanted commit both the commit and the branch where the commit can be found, as otherwise it would not have it locally to checkout to.

Comment thread docker/stacks/Dockerfile Outdated

ASuciuX left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can restore the format for the shell lines, as you think it would make more sense.

Also, I've seen that .ONESHELL can be used and that would mean that '' would not be used, it would treat all indented lines below as a single shell script, but I haven't used it before.

Comment thread Makefile
$(CHAINSTATE_DIR):
@if [ ! -d "$(CHAINSTATE_DIR)" ]; then \
mkdir -p $(CHAINSTATE_DIR); \
if [ "$(TARGET)" = "up" ]; then \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I added the backslashes manually because they make the intent explicit by defining how multi-line commands are interpreted. I've followed the documented convention https://www.gnu.org/software/make/manual/html_node/Splitting-Recipe-Lines.html

The previous implementation was functioning correctly, so we can keep it as it was if you prefer.

Comment thread Makefile
Co-authored-by: Radu Bahmata <92028479+BowTiedRadone@users.noreply.github.com>

BowTiedRadone left a 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just wrapped up another round of review. If you agree to rebase on top of latest from master, I can then easily use it to test locally on both macOS and Debian. For now, let's minimize the diff by removing backslashes (but keep the comment fixes).

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.3.0.0.1}
- &STACKS_CORE_BASE_BRANCH ${STACKS_CORE_BASE_BRANCH:-7ff75a23439879a1316b1423587bfd0dac17a44f} # 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do you want to rebase the branch on top of latest from master, keep the existing tag and keep the "branch, tag, commit" comment at the end?

Comment thread Makefile
$(CHAINSTATE_DIR):
@if [ ! -d "$(CHAINSTATE_DIR)" ]; then \
mkdir -p $(CHAINSTATE_DIR); \
if [ "$(TARGET)" = "up" ]; then \

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd say let's keep as it was before (only to minimize the current PR's diff), and eventually consider making Makefile more explicit in a separate issue.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same here.

Copy link
Copy Markdown
Contributor

Closing in favor of #39.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL