Repository navigation
ADFA-7082: sqlite-js AAR for apps built with Code on the Go #2244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davidschachterADFA
wants to merge
34
commits into
stage
Choose a base branch
from
feat/ADFA-7082-sqlite-js-aar
base: stage
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d89431e
ADFA-7082: Vendor sqlite-js 1.3.7 with our patches
davidschachterADFA ae04160
ADFA-7082: Build the sqlite-js AAR for apps in subprojects:sqlite-js
davidschachterADFA f766299
ADFA-7082: Release the sqlite-js AAR to sqlite-js-latest
davidschachterADFA 3372d3b
ADFA-7082: Build the sqlite-js AAR for arm64-v8a and armeabi-v7a only
davidschachterADFA 1391c4b
ADFA-7082: Run no stored code by default; test sqlite-js on pull requ…
davidschachterADFA e0f400a
ADFA-7082: Update sqlite-js-latest in place, out of latest-release se…
davidschachterADFA 362ad7f
ADFA-7082: Sort the QuickJS copyright lines the same on every machine
davidschachterADFA 2f3460f
ADFA-7082: Log stored functions that cannot be listed; guard the tag …
davidschachterADFA 401a052
ADFA-7082: Vendor the reviewed sqlite-js patches
davidschachterADFA 44a6e88
ADFA-7082: Put back both the assets and the tag if a release update f…
davidschachterADFA 3c93bda
ADFA-7082: Find js_functions in any case; sync the cancel test; doc c…
davidschachterADFA 0d1f9db
ADFA-7082: Let a re-run repair a release left without its assets
davidschachterADFA ac748be
ADFA-7082: Vendor sqlite-js main with our changes merged, one patch left
davidschachterADFA 8086fd1
ADFA-7082: Vendor the sqlite-js 1.4.1 release
davidschachterADFA 6957c71
ADFA-7082: Let a connection open, and its stored functions load, duri…
davidschachterADFA 763bb47
ADFA-7082: Patch two stack-bound crashes and two garbage cases
davidschachterADFA c084450
ADFA-7082: Let a re-run replace a release left as a draft
davidschachterADFA 7f8e40c
style: spotless reformat, no functional change
davidschachterADFA a113c80
ADFA-7082: End the result sets an interrupted call leaves open
davidschachterADFA 64269ea
ADFA-7082: Make ending result sets safe when it runs JavaScript, and …
davidschachterADFA 851ee17
ADFA-7082: Stop what ending result sets runs; count the interrupts db…
davidschachterADFA 8973b29
ADFA-7082: Answer the independent review of patches 0004 to 0007
davidschachterADFA db04941
ADFA-7082: Test a direct interrupt during db.exec with a result set kept
davidschachterADFA e538658
Merge branch 'stage' into feat/ADFA-7082-sqlite-js-aar
davidschachterADFA 3a5cb53
ADFA-7082: Vendor the sqlite-js 1.4.2 release
davidschachterADFA 464e6e7
ADFA-7082: Test sqlite-js 1.4.2's result-set rule and patch 0002
davidschachterADFA 5b9b062
ADFA-7082: Keep a call's cancel for the finals its result sets run
davidschachterADFA 5b5cd20
ADFA-7082: Say what a late cancel does to a call's finals
davidschachterADFA 0ec489a
ADFA-7082: Read result sets as interrupted when the cancel lands whil…
davidschachterADFA 5fc4976
ADFA-7082: Address review of the sqlite-js cancel patches
davidschachterADFA b15fa5d
ADFA-7082: Vendor the sqlite-js 1.4.3 release, with no patches
davidschachterADFA d6e0d1a
style: spotless rewrap of the cancelAll() javadoc, no functional change
davidschachterADFA 0c2e603
ADFA-7082: Answer the independent review of the 1.4.3 move
davidschachterADFA f46e68e
ADFA-7082: Record the phone run of the 1.4.3 build
davidschachterADFA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Release sqlite-js AAR (manual) | ||
|
|
||
| # Publishes the sqlite-js AAR (subprojects/sqlite-js) to the moving sqlite-js-latest release, from | ||
| # which dev-assets fetches it into the template that uses it (ADFA-7082). | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: release-sqlite-js | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
|
|
||
| release-sqlite-js: | ||
| runs-on: self-hosted | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
| persist-credentials: false | ||
|
|
||
| - name: Check the vendored sqlite-js | ||
| run: subprojects/sqlite-js/vendor.sh --check | ||
|
|
||
| - name: Build the sqlite-js AAR | ||
| run: | | ||
| flox activate -d flox/base -- \ | ||
| ./gradlew --console=plain --no-daemon :subprojects:sqlite-js:createSqliteJsAar | ||
|
|
||
| - name: Stage sqlite-js release assets | ||
| run: | | ||
| mkdir -p .release | ||
| cp subprojects/sqlite-js/build/libs/sqlite-js.aar .release/sqlite-js.aar | ||
| ( cd .release && sha256sum sqlite-js.aar > checksums.txt ) | ||
| ls -la .release | ||
|
|
||
| # Once published, the release is updated in place, never deleted, so dev-assets can always | ||
| # fetch an AAR. If any step of the update fails, the previous assets (downloaded first) and | ||
| # tag are put back. | ||
| - name: Update sqlite-js-latest release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| shell: flox activate -d flox/base -- bash -eo pipefail {0} | ||
| run: | | ||
| TARGET_SHA="$(git rev-parse HEAD)" | ||
| NOTES="built from ${TARGET_SHA} on $(date -u +'%Y-%m-%d %H:%M:%S UTC')" | ||
| # gh release create makes a draft and publishes it once its assets are uploaded, so a first | ||
| # run that stopped during the upload leaves a draft. It has no tag yet and dev-assets cannot | ||
| # fetch from it: delete it, and create the release again. | ||
| if [ "$(gh release view sqlite-js-latest --json isDraft --jq .isDraft 2>/dev/null)" = true ]; then | ||
| gh release delete sqlite-js-latest --yes | ||
| fi | ||
| if ! gh release view sqlite-js-latest >/dev/null 2>&1; then | ||
| gh release create sqlite-js-latest \ | ||
| --target "$TARGET_SHA" \ | ||
| --latest=false \ | ||
| --title "sqlite-js AAR (latest)" \ | ||
| --notes "$NOTES" \ | ||
| .release/sqlite-js.aar \ | ||
| .release/checksums.txt | ||
| exit 0 | ||
| fi | ||
| TAG_REF="repos/${GITHUB_REPOSITORY}/git/refs/tags/sqlite-js-latest" | ||
| PREVIOUS_SHA="$(gh api "$TAG_REF" --jq .object.sha)" | ||
| mkdir -p .previous | ||
| # A run that stopped during an upload can leave an asset missing. Back up only the assets | ||
| # that exist: the upload below then replaces the missing ones, so running again repairs it. | ||
| PREVIOUS_ASSETS="$(gh release view sqlite-js-latest --json assets --jq '.assets[].name')" | ||
| for asset in sqlite-js.aar checksums.txt; do | ||
| if grep -qx "$asset" <<<"$PREVIOUS_ASSETS"; then | ||
| gh release download sqlite-js-latest --dir .previous --pattern "$asset" | ||
| fi | ||
| done | ||
| if ! { gh release upload sqlite-js-latest .release/sqlite-js.aar .release/checksums.txt --clobber && | ||
| gh api -X PATCH "$TAG_REF" -f sha="$TARGET_SHA" -F force=true >/dev/null && | ||
| gh release edit sqlite-js-latest --latest=false --notes "$NOTES"; }; then | ||
| echo "::error::updating sqlite-js-latest failed; putting back the previous assets and tag" | ||
| # each is attempted even if the other fails, since bash -e would stop at the first | ||
| if [ -f .previous/sqlite-js.aar ] && [ -f .previous/checksums.txt ]; then | ||
| gh release upload sqlite-js-latest .previous/sqlite-js.aar .previous/checksums.txt --clobber || | ||
| echo "::error::could not put back the previous assets" | ||
| else | ||
| echo "::error::the release lacked an asset before this run, so none are put back; run the workflow again" | ||
| fi | ||
| gh api -X PATCH "$TAG_REF" -f sha="$PREVIOUS_SHA" -F force=true >/dev/null || | ||
| echo "::error::could not put back the tag at $PREVIOUS_SHA" | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Test sqlite-js | ||
|
|
||
| # The tests the Android build cannot run (ADFA-7082): that upstream/ is the sqlite-js release with | ||
| # any patches/ applied, upstream's test suite on it, and the test of sqlitejs_android.c's entry | ||
| # points. See subprojects/sqlite-js/test.sh. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'subprojects/sqlite-js/**' | ||
| - '.github/workflows/test-sqlite-js.yml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
|
|
||
| test-sqlite-js: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Download sqlite-js | ||
| run: | | ||
| eval "$(grep -E '^(VERSION|URL)=' subprojects/sqlite-js/vendor.sh)" | ||
| curl -fsSL -o "$RUNNER_TEMP/sqlite-js.tar.gz" "$URL" | ||
|
|
||
| - name: Check the vendored sqlite-js | ||
| run: subprojects/sqlite-js/vendor.sh --check "$RUNNER_TEMP/sqlite-js.tar.gz" | ||
|
|
||
| - name: Run the sqlite-js tests | ||
| run: subprojects/sqlite-js/test.sh "$RUNNER_TEMP/sqlite-js.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.