@@ -432,8 +432,50 @@ check_wasm_release_bundle() {
432432 fi
433433}
434434
435+ release_ckb_repo_from_args () {
436+ local ckb_repo=" $ROOT_DIR /../ckb"
437+ while (( $# > 0 )) ; do
438+ case " $1 " in
439+ --ckb-repo)
440+ if (( $# < 2 )) ; then
441+ printf ' missing value for --ckb-repo\n' >&2
442+ return 2
443+ fi
444+ ckb_repo=" $2 "
445+ shift 2
446+ ;;
447+ * )
448+ shift
449+ ;;
450+ esac
451+ done
452+ printf ' %s\n' " $ckb_repo "
453+ }
454+
435455check_ckb_tx_measure_tool () {
436- run cargo test --manifest-path tools/ckb-tx-measure/Cargo.toml --locked
456+ local ckb_repo=" $1 "
457+ local default_ckb_repo=" $ROOT_DIR /../ckb"
458+ if [[ ! -d " $ckb_repo " ]]; then
459+ printf ' CKB checkout does not exist: %s\n' " $ckb_repo " >&2
460+ return 1
461+ fi
462+ ckb_repo=" $( cd " $ckb_repo " && pwd -P) "
463+ if [[ -d " $default_ckb_repo " ]]; then
464+ default_ckb_repo=" $( cd " $default_ckb_repo " && pwd -P) "
465+ if [[ " $ckb_repo " == " $default_ckb_repo " ]]; then
466+ run cargo test --manifest-path tools/ckb-tx-measure/Cargo.toml --locked
467+ return
468+ fi
469+ fi
470+
471+ local staging_dir
472+ staging_dir=" $( mktemp -d " $ROOT_DIR /target/cellscript-ckb-tx-measure.XXXXXX" ) "
473+ mkdir -p " $staging_dir /cellscript/tools/ckb-tx-measure" " $staging_dir /cellscript/src/bin"
474+ cp tools/ckb-tx-measure/Cargo.toml tools/ckb-tx-measure/Cargo.lock \
475+ " $staging_dir /cellscript/tools/ckb-tx-measure/"
476+ cp src/bin/ckb_tx_measure.rs " $staging_dir /cellscript/src/bin/"
477+ ln -s " $ckb_repo " " $staging_dir /ckb"
478+ run cargo test --manifest-path " $staging_dir /cellscript/tools/ckb-tx-measure/Cargo.toml" --locked
437479}
438480
439481check_novaseal_rust_tooling () {
@@ -541,6 +583,7 @@ run_backend_gate() {
541583}
542584
543585run_release_auxiliary_checks () {
586+ local ckb_repo=" $1 "
544587 require_cmd npm
545588
546589 run cargo run --quiet --locked -p cellscript-tools --bin cellscript-tools -- \
@@ -549,7 +592,7 @@ run_release_auxiliary_checks() {
549592 check_ckb_release_docs
550593 check_ckb_acceptance_boundaries
551594 check_novaseal_acceptance_boundaries
552- check_ckb_tx_measure_tool
595+ check_ckb_tx_measure_tool " $ckb_repo "
553596 check_novaseal_rust_tooling
554597 check_novaseal_verifier_pinning
555598 check_wasm_release_bundle
@@ -561,18 +604,22 @@ run_release_auxiliary_checks() {
561604}
562605
563606run_release_quick_gate () {
607+ local ckb_repo
608+ ckb_repo=" $( release_ckb_repo_from_args " $@ " ) "
564609 check_release_source_identity
565610 run_ci_gate
566- run_release_auxiliary_checks
611+ run_release_auxiliary_checks " $ckb_repo "
567612 run ./scripts/ckb_cellscript_acceptance.sh --compile-only --production " $@ "
568613 printf ' \nCellScript backend shape report: %s\n' " $CELLSCRIPT_BACKEND_SHAPE_REPORT "
569614 printf ' CellScript Molecule schema manifest report: %s\n' " $CELLSCRIPT_MOLECULE_SCHEMA_MANIFEST_REPORT "
570615}
571616
572617run_release_gate () {
618+ local ckb_repo
619+ ckb_repo=" $( release_ckb_repo_from_args " $@ " ) "
573620 check_release_source_identity
574621 run_ci_gate
575- run_release_auxiliary_checks
622+ run_release_auxiliary_checks " $ckb_repo "
576623 run ./scripts/ckb_cellscript_acceptance.sh --production --stateful-scenarios " $@ "
577624 printf ' \nCellScript backend shape report: %s\n' " $CELLSCRIPT_BACKEND_SHAPE_REPORT "
578625 printf ' CellScript Molecule schema manifest report: %s\n' " $CELLSCRIPT_MOLECULE_SCHEMA_MANIFEST_REPORT "
0 commit comments