Skip to content

fix: use cache dir for sol programs loading#52

Merged
ecPablo merged 5 commits into
mainfrom
ecpablo/use-cache-dir-for-sol-programs
May 11, 2026
Merged

fix: use cache dir for sol programs loading#52
ecPablo merged 5 commits into
mainfrom
ecpablo/use-cache-dir-for-sol-programs

Conversation

@ecPablo
Copy link
Copy Markdown
Contributor

@ecPablo ecPablo commented May 11, 2026

The previous implementations had issues in CI if the caller was in a folder with no write permissions. Now we use the os cache dir to make it safer for CI environments.

AI Summary

This pull request refactors how the Solana test utilities determine the cache directory for program artifacts, making the cache location more robust and ensuring it is always writable. It also adds a unit test to verify the new cache directory logic.

Refactor cache directory logic:

  • Replaces the old programsCachePath function with a new programsCacheDir function that uses the user's OS cache directory (or temp directory as fallback) for storing cached .so files, ensuring the path is always writable and avoids using pkg/mod when loaded as a Go module.
  • Updates references in downloadChainlinkCCIPProgramArtifacts to use the new programsCacheDir function.
  • Removes unnecessary imports and code related to the old cache path logic.

Testing improvements:

  • Adds a new test, TestProgramsCacheDir, to verify that the cache directory is absolute, ends with the expected path, and does not include pkg/mod.

@ecPablo ecPablo marked this pull request as ready for review May 11, 2026 16:42
@ecPablo ecPablo requested a review from a team as a code owner May 11, 2026 16:42
Copilot AI review requested due to automatic review settings May 11, 2026 16:42
Comment thread legacy/pkg/family/solana/testutils/artifacts.go Outdated

This comment was marked as resolved.

@ecPablo ecPablo requested a review from gustavogama-cll May 11, 2026 17:04
@ecPablo ecPablo enabled auto-merge (squash) May 11, 2026 17:04
Copilot AI review requested due to automatic review settings May 11, 2026 17:08

This comment was marked as resolved.

@ecPablo ecPablo merged commit b04f4d9 into main May 11, 2026
17 checks passed
@ecPablo ecPablo deleted the ecpablo/use-cache-dir-for-sol-programs branch May 11, 2026 17:17
ecPablo pushed a commit that referenced this pull request May 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.0](v0.3.0...v0.4.0)
(2026-05-18)


### Features

* add changeset and operation to delete CRE workflow
([#54](#54))
([f0e341a](f0e341a))
* add support for multiple api key to deploy workflow
([#55](#55))
([a68f156](a68f156))
* transfer native
([#56](#56))
([4368e49](4368e49))


### Bug Fixes

* use cache dir for sol programs loading
([#52](#52))
([b04f4d9](b04f4d9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: app-token-issuer-ops-platform[bot] <275822481+app-token-issuer-ops-platform[bot]@users.noreply.github.com>
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.

3 participants