Skip to content

Commit 41bdb2f

Browse files
committed
version: fix missing version numbers
1 parent 0020058 commit 41bdb2f

File tree

7 files changed

+43
-31
lines changed

7 files changed

+43
-31
lines changed

src/app/fdctl/Local.mk

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,28 @@ cargo-plugin-bundle:
7272
cd ./plugin/bundle && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --release --lib -p firedancer-plugin-bundle
7373
cargo-validator:
7474
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --release --lib -p agave-validator
75-
cargo-solana:
76-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --release --bin solana
77-
cargo-ledger-tool:
78-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --release --bin agave-ledger-tool
75+
cargo-solana: $(OBJDIR)/lib/libfdctl_version.a
76+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --release --bin solana
77+
cargo-ledger-tool: $(OBJDIR)/lib/libfdctl_version.a
78+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --release --bin agave-ledger-tool
7979
else ifeq ($(RUST_PROFILE),release-with-debug)
8080
cargo-plugin-bundle:
8181
cd ./plugin/bundle && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ../../agave/cargo build --profile=release-with-debug --lib -p firedancer-plugin-bundle
8282
cargo-validator:
8383
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --profile=release-with-debug --lib -p agave-validator
84-
cargo-solana:
85-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --profile=release-with-debug --bin solana
86-
cargo-ledger-tool:
87-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --profile=release-with-debug --bin agave-ledger-tool
84+
cargo-solana: $(OBJDIR)/lib/libfdctl_version.a
85+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --profile=release-with-debug --bin solana
86+
cargo-ledger-tool: $(OBJDIR)/lib/libfdctl_version.a
87+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --profile=release-with-debug --bin agave-ledger-tool
8888
else
8989
cargo-plugin-bundle:
9090
cd ./plugin/bundle && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --lib -p firedancer-plugin-bundle
9191
cargo-validator:
9292
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --lib -p agave-validator
93-
cargo-solana:
94-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --bin solana
95-
cargo-ledger-tool:
96-
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS)" ./cargo build --bin agave-ledger-tool
93+
cargo-solana: $(OBJDIR)/lib/libfdctl_version.a
94+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --bin solana
95+
cargo-ledger-tool: $(OBJDIR)/lib/libfdctl_version.a
96+
cd ./agave && env --unset=LDFLAGS RUSTFLAGS="$(RUSTFLAGS) -L $(realpath $(OBJDIR)/lib) -l fdctl_version" ./cargo build --bin agave-ledger-tool
9797
endif
9898

9999
# We sleep as a workaround for a bizarre problem where the build system

src/app/fdctl/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ ulong const fdctl_major_version = FDCTL_MAJOR_VERSION;
1515
ulong const fdctl_minor_version = FDCTL_MINOR_VERSION;
1616
ulong const fdctl_patch_version = FDCTL_PATCH_VERSION;
1717
uint const fdctl_commit_ref = FDCTL_COMMIT_REF_U32;
18-
char const fdctl_commit_ref_string[] = FD_EXPAND_THEN_STRINGIFY(FDCTL_COMMIT_REF_CSTR);
18+
char const fdctl_commit_ref_string[] = FDCTL_COMMIT_REF_CSTR;
1919
char const fdctl_version_string[] = FD_EXPAND_THEN_STRINGIFY(FDCTL_MAJOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FDCTL_MINOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FDCTL_PATCH_VERSION);

src/app/firedancer/version.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ ulong const firedancer_major_version = FIREDANCER_MAJOR_VERSION;
1515
ulong const firedancer_minor_version = FIREDANCER_MINOR_VERSION;
1616
ulong const firedancer_patch_version = FIREDANCER_PATCH_VERSION;
1717
uint const firedancer_commit_ref = FIREDANCER_COMMIT_REF_U32;
18-
char const firedancer_commit_ref_string[] = FD_EXPAND_THEN_STRINGIFY(FIREDANCER_COMMIT_REF_CSTR);
18+
char const firedancer_commit_ref_string[] = FIREDANCER_COMMIT_REF_CSTR;
1919
char const firedancer_version_string[] = FD_EXPAND_THEN_STRINGIFY(FIREDANCER_MAJOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FIREDANCER_MINOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FIREDANCER_PATCH_VERSION);
2020

2121
// Some shared code assumes the fdctl version numbers, just replace them
22-
char const fdctl_commit_ref_string[] = FD_EXPAND_THEN_STRINGIFY(FIREDANCER_COMMIT_REF_CSTR);
22+
char const fdctl_commit_ref_string[] = FIREDANCER_COMMIT_REF_CSTR;
2323
char const fdctl_version_string[] = FD_EXPAND_THEN_STRINGIFY(FIREDANCER_MAJOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FIREDANCER_MINOR_VERSION) "." FD_EXPAND_THEN_STRINGIFY(FIREDANCER_PATCH_VERSION);

src/disco/gui/fd_gui_printf.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88

99
#include "../../ballet/http/fd_http_server_private.h"
1010
#include "../../ballet/utf8/fd_utf8.h"
11+
12+
#ifdef __has_include
13+
#if __has_include("../../app/fdctl/version.h")
1114
#include "../../app/fdctl/version.h"
15+
#endif
16+
#endif
17+
18+
#ifndef FDCTL_COMMIT_REF_CSTR
19+
#define FDCTL_COMMIT_REF_CSTR "0000000000000000000000000000000000000000"
20+
#endif
1221

1322
static void
1423
jsonp_strip_trailing_comma( fd_gui_t * gui ) {
@@ -196,11 +205,7 @@ fd_gui_printf_cluster( fd_gui_t * gui ) {
196205
void
197206
fd_gui_printf_commit_hash( fd_gui_t * gui ) {
198207
jsonp_open_envelope( gui, "summary", "commit_hash" );
199-
#ifdef FDCTL_COMMIT_REF_CSTR
200-
jsonp_string( gui, "value", FD_EXPAND_THEN_STRINGIFY(FDCTL_COMMIT_REF_CSTR) );
201-
#else
202-
jsonp_string( gui, "value", "0000000000000000000000000000000000000000" );
203-
#endif
208+
jsonp_string( gui, "value", FDCTL_COMMIT_REF_CSTR );
204209
jsonp_close_envelope( gui );
205210
}
206211

src/util/fd_util_base.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919

2020
#endif //__cplusplus
2121

22-
/* Versioning macros **************************************************/
23-
24-
/* FD_VERSION_{MAJOR,MINOR,PATCH} programmatically specify the
25-
firedancer version. */
26-
27-
#define FD_VERSION_MAJOR (0)
28-
#define FD_VERSION_MINOR (0)
29-
#define FD_VERSION_PATCH (0)
30-
3122
/* Build target capabilities ******************************************/
3223

3324
/* Different build targets often have different levels of support for

src/util/log/fd_log.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@
4747

4848
#include "../tile/fd_tile_private.h"
4949

50+
#ifdef __has_include
51+
#if __has_include("../../app/fdctl/version.h")
52+
#include "../../app/fdctl/version.h"
53+
#endif
54+
#endif
55+
56+
#ifndef FDCTL_MAJOR_VERSION
57+
#define FDCTL_MAJOR_VERSION 0
58+
#endif
59+
#ifndef FDCTL_MINOR_VERSION
60+
#define FDCTL_MINOR_VERSION 0
61+
#endif
62+
#ifndef FDCTL_PATCH_VERSION
63+
#define FDCTL_PATCH_VERSION 0
64+
#endif
65+
5066
#ifdef FD_BUILD_INFO
5167
FD_IMPORT_CSTR( fd_log_build_info, FD_BUILD_INFO );
5268
#else
@@ -1027,7 +1043,7 @@ fd_log_private_open_path( int cmdline,
10271043
fd_log_wallclock_cstr( fd_log_wallclock(), tag );
10281044
for( ulong b=0UL; tag[b]; b++ ) if( tag[b]==' ' || tag[b]=='-' || tag[b]=='.' || tag[b]==':' ) tag[b] = '_';
10291045
ulong len; fd_cstr_printf( fd_log_private_path, 1024UL, &len, "/tmp/fd-%i.%i.%i_%lu_%s_%s_%s",
1030-
FD_VERSION_MAJOR, FD_VERSION_MINOR, FD_VERSION_PATCH,
1046+
FDCTL_MAJOR_VERSION, FDCTL_MINOR_VERSION, FDCTL_PATCH_VERSION,
10311047
fd_log_group_id(), fd_log_user(), fd_log_host(), tag );
10321048
if( len==1023UL ) { fd_log_private_fprintf_0( STDERR_FILENO, "default log path too long; unable to boot\n" ); exit(1); }
10331049
}

0 commit comments

Comments
 (0)