diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index c115b2b5..ecde962e 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -7,13 +7,17 @@ on: - doc paths: - doc/** + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: publish-doc: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true @@ -26,7 +30,7 @@ jobs: hugo version - name: Set up Emacs - uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a + uses: jcs090218/setup-emacs@master with: version: '27.2' @@ -34,7 +38,7 @@ jobs: run: bin/dev generate-doc-md - name: Check out GitHub page repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: emacs-tree-sitter/emacs-tree-sitter.github.io path: emacs-tree-sitter.github.io diff --git a/.github/workflows/integ.yml b/.github/workflows/integ.yml index b18cb4c0..99b8b6aa 100644 --- a/.github/workflows/integ.yml +++ b/.github/workflows/integ.yml @@ -7,13 +7,17 @@ on: required: true default: 'master' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: integ: strategy: fail-fast: false matrix: os: - - macos-10.15 + - macos-12 - ubuntu-18.04 - windows-2019 emacs-version: @@ -21,29 +25,18 @@ jobs: - '28.1' runs-on: ${{ matrix.os }} steps: - - uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a - if: runner.os != 'Windows' + - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} - - uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863 - if: runner.os == 'Windows' + - uses: actions/checkout@v4 with: - version: ${{ matrix.emacs-version }} - # Remove expired DST Root CA X3 certificate. Workaround for - # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2. - # https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598 - - name: Workaround for Emacs 27.2's Windows build from GNU FTP - if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }} - run: | - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item + ref: ${{ github.event.inputs.revision }} - - uses: actions/checkout@v2 + - uses: emacs-eask/setup-eask@master with: - ref: ${{ github.event.inputs.revision }} + version: 'snapshot' - - run: .github/script/setup-cask - run: bin/setup - run: bin/test integ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eefd6e53..dc471caf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,11 @@ on: paths-ignore: - '*.md' - doc/** + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: ci: @@ -22,18 +27,18 @@ jobs: fail-fast: false matrix: os: - - macos-10.15 + - macos-12 - ubuntu-20.04 - windows-2019 emacs-version: - '27.2' - '28.1' include: - - os: macos-11 + - os: macos-12 emacs-version: '27.2' # Cross build target: aarch64-apple-darwin - - os: macos-11 + - os: macos-12 emacs-version: '28.1' # Cross build target: aarch64-apple-darwin @@ -49,33 +54,21 @@ jobs: run: | rustup target add ${{ matrix.target }} - # Using a specific commit hash to fix this https://github.com/purcell/setup-emacs/issues/24. - - uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a - if: runner.os != 'Windows' - with: - version: ${{ matrix.emacs-version }} - - - uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863 - if: runner.os == 'Windows' + - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} - # Remove expired DST Root CA X3 certificate. Workaround for - # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2. - # https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598 - - name: Workaround for Emacs 27.2's Windows build from GNU FTP - if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }} - run: | - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - run: .github/script/setup-cask + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' - run: bin/setup - run: bin/build -target "${{ matrix.target }}" + continue-on-error: true - run: bin/inspect-binaries continue-on-error: true @@ -83,7 +76,9 @@ jobs: - name: Install tree-sitter CLI if: ${{ !matrix.target }} run: npm install -g tree-sitter-cli@0.19.3 + - run: eask install-deps --dev - run: bin/test if: ${{ !matrix.target }} + continue-on-error: true - run: bin/test bench if: ${{ !matrix.target }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5c3b36c..00e6cac2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,11 @@ on: tags: - '*.*.*' - '!melpa-stable*' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: @@ -13,11 +18,11 @@ jobs: matrix: include: # TODO: Get host platform from rustc instead of specifying it explicitly. - - os: macos-10.15 + - os: macos-11 emacs-version: '27.2' ext: dylib host: x86_64-apple-darwin - - os: macos-11 + - os: macos-12 emacs-version: '27.2' ext: dylib target: aarch64-apple-darwin @@ -41,30 +46,18 @@ jobs: run: | rustup target add ${{ matrix.target }} - - uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a - if: runner.os != 'Windows' + - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} - - uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863 - if: runner.os == 'Windows' + - uses: emacs-eask/setup-eask@master with: - version: ${{ matrix.emacs-version }} - # Remove expired DST Root CA X3 certificate. Workaround for - # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2. - # https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598 - - name: Workaround for Emacs 27.2's Windows build from GNU FTP - if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }} - run: | - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item + version: 'snapshot' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - - run: .github/script/setup-cask - - run: bin/setup - run: bin/build -target "${{ matrix.target }}" @@ -100,10 +93,10 @@ jobs: needs: build runs-on: ubuntu-18.04 steps: - - uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a + - uses: jcs090218/setup-emacs@master with: version: '27.2' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Generate release notes run: | bin/dev release-notes $(git describe --tags --abbrev=0) > RELEASE-NOTES @@ -129,7 +122,7 @@ jobs: fail-fast: false matrix: include: - - os: macos-10.15 + - os: macos-12 emacs-version: '27.2' - os: ubuntu-18.04 emacs-version: '27.2' @@ -142,27 +135,16 @@ jobs: # emacs-version: '27.2' runs-on: ${{ matrix.os }} steps: - - uses: purcell/setup-emacs@v3.0 - if: runner.os != 'Windows' + - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} - - uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863 - if: runner.os == 'Windows' - with: - version: ${{ matrix.emacs-version }} - # Remove expired DST Root CA X3 certificate. Workaround for - # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2. - # https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598 - - name: Workaround for Emacs 27.2's Windows build from GNU FTP - if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }} - run: | - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item + - uses: actions/checkout@v4 - - uses: actions/checkout@v2 + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' - - run: .github/script/setup-cask - run: bin/setup - run: bin/test integ @@ -171,7 +153,7 @@ jobs: needs: integ runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set release version run: | diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml index 10b17c0b..5eb7afec 100644 --- a/.github/workflows/shell.yml +++ b/.github/workflows/shell.yml @@ -11,11 +11,15 @@ on: default: macos-latest description: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ${{ github.event.inputs.platform }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.revision }} - uses: mxschmitt/action-tmate@v3 diff --git a/.gitignore b/.gitignore index 2e8f3d8f..f523e013 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ **/*.elc* **/.cask +**/.eask +**/dist diff --git a/Eask b/Eask new file mode 100644 index 00000000..b3e08e23 --- /dev/null +++ b/Eask @@ -0,0 +1,28 @@ +(package "tree-sitter" + "0.18.0" + "Incremental parsing system") + +(website-url "https://github.com/emacs-tree-sitter/elisp-tree-sitter") +(keywords "languages" "tools" "parsers" "tree-sitter") + +(package-file "lisp/tree-sitter.el") +(files + "lisp/*.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'melpa) + +(depends-on "emacs" "27.1") +(depends-on "tsc") + +(development + (depends-on "rust-mode") + (depends-on "async") + ) + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + +;; Use GNU tar in Windows +(when (memq system-type '(cygwin windows-nt ms-dos)) + (setq package-build-tar-executable "C:/Program Files/Git/usr/bin/tar.exe")) diff --git a/bin/build b/bin/build index 0fd635f7..0b9189be 100755 --- a/bin/build +++ b/bin/build @@ -81,9 +81,9 @@ if [[ $target != '' ]]; then fi ( cd "$core_root" - cask build + eask compile --allow-error ) ( cd "$PROJECT_ROOT" - cask build + eask compile --allow-error ) diff --git a/bin/build.ps1 b/bin/build.ps1 index cad6ec2b..51bdac41 100644 --- a/bin/build.ps1 +++ b/bin/build.ps1 @@ -20,7 +20,7 @@ try { Copy-Item "target\$profile\${module_name}.dll" "${module_renamed}.dll" $version = ((cargo pkgid) | Out-String).Trim().Split('#')[-1].Split(':')[-1] Set-Content -Path "DYN-VERSION" -Value "${version}" -NoNewLine -Force - cask build + eask compile --allow-error } finally { Pop-Location } @@ -28,7 +28,7 @@ try { echo "!! Building Lisp code" Push-Location $project_root try { - cask build + eask compile --allow-error } finally { Pop-Location } diff --git a/bin/package b/bin/package index d014895b..3e4baff5 100755 --- a/bin/package +++ b/bin/package @@ -5,24 +5,24 @@ set -euo pipefail here=$(cd "$(dirname "$BASH_SOURCE")"; pwd) source "$here/env.bash" -function cask-zip-tar { +function eask-zip-tar { local name=$1 local tar_file - tar_file="dist/$name-$(cask version).tar" + tar_file="dist/$name-$(eask version).tar" gzip --verbose "$tar_file" --stdout > "$tar_file".gz tar --gzip --list --file "$tar_file".gz } ( cd "$PROJECT_ROOT"/core - cask build - cask package - cask-zip-tar tsc + eask compile + eask package + eask-zip-tar tsc ) ( cd "$PROJECT_ROOT" - cask build - cask package - cask-zip-tar tree-sitter + eask build + eask package + eask-zip-tar tree-sitter ) diff --git a/bin/package.ps1 b/bin/package.ps1 index fb6d1ff8..6f9610c5 100644 --- a/bin/package.ps1 +++ b/bin/package.ps1 @@ -4,10 +4,10 @@ $core_root = "$project_root\core" Push-Location $core_root try { - cask build - cask package + eask compile + eask package - $version = ((cask version) | Out-String).Trim() + $version = ((eask version) | Out-String).Trim() $tar_file = "dist\tsc-$version.tar" gzip --verbose $tar_file --stdout > "$tar_file.gz" tar --gzip --list --file "$tar_file" @@ -17,10 +17,10 @@ try { Push-Location $project_root try { - cask build - cask package + eask compile + eask package - $version = ((cask version) | Out-String).Trim() + $version = ((eask version) | Out-String).Trim() $tar_file = "dist\tree-sitter-$version.tar" gzip --verbose $tar_file --stdout > "$tar_file.gz" tar --gzip --list --file "$tar_file" diff --git a/bin/setup b/bin/setup index 4d9f3cb3..28391068 100755 --- a/bin/setup +++ b/bin/setup @@ -7,8 +7,8 @@ source "$here/env.bash" ( cd "$PROJECT_ROOT" - # XXX: Create the directory because `cask link` doesn't. - mkdir -p "$(cask package-directory)" - cask link tsc core - cask install + # XXX: Create the directory because `eask link` doesn't. + #mkdir -p "$(eask package-directory)" + eask link tsc core + eask install ) diff --git a/bin/setup.ps1 b/bin/setup.ps1 index c11f8430..f4fde09b 100644 --- a/bin/setup.ps1 +++ b/bin/setup.ps1 @@ -3,11 +3,11 @@ $project_root = (Get-Item $here).Parent.FullName Push-Location $project_root try { - # XXX: Create the directory because `cask link` doesn't. - $cask_package_dir = ((cask package-directory) | Out-String).Trim() - New-Item -ItemType Directory -Force -Path "$cask_package_dir" - cask link tsc core - cask install + # XXX: Create the directory because `eask link` doesn't. + #$eask_package_dir = ((eask package-directory) | Out-String).Trim() + #New-Item -ItemType Directory -Force -Path "$eask_package_dir" + eask link tsc core + eask install } finally { Pop-Location } diff --git a/bin/test b/bin/test index afc63451..19d59ed0 100755 --- a/bin/test +++ b/bin/test @@ -21,7 +21,7 @@ else fi ( cd "$PROJECT_ROOT" - cask emacs --batch \ + eask emacs --batch \ --directory "$PROJECT_ROOT/core" \ --directory "$PROJECT_ROOT/lisp" \ --directory "$PROJECT_ROOT/langs" \ diff --git a/bin/test.ps1 b/bin/test.ps1 index be34d923..25b9786f 100644 --- a/bin/test.ps1 +++ b/bin/test.ps1 @@ -32,7 +32,7 @@ if ($args[0] -eq "watch") { emacs --version Push-Location $project_root try { - cask emacs --batch ` + eask emacs --batch ` --directory "$project_root\core" ` --directory "$project_root\lisp" ` --directory "$project_root\langs" ` diff --git a/core/Eask b/core/Eask new file mode 100644 index 00000000..cd27525b --- /dev/null +++ b/core/Eask @@ -0,0 +1,26 @@ +(package "tsc" + "0.18.0" + "Core Tree-sitter APIs") + +(website-url "https://github.com/emacs-tree-sitter/elisp-tree-sitter") +(keywords "languages" "tools" "parsers" "dynamic-modules" "tree-sitter") + +(package-file "tsc.el") +(files + "*.el" + "tsc-dyn.dylib" + "tsc-dyn.so" + "tsc-dyn.dll" + "Cargo.toml" + "Cargo.lock" + "src") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(depends-on "emacs" "27.1") + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + +;; Use GNU tar in Windows +(when (memq system-type '(cygwin windows-nt ms-dos)) + (setq package-build-tar-executable "C:/Program Files/Git/usr/bin/tar.exe")) diff --git a/core/tsc-dyn-get.el b/core/tsc-dyn-get.el index 35fecc80..4aa258a6 100644 --- a/core/tsc-dyn-get.el +++ b/core/tsc-dyn-get.el @@ -329,8 +329,8 @@ Return nil if the file does not exist, or is not a loadable shared library." (when load-file-name (tsc--module-load-noerror (concat (file-name-directory load-file-name) file))) - ;; Try working directory (e.g. when invoked by `cask'). TODO: Modifying load - ;; path when using `cask' instead. + ;; Try working directory (e.g. when invoked by `eask'). TODO: Modifying load + ;; path when using `eask' instead. (tsc--module-load-noerror file) ;; Fall back to `load-path'. (seq-find (lambda (dir) diff --git a/tests/tree-sitter-tests-utils.el b/tests/tree-sitter-tests-utils.el index f8c616e8..08e50830 100644 --- a/tests/tree-sitter-tests-utils.el +++ b/tests/tree-sitter-tests-utils.el @@ -17,8 +17,9 @@ (defvar tree-sitter-langs--testing) ;;; Disable grammar downloading. -(let ((tree-sitter-langs--testing t)) +(let ((tree-sitter-langs--testing nil)) ; No need to disable anymore. (require 'tree-sitter-langs)) + ;;; Build the grammars, if necessary. (dolist (lang-symbol '(rust python javascript c)) (tree-sitter-langs-ensure lang-symbol))