Skip to content

Commit fe0aab1

Browse files
author
Uilebheist
committed
Adding an option to specify a version of sqlite3 to build and use to update
the results databases (default latest, which was the version used before). Also adding an option to pass a mirror directory to not-fork. Updating documentation. FossilOrigin-Name: aacad5c1a91244feb6b30b4ad883c0ef201983add3516b782fd065ca8050fd1f
1 parent cd00968 commit fe0aab1

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ test: Makefile.options $(TEST_DATABASE_NAME)
6969

7070
database: $(DATABASE_NAME)
7171
$(DATABASE_NAME):
72-
$(TCL) tool/build.tcl database not-fork.d $(BUILD_DIR) $(DATABASE_NAME)
72+
$(TCL) tool/build.tcl database not-fork.d $(BUILD_DIR) $(DATABASE_NAME) $(BUILD_OPTIONS)
7373
$(TEST_DATABASE_NAME):
74-
$(TCL) tool/build.tcl database not-fork.d $(BUILD_DIR) $(TEST_DATABASE_NAME)
74+
$(TCL) tool/build.tcl database not-fork.d $(BUILD_DIR) $(TEST_DATABASE_NAME) $(BUILD_OPTIONS)
7575

7676
# show what targets would be built, useful to test combinations of command-line
7777
# options

doc/lumo-build-benchmark.md

+5
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ targets specified; the targets are specified using the same syntax as
318318
`TARGETS` described below, with run-time options ignored (build-time
319319
options will be respected). This is mainly used by some compatibility
320320
tests to make sure a version with some special options is also built.
321+
* `SQLITE_FOR_DB=version` - sqlite3 version to build and use to
322+
update results databases; if this option is not provided, it defaults
323+
to `latest`
321324
* `BENCHMARK_RUNS=number` - how many times to repeat each benchmark, default 1.
322325

323326
Options which take a list of versions expect a space-separated list (this
@@ -376,6 +379,8 @@ to the not-forking tool; this could be necessary if the defaults have been
376379
set to `--offline` and the operation cannot be completed with cached data.
377380
* `CACHE_DIR=path` (default: `$HOME/.cache/LumoSQL/not-fork`), the directory
378381
where not-forking will cache its downloads
382+
* `NOTFORK_MIRROR=dir` pass `--local-mirror=dir` to `not-fork`, to use
383+
locally-stored sources where possible
379384

380385
To help debugging, some options provide a mechanism to copy intermediate
381386
files, as well as the SQL statement used:

tool/build.tcl

+13-4
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ if {$operation eq "options"} {
8383
puts $outf ""
8484
set prn 1
8585
} elseif {$operation eq "database"} {
86-
if {[llength $argv] != 4} {
87-
puts stderr "Usage: build.tcl database NOTFORK_CONFIG BUILD_DIR DATABASE_NAME"
86+
if {[llength $argv] < 4} {
87+
puts stderr "Usage: build.tcl database NOTFORK_CONFIG BUILD_DIR DATABASE_NAME BUILD_OPTIONS..."
8888
exit 1
8989
}
9090
set build_dir [lindex $argv 2]
@@ -299,8 +299,10 @@ array set other_values [list \
299299
LUMO_TEST_DIR "" \
300300
MAKE_COMMAND "make" \
301301
NOTFORK_COMMAND "not-fork" \
302+
NOTFORK_MIRROR "" \
302303
NOTFORK_ONLINE 0 \
303304
NOTFORK_UPDATE 0 \
305+
SQLITE_FOR_DB "" \
304306
SQLITE_VERSIONS [join $sqlite3_versions] \
305307
USE_SQLITE "yes" \
306308
]
@@ -491,6 +493,9 @@ proc notfork_command {target args} {
491493
if {$other_values(NOTFORK_ONLINE)} {
492494
lappend rargs "--online"
493495
}
496+
if {$other_values(NOTFORK_MIRROR) ne ""} {
497+
lappend rargs $other_values(NOTFORK_MIRROR) "--local-mirror"
498+
}
494499
if {$other_values(CACHE_DIR) ne ""} {
495500
lappend rargs $other_values(CACHE_DIR) "--cache"
496501
}
@@ -568,8 +573,12 @@ if {$operation ne "what" && $operation ne "targets"} {
568573
set build_dir [file normalize $build_dir]
569574
}
570575

571-
versions_list sqlite3_for_db sqlite3 latest ""
572-
set sqlite3_for_db [lindex $sqlite3_for_db 0]
576+
if {$other_values(SQLITE_FOR_DB) eq ""} {
577+
versions_list sqlite3_for_db sqlite3 latest ""
578+
set sqlite3_for_db [lindex $sqlite3_for_db 0]
579+
} else {
580+
set sqlite3_for_db $other_values(SQLITE_FOR_DB)
581+
}
573582
set target_string $other_values(TARGETS)
574583
set benchmark_list [list]
575584
set build_list [list $sqlite3_for_db]

0 commit comments

Comments
 (0)