Using j4rs in Github Actions
This is most likely not a bug in j4rs, however I'm wondering what can be done to solve this.
Using the default actions-rust-lang/setup-rust-toolchain@v1 github action provides a caching layer which significantly improves the speed of subsequent Github Action runs. This caching is enabled by default
It seems that the jassets folder is not included in this cache. However, this does not trigger a rebuild of the crate. Therefor I'm seeing this error on subsequent runs of CI:
called `Result::unwrap()` on an `Err` value: GeneralError("Can not find jassets directory")
There are 2 approaches here:
- Force a rebuild of
j4rsif thejassetsfolder is not found - Manually include the
jassetsfolder in caching.
This has been a pain to debug, so at least this issue will help someone else trying to figure out why their CI is failing. But only after the 2nd run.
The relevant caching action https://github.com/Swatinem/rust-cache
I believe a good solution would be a small improvement in the j4rs build script, to use the rerun-if-env-changed instruction.
This way, we could force j4rs rebuilding on demand. You could have on your Github action something like:
export J4RS_FORCE_BUILD=$(date)
and the j4rs would be rebuilt and the jassets folder would be recreated.
How does this sound to you?
Please, give it a try using the master and let me know.
That sounds excellent
On Fri, Dec 12, 2025 at 4:02 AM aston @.***> wrote:
astonbitecode left a comment (astonbitecode/j4rs#156) https://github.com/astonbitecode/j4rs/issues/156#issuecomment-3645568281
Please, give it a try using the master and let me know.
— Reply to this email directly, view it on GitHub https://github.com/astonbitecode/j4rs/issues/156#issuecomment-3645568281, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASDJ626N3L2L5V7CI2GPUHT4BKADLAVCNFSM6AAAAACOT3J2FGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNBVGU3DQMRYGE . You are receiving this because you authored the thread.Message ID: @.***>