-
Notifications
You must be signed in to change notification settings - Fork 170
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
base: main
Are you sure you want to change the base?
Update Makefile #2278
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
d81a3c9
to
1c4fdd1
Compare
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 \ |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key Differences
which
Command:- Code:makefileCopy code
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]
- Behavior:
which golangci-lint
checks ifgolangci-lint
is in the system's PATH.- If not found,
which
exits with a non-zero exit status, triggering thego install
command.
- Portability:
- The
which
command is not built into all shells, so it might not work in environments wherewhich
is unavailable.
- The
- Code:
command -v
Built-in:- Code:makefileCopy 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 ifgolangci-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 (via2>&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 towhich
.
- Code:
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ication flag and adding commands to .PHONY
c3104be
to
8ae8750
Compare
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
, andtest-fuzz
. [1] [2] [3] [4] [5]Modified the
install-golangci-lint
target to usecommand -v
instead ofwhich
for checking ifgolangci-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.