Commit Graph

82 Commits

Author SHA1 Message Date
xuwei-k 708fffa290 delete unused "internal" package code 2025-09-06 19:41:12 +09:00
Eugene Yokota 353ee59cdb fix: Workaround syncFile issue
**Problem**
We get non-deterministic NoSuchFileException.

**Solution**
Catch the exception.
2025-08-21 08:13:49 +02:00
Eugene Yokota be5152dbfb sjson-new 0.14.0-M4 2025-08-15 22:12:06 -04:00
Eugene Yokota 6a7b56a645 Default to cached task
This flips the default `:=` operation to the cached task.
To opt out of the cache, use `Def.uncached(...)` or
mark the key with `@cacheLevel(include = Array.empty)`
2025-06-21 08:54:51 +09:00
Eugene Yokota 3b4547718e Remove deprecated methods 2025-05-11 05:23:41 -04:00
Eugene Yokota 967ecb49bc deps: Scala 3.7.0 2025-05-11 01:30:07 -04:00
xuwei-k fa6daec812 remove unused imports 2025-05-09 16:46:48 +09:00
eugene yokota 4c0ab346a7
Merge pull request #8101 from eed3si9n/wip/scalacoptions
[2.x] Scala compiler plugin support
2025-05-04 01:25:35 -04:00
Eugene Yokota d10e5b6f48 Add test for cache hits 2025-05-02 03:23:29 -04:00
Eugene Yokota 537359eb9b fix: Fix action cache
**Problem**
Action cache is capturing absolute path.

**Solution**
Use virtial path.
2025-04-28 03:16:18 -04:00
xuwei-k 5d660ab8b5 remove unnecessary `case`
- 3ca3633505/rules/src/main/scala/fix/RemoveParameterUntuplingCase.scala
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling.html
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling-spec.html
2025-02-22 08:48:29 +09:00
xuwei-k da26f3078b use withFilter instead of filter 2025-01-04 09:10:36 +09:00
xuwei-k 13d6626564 update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
xuwei-k d7ec1013da remove unused type params 2025-01-01 18:42:59 +09:00
xuwei-k 2167a72ac3 correspond file name and class name 2025-01-01 16:12:30 +09:00
Eugene Yokota 799bd65ba5 fix: Retry create directory
**Problem**
Files.createDirectories can fail.

**Solution**
Use IO version, which retries.
2024-12-29 03:18:18 -05:00
xuwei-k f11d9d76f0 remove more implicit. use given and using 2024-11-18 14:39:00 +09:00
xuwei-k d193c990d1 remove implicit params. change to using 2024-11-18 06:49:22 +09:00
xuwei-k c5b7038f3a use `given` instead of `implicit val` 2024-11-17 17:35:23 +09:00
Eugene Yokota 56941dac04 refactor: Update Scala 3 syntax 2024-10-27 23:55:30 -04:00
Eugene Yokota 14f7d29afc Contraband 0.7.0 2024-10-27 16:21:18 -04:00
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00
Adrien Piquerez f08f272d23 [2.x] Fix scripted cache tests 2024-09-18 10:28:11 +02:00
eugene yokota 2cb36bcaa8
[2.x] fix: fallback to file copy (#7668)
**Problem**
Disk cache currently uses symbolic links, which won't
work on Windows without the Administrator privileges or
Developer Mode.

**Solution**
This falls back to using file copy.
2024-09-15 13:03:07 -04:00
Eugene Yokota 291778086d findActionResult can return Either 2024-09-12 02:01:28 -04:00
Eugene Yokota 2aba06bb90 Refactor ActionCache to split into smaller functions 2024-09-08 14:42:24 -04:00
Eugene Yokota 721f202ae5 Hermetic incremental test
**Problem**
Current implementation of testQuick depends on the concept of timestamp,
which probably won't work well with the new consistent analysis store or
the idea of remote caching.

**Solution**
This is a step towards cached testing by making the incrementality hermetic
(no longer depends on the timestamp). Instead this calculates the aggregated
SHA-256 of the class files involved in the test.
2024-09-08 12:50:45 -04:00
Eugene Yokota d6a65d71e0 Set dirzip to 2010 timestamp 2024-08-21 02:43:36 -04:00
Eugene Yokota c9e5924b09 Implement on after sync event
When the disk cache syncs dirzip file, it compares the
item hashes against the existing files, and synchronizes them
using the disk cache.
2024-08-18 12:57:29 -04:00
Eugene Yokota 987ab5f214 Add Def.declareOutputDirectory function 2024-08-18 12:57:29 -04:00
Eugene Yokota c8ddbaed0e Implement InternalActionResult 2024-08-18 12:57:29 -04:00
Eugene Yokota fbd1fb8398 Check the digest during sync
**Problem**
Currently `syncBlobs` delete the existing files in the out directory when remote cache kicks in.

**Solution**
1. This refactors `Digest(...)` and adds support for `Digest.apply(Path)` and `Digest.sameDigest(...)`
2. This uses the `sameDigest` to compare the digest and replace the existing out files only when it needs to
2024-08-13 02:39:12 -04:00
Eugene Yokota c81d269ed2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-05-07 04:39:25 -04:00
Adrien Piquerez 2e439cab1e [2.x] report cache errors
Report a cache error if the output file of a task is not cacheable
2024-04-24 10:41:56 +02:00
Adrien Piquerez 7c51ba2f64 Revert "Use fileConverter in cacheStore" 2024-04-17 09:30:44 +02:00
Adrien Piquerez 1765fde1ba Revert "Fix ActionCacheTest"
This reverts commit 763383cadb.
2024-04-17 09:01:29 +02:00
Adrien Piquerez 763383cadb Fix ActionCacheTest 2024-04-15 10:30:38 +02:00
eugene yokota 9bc0ba5f5b Update util-cache/src/main/scala/sbt/util/ActionCacheStore.scala
Co-authored-by: adpi2 <adrien.piquerez@gmail.com>
2024-04-14 14:58:13 -04:00
Eugene Yokota 86cf7c3a0c Remote caching support
This implements Bazel-compat remote caching support via a plugin.
2024-04-11 13:55:29 +02:00
Adrien Piquerez eda67a05fc Use fileConverter in cacheStore
Otherwise the store cannot sync files that are not in the out folder.
2024-04-09 16:09:44 +02:00
Adrien Piquerez 85fcb014f0 Fix data race to remote cache on classpath analyses
The attributed classpath should point to the existing analysis file in the target folder to avoid data racing to the remote cache.
2024-04-08 16:34:18 +02:00
Adrien Piquerez 12e9267e1e Remove more unused 2024-03-05 15:25:25 +01:00
eugene yokota ecca26175e
[sbt 2.x] remote cache (#7464)
For the details about this PR, please see the blog post https://eed3si9n.com/sbt-remote-cache/.

* Add cache basics
* Refactor Attributed to use StringAttributeMap, which is Map[StringAttributeKey, String]
* Implement disk cache
* Rename Package to Pkg
* Virtualize packageBin
* Use HashedVirtualFileRef for packageBin
* Virtualize compile task
2024-02-07 10:34:06 -05:00
Eugene Yokota 81660b6734 Fix FileInfo 2023-11-27 01:54:03 -05:00
Adrien Piquerez eba41fb3b0 Fix util-cache cross-compilation 2023-11-14 11:45:09 +01:00
Julien Richard-Foy 72bfb3f45a Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
Eugene Yokota 340721c4a1 KeyMacro 2023-01-15 23:43:57 -05:00
Eugene Yokota 202cd92f0f Port main-actions 2023-01-15 23:43:19 -05:00
Eugene Yokota 1b42f40508 Port util-cache 2023-01-15 23:40:57 -05:00
Eugene Yokota 50b062b795 Port util-logging 2023-01-15 23:40:57 -05:00