Skip to content

Commit

Permalink
deps src: Automatic update
Browse files Browse the repository at this point in the history
  • Loading branch information
marvim committed Dec 16, 2024
1 parent 151a855 commit dec7811
Show file tree
Hide file tree
Showing 73 changed files with 1,469 additions and 1,563 deletions.
30 changes: 15 additions & 15 deletions src/treesitter-stamp/download-treesitter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ function(check_file_hash has_hash hash_is_good)
set("${has_hash}" TRUE PARENT_SCOPE)

message(VERBOSE "verifying file...
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'")
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz'")

file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz" actual_value)
file("SHA256" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz" actual_value)

if(NOT "${actual_value}" STREQUAL "61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4")
if(NOT "${actual_value}" STREQUAL "b5ac48acf5a04fd82ccd4246ad46354d9c434be26c9606233917549711e4252c")
set("${hash_is_good}" FALSE PARENT_SCOPE)
message(VERBOSE "SHA256 hash of
/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz
/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz
does not match expected value
expected: '61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4'
expected: 'b5ac48acf5a04fd82ccd4246ad46354d9c434be26c9606233917549711e4252c'
actual: '${actual_value}'")
else()
set("${hash_is_good}" TRUE PARENT_SCOPE)
Expand Down Expand Up @@ -71,32 +71,32 @@ function(sleep_before_download attempt)
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
endfunction()

if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
if(EXISTS "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz")
check_file_hash(has_hash hash_is_good)
if(has_hash)
if(hash_is_good)
message(VERBOSE "File already exists and hash match (skip download):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
SHA256='61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4'"
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz'
SHA256='b5ac48acf5a04fd82ccd4246ad46354d9c434be26c9606233917549711e4252c'"
)
return()
else()
message(VERBOSE "File already exists but hash mismatch. Removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz")
endif()
else()
message(VERBOSE "File already exists but no hash specified (use URL_HASH):
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
file='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz'
Old file will be removed and new file downloaded from URL."
)
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz")
endif()
endif()

set(retry_number 5)

message(VERBOSE "Downloading...
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz'
dst='/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz'
timeout='none'
inactivity timeout='none'"
)
Expand All @@ -107,7 +107,7 @@ foreach(i RANGE ${retry_number})
if(status_code IN_LIST download_retry_codes)
sleep_before_download(${i})
endif()
foreach(url IN ITEMS [====[https://github.com/tree-sitter/tree-sitter/archive/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz]====])
foreach(url IN ITEMS [====[https://github.com/tree-sitter/tree-sitter/archive/v0.24.5.tar.gz]====])
if(NOT url IN_LIST skip_url_list)
message(VERBOSE "Using src='${url}'")

Expand All @@ -119,7 +119,7 @@ foreach(i RANGE ${retry_number})

file(
DOWNLOAD
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz"
"${url}" "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz"

# no TIMEOUT
# no INACTIVITY_TIMEOUT
Expand All @@ -136,7 +136,7 @@ foreach(i RANGE ${retry_number})
check_file_hash(has_hash hash_is_good)
if(has_hash AND NOT hash_is_good)
message(VERBOSE "Hash mismatch, removing...")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz")
file(REMOVE "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz")
else()
message(VERBOSE "Downloading... done")
return()
Expand Down
2 changes: 1 addition & 1 deletion src/treesitter-stamp/extract-treesitter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake

# Make file names absolute:
#
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz" ABSOLUTE)
get_filename_component(filename "/home/runner/work/deps/deps/neovim/deps/build/downloads/treesitter/v0.24.5.tar.gz" ABSOLUTE)
get_filename_component(directory "/home/runner/work/deps/deps/neovim/deps/build/src/treesitter" ABSOLUTE)

message(VERBOSE "extracting...
Expand Down
4 changes: 2 additions & 2 deletions src/treesitter-stamp/treesitter-urlinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ method=url
command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/download-treesitter.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/verify-treesitter.cmake;COMMAND;/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/deps/deps/neovim/deps/build/src/treesitter-stamp/extract-treesitter.cmake
source_dir=/home/runner/work/deps/deps/neovim/deps/build/src/treesitter
work_dir=/home/runner/work/deps/deps/neovim/deps/build/src
url(s)=https://github.com/tree-sitter/tree-sitter/archive/e3c82633389256ccc2c5ab2e509046cbf20453d3.tar.gz
hash=SHA256=61a21f5d83cfe256472bfa941123a6941fb45073784ee7ec0bc32fdd52f7a4e4
url(s)=https://github.com/tree-sitter/tree-sitter/archive/v0.24.5.tar.gz
hash=SHA256=b5ac48acf5a04fd82ccd4246ad46354d9c434be26c9606233917549711e4252c
no_extract=

23 changes: 11 additions & 12 deletions src/treesitter/.github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
name: 'Cache'
description: "This action caches fixtures"
name: Cache

description: This action caches fixtures

outputs:
cache-hit:
description: 'Cache hit'
value: ${{ steps.cache_output.outputs.cache-hit }}
description: Cache hit
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
using: composite
steps:
- uses: actions/cache@v4
id: cache_fixtures
id: cache
with:
path: |
test/fixtures/grammars
target/release/tree-sitter-*.wasm
key: fixtures-${{ join(matrix.*, '_') }}-${{ hashFiles(
'cli/src/generate/**',
'script/generate-fixtures*',
'cli/generate/src/**',
'xtask/src/*',
'test/fixtures/grammars/*/**/src/*.c',
'.github/actions/cache/action.yml') }}

- run: echo "cache-hit=${{ steps.cache_fixtures.outputs.cache-hit }}" >> $GITHUB_OUTPUT
shell: bash
id: cache_output
18 changes: 2 additions & 16 deletions src/treesitter/.github/scripts/cross.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#!/bin/bash
#!/bin/bash -eu

# set -x
set -e

if [ "$BUILD_CMD" != "cross" ]; then
echo "cross.sh - is a helper to assist only in cross compiling environments" >&2
echo "To use this tool set the BUILD_CMD env var to the \"cross\" value" >&2
exit 111
fi

if [ -z "$CROSS_IMAGE" ]; then
echo "The CROSS_IMAGE env var should be provided" >&2
exit 111
fi

docker run --rm -v /home/runner:/home/runner -w "$PWD" "$CROSS_IMAGE" "$@"
exec docker run --rm -v /home/runner:/home/runner -w "$PWD" "$CROSS_IMAGE" "$@"
20 changes: 5 additions & 15 deletions src/treesitter/.github/scripts/make.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
#!/bin/bash
#!/bin/bash -eu

# set -x
set -e
tree_sitter="$ROOT"/target/"$TARGET"/release/tree-sitter

if [ "$BUILD_CMD" == "cross" ]; then
if [ -z "$CC" ]; then
echo "make.sh: CC is not set" >&2
exit 111
fi
if [ -z "$AR" ]; then
echo "make.sh: AR is not set" >&2
exit 111
fi

cross.sh make CC=$CC AR=$AR "$@"
if [[ $BUILD_CMD == cross ]]; then
cross.sh make CC="$CC" AR="$AR" "$@"
else
make "$@"
exec make "$@"
fi
27 changes: 4 additions & 23 deletions src/treesitter/.github/scripts/tree-sitter.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
#!/bin/bash

# set -x
set -e

if [ -z "$ROOT" ]; then
echo "The ROOT env var should be set to absolute path of a repo root folder" >&2
exit 111
fi

if [ -z "$TARGET" ]; then
echo "The TARGET env var should be equal to a \`cargo build --target <TARGET>\` command value" >&2
exit 111
fi
#!/bin/bash -eu

tree_sitter="$ROOT"/target/"$TARGET"/release/tree-sitter

if [ "$BUILD_CMD" == "cross" ]; then
if [ -z "$CROSS_RUNNER" ]; then
echo "The CROSS_RUNNER env var should be set to a CARGO_TARGET_*_RUNNER env var value" >&2
echo "that is available in a docker image used by the cross tool under the hood" >&2
exit 111
fi

cross.sh $CROSS_RUNNER "$tree_sitter" "$@"
if [[ $BUILD_CMD == cross ]]; then
cross.sh "$CROSS_RUNNER" "$tree_sitter" "$@"
else
"$tree_sitter" "$@"
exec "$tree_sitter" "$@"
fi
19 changes: 11 additions & 8 deletions src/treesitter/.github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
name: backport
name: Backport Pull Request

on:
pull_request_target:
types: [closed, labeled]

permissions:
contents: write
pull-requests: write

jobs:
backport:
permissions:
contents: write
pull-requests: write
name: Backport Pull Request
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/create-github-app-token@v1
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.BACKPORT_APP }}
private-key: ${{ secrets.BACKPORT_KEY }}

- name: Create backport PR
id: backport
uses: korthout/backport-action@v3
with:
pull_title: "${pull_title}"
Expand Down
Loading

0 comments on commit dec7811

Please sign in to comment.