Skip to content

Improve network reliability and headers in build utilities#132

Merged
bonede merged 3 commits intobonede:mainfrom
DavidBakerEffendi:dave/fix-ci
Feb 27, 2026
Merged

Improve network reliability and headers in build utilities#132
bonede merged 3 commits intobonede:mainfrom
DavidBakerEffendi:dave/fix-ci

Conversation

@DavidBakerEffendi
Copy link
Contributor

Focusing on helping fix the failing/flaky CI/CD, this PR enhances the network reliability and compatibility of the build script's file downloading and fetching utilities.

Key changes include:

  • Added User-Agent and Accept headers to HTTP requests to prevent connection rejection by servers that require standard browser identifiers.
  • Implemented connection and read timeouts (30 seconds) to prevent the build process from hanging indefinitely during network instability.
  • Improved resource management by using withCloseable in downloadFile to ensure input streams are properly released.
  • Updated downloadFile signatures to support a configurable Accept header, defaulting to application/zip.

These modifications ensure a more robust build process, especially when fetching grammar files or dependencies from external repositories.

@DavidBakerEffendi
Copy link
Contributor Author

Seems windows is giving an issue on Scala again. Looking into this now...

@DavidBakerEffendi
Copy link
Contributor Author

Seems windows is giving an issue on Scala again. Looking into this now...

The build failure on Windows is caused by a java.nio.file.AccessDeniedException when NativeUtils.loadLib attempts to overwrite an existing native library (.dll) that is currently locked by a running process (likely the Gradle Daemon or another test thread).

On Windows, loaded DLLs cannot be deleted or overwritten. When NativeUtils detects a CRC mismatch (e.g., after a rebuild), it attempts to update the cached DLL in ~/.tree-sitter/ using Files.move, which fails if the file is locked.

This error is similar to the following issue #61, and I'll push a PR addressing a fix n NativeUtils.loadLib directly. This PR might still help the failing ubuntu test cases, e.g,. https://github.com/bonede/tree-sitter-ng/actions/runs/22436212535/job/64966595235?pr=131

@bonede bonede merged commit 5712bb3 into bonede:main Feb 27, 2026
2 of 4 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/fix-ci branch February 27, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants