Skip to content

Commit 95f22c5

Browse files
fix: cleaned up and fixed just commands and cargo builds
1 parent b25231c commit 95f22c5

4 files changed

Lines changed: 70 additions & 109 deletions

File tree

Justfile

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,45 @@ set shell := ["bash", "-c"]
66
# Default target
77
default: build
88

9-
# Build the project using Nix
10-
build:
11-
@echo "Building Aptos Core with Nix..."
12-
nix build .#aptos-node
9+
# Build the project or a specific binary using Nix development shell
10+
build binary="all":
11+
#!/usr/bin/env bash
12+
if [ "{{binary}}" = "all" ]; then
13+
echo "Building Aptos Core with Nix development shell..."
14+
nix develop -c cargo build --release
15+
else
16+
case "{{binary}}" in
17+
"aptos-node")
18+
package="aptos-node"
19+
;;
20+
"aptos")
21+
package="crates/aptos"
22+
;;
23+
"aptos-debugger")
24+
package="crates/aptos-debugger"
25+
;;
26+
"aptos-backup-cli")
27+
package="storage/backup/backup-cli"
28+
;;
29+
"aptos-keygen")
30+
package="crates/aptos-keygen"
31+
;;
32+
"transaction-emitter")
33+
package="crates/transaction-emitter"
34+
;;
35+
"aptos-node-checker")
36+
package="ecosystem/node-checker"
37+
;;
38+
*)
39+
echo "Error: Unknown binary '{{binary}}'. Use 'just list-binaries' to see available binaries."
40+
exit 1
41+
;;
42+
esac
43+
44+
echo "Building {{binary}} with Nix development shell..."
45+
nix develop -c cargo build --release -p "$package"
46+
echo "Binary available at target/release/{{binary}}"
47+
fi
1348
1449
# Enter the development environment
1550
dev:
@@ -41,23 +76,39 @@ update:
4176
@echo "Updating flake.lock..."
4277
nix flake update
4378

44-
# Build aptos-node binary
45-
aptos-node:
46-
@echo "Building aptos-node with Nix..."
47-
nix build .#aptos-node
48-
@echo "Binary available at result/bin/aptos-node"
49-
50-
# Build Docker image using Nix
51-
docker-nix:
52-
@echo "Building Docker image with Nix..."
53-
nix build .#aptos-node-docker
54-
@echo "Docker image available as result.tar.gz"
55-
5679
# Build Docker image
5780
docker:
5881
@echo "Building Docker image..."
5982
docker build -f nix/Dockerfile.nix -t aptos-node .
6083

84+
# Build any binary by package name
85+
build-bin package:
86+
@echo "Building {{package}} with Nix development shell..."
87+
nix develop -c cargo build --release -p {{package}}
88+
@echo "Binary available at target/release/{{package}}"
89+
90+
# List available binary build targets
91+
list-binaries:
92+
@echo "Available binary build targets:"
93+
@echo " Generic: just build <binary-name>"
94+
@echo " Common binaries:"
95+
@echo " aptos-node - Main Aptos node"
96+
@echo " aptos - Aptos CLI tool"
97+
@echo " aptos-debugger - Debugging tool"
98+
@echo " aptos-backup-cli - Backup CLI tool"
99+
@echo " aptos-keygen - Key generation tool"
100+
@echo " transaction-emitter - Transaction emitter"
101+
@echo " aptos-node-checker - Node checker tool"
102+
@echo ""
103+
@echo "Use 'just build' to build all packages"
104+
@echo "Use 'just build-bin <package-name>' for custom package builds"
105+
61106
# Help - list available recipes
62107
help:
63-
@just --list
108+
@just --list
109+
@echo ""
110+
@echo "Binary Build Options:"
111+
@echo " Use 'just list-binaries' to see available binary build targets"
112+
@echo " Use 'just build <binary-name>' for common binary builds"
113+
@echo " Use 'just build' to build all packages"
114+
@echo " Use 'just build-bin <package-name>' for custom package builds"

nix/flake.nix

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,8 @@
2626
in
2727
{
2828
packages = {
29-
aptos-node = pkgs.callPackage (import "${self}/nix/pkgs/aptos-node.nix") {
30-
rustPlatform = customRustPlatform;
31-
inherit (pkgs) openssl pkg-config cmake clang protobuf;
32-
RocksDB = pkgs.rocksdb;
33-
};
34-
35-
aptos-node-docker = pkgs.callPackage (import "${self}/nix/pkgs/aptos-core-docker.nix") {
36-
aptos-node = self.packages.${system}.aptos-node;
37-
};
38-
39-
default = self.packages.${system}.aptos-core;
29+
# Packages removed - using development shell approach instead
30+
# Use 'just build' or 'just aptos-node' for building
4031
};
4132

4233
devShells = {

nix/pkgs/aptos-node-docker.nix

Lines changed: 0 additions & 24 deletions
This file was deleted.

nix/pkgs/aptos-node.nix

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)