Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile #2278

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AnkushinDaniil
Copy link
Contributor

@AnkushinDaniil AnkushinDaniil commented Nov 23, 2024

This pull request includes several updates to the Makefile to improve clarity and functionality. The most important changes include adding descriptions to various targets, ensuring the linter is run conditionally, and adding a new target for running a node with specific configurations.

Enhancements to target descriptions and functionality:

  • Added descriptions to various targets to improve clarity, such as juno, generate, clean-testcache, test, test-cached, test-race, benchmarks, test-cover, install-deps, lint, tidy, format, clean, help, feedernode, node1, node2, node3, pathfinder, and test-fuzz. [1] [2] [3] [4] [5]

  • Modified the install-golangci-lint target to use command -v instead of which for checking if golangci-lint is installed.

  • Added a new target juno-cached with a description for cached Juno compilation.

  • Added --disable-l1-verification flag to node targets (node1, node2, node3, pathfinder) to disable L1 verification.

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.36%. Comparing base (e3d6ccf) to head (8ae8750).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2278      +/-   ##
==========================================
- Coverage   75.41%   75.36%   -0.05%     
==========================================
  Files         107      107              
  Lines       11404    11404              
==========================================
- Hits         8600     8595       -5     
- Misses       2151     2153       +2     
- Partials      653      656       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnkushinDaniil AnkushinDaniil force-pushed the daniil/add-disable-l1-verification-in-makefile branch from d81a3c9 to 1c4fdd1 Compare November 27, 2024 01:04
Makefile Outdated
@@ -1,6 +1,8 @@
.DEFAULT_GOAL := help

.PHONY: vm
.PHONY: vm rustdeps juno juno-cached check-rust generate clean-testcache test test-cached \
Copy link
Contributor

Choose a reason for hiding this comment

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

in my opinion we need it only for vm and juno + also consider to move them on top of corresponding commands

@@ -90,29 +92,37 @@ install-mockgen:
go install go.uber.org/mock/mockgen@latest

install-golangci-lint:
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]
@command -v golangci-lint >/dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/[email protected]
Copy link
Contributor

@kirugan kirugan Nov 27, 2024

Choose a reason for hiding this comment

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

what difference between old and new versions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Key Differences

  1. which Command:

    • Code:
      makefile
      Copy code
      @which golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]
    • Behavior:
      • which golangci-lint checks if golangci-lint is in the system's PATH.
      • If not found, which exits with a non-zero exit status, triggering the go install command.
    • Portability:
      • The which command is not built into all shells, so it might not work in environments where which is unavailable.
  2. command -v Built-in:

    • Code:
      makefile
      Copy code
      @command -v golangci-lint >/dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/[email protected]
    • Behavior:
      • command -v golangci-lint checks if golangci-lint is in the system's PATH using a shell built-in.
      • It outputs nothing to stdout (because of >/dev/null) and suppresses error messages (via 2>&1).
      • If the command does not exist, it exits with a non-zero status, triggering the go install command.
    • Portability:
      • command -v is POSIX-compliant and more portable across different systems compared to which.

Summary of Pros and Cons

Feature which command -v
Portability Less portable (not always available) More portable (POSIX-compliant)
Shell Dependency External command Built into most shells
Error Suppression No built-in suppression mechanism Can suppress both stdout and stderr easily
Preferred Use Case For environments where which exists General-purpose across platforms

Makefile Outdated
--p2p-private-key="54a695e2a5d5717d5ba8730efcafe6f17251a1955733cffc55a4085fbf7f5d2c1b4009314092069ef7ca9b364ce3eb3072531c64dfb2799c6bad76720a5bdff0" \
--metrics-port=9094
pathfinder: juno-cached ## Run a node to sync from pathfinder
$(call run_node,pathfinder,$(PATHFINDER_ADDR),$(PATHFINDER_KEY),9094)
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion we should keep it as it was. These commands are temporary for our convinience to test p2p

Copy link
Contributor

Choose a reason for hiding this comment

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

we should keep it as it was

node1, node2, node3, pathfinder targets

Copy link
Contributor

@wojciechos wojciechos left a comment

Choose a reason for hiding this comment

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

LGTM

@AnkushinDaniil AnkushinDaniil force-pushed the daniil/add-disable-l1-verification-in-makefile branch from c3104be to 8ae8750 Compare November 27, 2024 14:48
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.

3 participants