7777CARGO_FEATURE_NEXT =
7878endif
7979
80+ if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
81+ CARGO_FEATURE_FASTDEV = --features fastdev
82+ else
83+ CARGO_FEATURE_FASTDEV =
84+ endif
85+
8086main/XDRFilesSha256.cpp : $(SRC_X_FILES ) Makefile $(top_srcdir ) /hash-xdrs.sh
8187 $(top_srcdir ) /hash-xdrs.sh $(top_srcdir ) /src/protocol-curr > $@
8288
@@ -131,7 +137,7 @@ stellar_core_SOURCES += $(GENERATED_XDRQUERY_SOURCES) util/xdrquery/XDRQueryPars
131137BUILT_SOURCES += rust/RustBridge.h $(GENERATED_RUST_SOURCES )
132138stellar_core_SOURCES += rust/RustBridge.h $(GENERATED_RUST_SOURCES )
133139
134- if UNIFIED_RUST
140+ if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
135141RUST_TOOLCHAIN_CHANNEL =nightly
136142else
137143RUST_TOOLCHAIN_FILE =$(top_srcdir ) /rust-toolchain.toml
@@ -151,22 +157,27 @@ RUST_BUILD_DIR=$(top_builddir)/src/rust
151157RUST_BIN_DIR =$(RUST_BUILD_DIR ) /bin
152158RUST_TARGET_DIR =$(top_builddir ) /target
153159RUST_CXXBRIDGE =$(RUST_BIN_DIR ) /cxxbridge
160+
161+ if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
162+ RUST_PROFILE =fastdev
163+ else
154164RUST_PROFILE =release
165+ endif
155166
156167check-rust-profile : Makefile
157168 @case " $( RUST_PROFILE) " in \
158- release| dev) ;; \
159- * ) echo " Error: RUST_PROFILE must be 'release' or 'dev ', got '$( RUST_PROFILE) '" >&2 ; exit 1;; \
169+ release| dev| fastdev ) ;; \
170+ * ) echo " Error: RUST_PROFILE must be 'release', 'dev', or 'fastdev ', got '$( RUST_PROFILE) '" >&2 ; exit 1;; \
160171 esac
161172
162173# Of course, RUST_PROFILE can't be used as an argument directly because cargo
163174# doesn't let you pass --debug, that's the default! you can only pass --release.
164175# So we have to derive a new variable here.
165- RUST_PROFILE_ARG := $(if $(findstring release,$(RUST_PROFILE ) ) ,--release,)
176+ RUST_PROFILE_ARG := $(if $(findstring fastdev, $( RUST_PROFILE ) ) ,--profile fastdev, $( if $( findstring release,$(RUST_PROFILE ) ) ,--release,) )
166177
167178# Also for even more nonsense reasons the debug profile name is actually `dev`
168179# but only in the command line, the target subdirectory gets called `debug`.
169- RUST_PROFILE_DIR := $(if $(findstring release,$(RUST_PROFILE ) ) ,release,debug)
180+ RUST_PROFILE_DIR := $(if $(findstring fastdev, $( RUST_PROFILE ) ) ,fastdev, $( if $( findstring release,$(RUST_PROFILE ) ) ,release,debug) )
170181
171182RUST_DEP_TREE_STAMP =$(RUST_BUILD_DIR ) /src/dep-trees/equal-trees.stamp
172183SOROBAN_LIBS_STAMP =$(RUST_BUILD_DIR ) /soroban/soroban-libs.stamp
@@ -201,7 +212,11 @@ SOROBAN_BUILD_DIR=$(abspath $(RUST_BUILD_DIR))/soroban
201212# variable empty (and include or exclude submodules from the list of
202213# ALL_SOROBAN_PROTOCOLS as you see fit).
203214
215+ if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
216+ ALL_SOROBAN_PROTOCOLS =p26
217+ else
204218ALL_SOROBAN_PROTOCOLS =p21 p22 p23 p24 p25 p26
219+ endif
205220WIP_SOROBAN_PROTOCOL =p27
206221
207222CARGO_XDR_FEATURE_FLAGS =
@@ -287,23 +302,23 @@ $(SOROBAN_BUILD_DIR)/%/target/git-state.txt: $(top_srcdir)/.git/modules/src/rust
287302 printf ' %s\n' " $$ state" > $@ .tmp; \
288303 if cmp -s $@ .tmp $@ ; then rm -f $@ .tmp; else mv -f $@ .tmp $@ ; fi
289304
290- # The "unified" rust build is a special non-production mode that builds all of
305+ # The fastdev rust build is a special non-production mode that builds all of
291306# the rust dependencies of librust_stellar_core.a through a single cargo
292307# invocation, which is actually the "normal" way cargo operates, but which also
293308# has the negative side effect of resolving (merging) different point releases
294309# and pre-release minor versions across transitive dependencies, which means we
295310# can't control the _exact_ transitive dependencies as well as we'd like.
296311#
297- # So we only use the unified rust build for certain special cases such as
312+ # So we only use the fastdev rust build for certain special cases such as
298313# testing with asan/tsan (they seem to only work well when built this way) and
299314# use the non-unified build (with separate .a files for each separate soroban
300315# version) for production builds.
301316
302- if UNIFIED_RUST
317+ if ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
303318
304- # In the unified build, we have to pass the --target flag. This actually breaks
319+ # In the fastdev build, we have to pass the --target flag. This actually breaks
305320# the non-unified build, so we wind up setting LIBRUST_STELLAR_CORE separately
306- # in unified and non-unified builds.
321+ # in fastdev and non-unified builds.
307322RUST_TARGET =$(shell rustc -vV | sed -n 's/host: //p')
308323LIBRUST_STELLAR_CORE =$(RUST_TARGET_DIR ) /$(RUST_TARGET ) /$(RUST_PROFILE_DIR ) /librust_stellar_core.a
309324
@@ -323,14 +338,13 @@ $(LIBRUST_STELLAR_CORE): $(RUST_HOST_DEPFILES) $(SRC_RUST_FILES) Makefile $(RUST
323338 $(CARGOFLAGS_BUILDSTD ) \
324339 --package stellar-core \
325340 --target $(RUST_TARGET ) \
326- --features unified \
327341 $(RUST_PROFILE_ARG ) \
328342 --locked \
329343 --target-dir $(abspath $(RUST_TARGET_DIR ) ) \
330- $(CARGO_FEATURE_TRACY ) $(CARGO_FEATURE_NEXT ) $(CARGO_FEATURE_TESTUTILS )
344+ $(CARGO_FEATURE_FASTDEV ) $( CARGO_FEATURE_TRACY ) $(CARGO_FEATURE_NEXT ) $(CARGO_FEATURE_TESTUTILS )
331345 ranlib $@
332346
333- else # !UNIFIED_RUST
347+ else # !ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
334348
335349# This next build command looks a little weird but it's necessary. We have to
336350# provide an auxiliary metadata string (using RUSTFLAGS=-Cmetadata=$*)
@@ -444,7 +458,7 @@ $(LIBRUST_STELLAR_CORE): $(RUST_HOST_DEPFILES) $(SRC_RUST_FILES) $(ALL_SOROBAN_L
444458 $(ALL_SOROBAN_DEPEND_ARGS )
445459 ranlib $@
446460
447- endif # UNIFIED_RUST
461+ endif # ENABLE_FASTDEV_UNSAFE_FOR_PRODUCTION
448462
449463stellar_core_LDADD += $(LIBRUST_STELLAR_CORE ) -ldl
450464
0 commit comments