diff --git a/embed/README.md b/embed/README.md index 3acd5df..ea88feb 100644 --- a/embed/README.md +++ b/embed/README.md @@ -1,6 +1,6 @@ # Embeddable WASM build of SQLite -This folder includes an embeddable WASM build of SQLite 3.41.0 for use with +This folder includes an embeddable WASM build of SQLite 3.41.1 for use with [`github.com/ncruces/go-sqlite3`](https://pkg.go.dev/github.com/ncruces/go-sqlite3). The following optional features are compiled in: diff --git a/embed/build.sh b/embed/build.sh index 655387e..f864f58 100755 --- a/embed/build.sh +++ b/embed/build.sh @@ -3,9 +3,6 @@ set -eo pipefail cd -P -- "$(dirname -- "$0")" -# download SQLite -../sqlite3/download.sh - # build SQLite zig cc --target=wasm32-wasi -flto -g0 -Os \ -o sqlite3.wasm ../sqlite3/main.c \ diff --git a/sqlite3/download.sh b/sqlite3/download.sh index 21e4042..0c191c5 100755 --- a/sqlite3/download.sh +++ b/sqlite3/download.sh @@ -3,11 +3,20 @@ set -eo pipefail cd -P -- "$(dirname -- "$0")" -if [ ! -f "sqlite3.c" ]; then - url="https://sqlite.org/2023/sqlite-amalgamation-3410100.zip" - curl "$url" > sqlite.zip - unzip -d . sqlite.zip - mv sqlite-amalgamation-*/sqlite3* . - rm -rf sqlite-amalgamation-* - rm sqlite.zip -fi \ No newline at end of file +curl -#OL "https://sqlite.org/2023/sqlite-amalgamation-3410100.zip" +unzip -d . sqlite-amalgamation-*.zip +mv sqlite-amalgamation-*/sqlite3* . +rm -rf sqlite-amalgamation-* + +cd ../tests/mptest/testdata/ +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/mptest.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/config01.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/config02.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/crash01.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/crash02.subtest" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/multiwrite01.test" +cd ~- + +cd ../tests/speedtest1/testdata/ +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.41.1/test/speedtest1.c" +cd ~- \ No newline at end of file diff --git a/tests/mptest/testdata/build.sh b/tests/mptest/testdata/build.sh index 7a081f8..25c8495 100755 --- a/tests/mptest/testdata/build.sh +++ b/tests/mptest/testdata/build.sh @@ -3,15 +3,6 @@ set -eo pipefail cd -P -- "$(dirname -- "$0")" -if [ ! -f "mptest.c" ]; then - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/mptest.c" - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/config01.test" - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/config02.test" - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/crash01.test" - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/crash02.subtest" - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/mptest/multiwrite01.test" -fi - zig cc --target=wasm32-wasi -flto -g0 -Os \ -o mptest.wasm main.c \ -I../../../sqlite3 \ diff --git a/tests/speedtest1/testdata/build.sh b/tests/speedtest1/testdata/build.sh index 0d6e272..6f8c60e 100755 --- a/tests/speedtest1/testdata/build.sh +++ b/tests/speedtest1/testdata/build.sh @@ -3,10 +3,6 @@ set -eo pipefail cd -P -- "$(dirname -- "$0")" -if [ ! -f "mptest.c" ]; then - curl -sOL "https://github.com/sqlite/sqlite/raw/version-3.41.1/test/speedtest1.c" -fi - zig cc --target=wasm32-wasi -flto -g0 -Os \ -o speedtest1.wasm main.c \ -I../../../sqlite3 \ diff --git a/vfs.go b/vfs.go index d73f80f..434c2a8 100644 --- a/vfs.go +++ b/vfs.go @@ -146,10 +146,6 @@ func vfsFullPathname(ctx context.Context, mod api.Module, pVfs, zRelative, nFull return uint32(CANTOPEN_FULLPATH) } - // Consider either using [filepath.EvalSymlinks] to canonicalize the path (as the Unix VFS does). - // Or using [os.Readlink] to resolve a symbolic link (as the Unix VFS did). - // This might be buggy on Windows (the Windows VFS doesn't try). - size := uint64(len(abs) + 1) if size > uint64(nFull) { return uint32(CANTOPEN_FULLPATH)