Commit Graph

66 Commits

Author SHA1 Message Date
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
eugene yokota b3aae681bf
Merge pull request #6711 from xuwei-k/fix-scala-2-13-warn
fix Scala 2.13 warnings
2021-11-14 21:53:57 -05:00
xuwei-k 535b15b83e fix Scala 2.13 warnings 2021-11-14 22:59:34 +09:00
xuwei-k aa8b1141f8 Update scalatest 2021-11-14 22:03:59 +09:00
João Ferreira dd411cac9f introduce a new new Input/Output: FileInput/FileOutput
* FileInput avoids the intermediate String parsing of PlainInput
* FileOuput also avoid the intermediate String representation of PlainOutput
2020-11-25 14:04:56 +00:00
Ethan Atkins c5f0ee0e59 Don't use last modified time of directories in doc
I noticed that sbt does a _lot_ of no-op docs in the sbt project.
Through some debugging, I determined that this was because the target
directory last modified time of some of the dependent projects would
change between runs. I'm not really sure why that was happening but
instead of computing the last modified time of the directory, we should
be checking the last modified time of the directory contents.

After this change a no-op `doc` in the sbt project returns in less than
one second on my mac. Before, it was more like 25-60 seconds (the upper
bound is one runs `doc` because `sbtRoot/doc` takes about a minute).
2020-01-13 13:11:09 -08:00
Ethan Atkins ad59e71b1a Add util headers
None of the util files had headers.
2019-12-08 10:29:22 -08:00
Alexey Vakhrenev c9e07b6010 fix FileHash equality 2019-08-29 18:03:00 +03:00
Ethan Atkins 7f112052bf Unbreak binary compatibility
We discovered in the community build that 1.3.0-RC4 breaks the
lucidchart scalafmt plugins. We can unbreak binary compatibility by
adding alternative classes.
2019-08-21 10:20:53 -07:00
James Roper 50b2ea6f83 Use byte arrays instead of lists of bytes in FileInfo
Fixes #206
2019-08-12 15:16:48 +10:00
Eugene Yokota 98ec0075f4 apply formatting 2019-04-20 23:23:13 -04:00
Eugene Yokota 7431dbdf1a throw error on deserialization error 2019-04-04 00:53:44 -04:00
Ethan Atkins 5b198b20be Add file FileInfo factory applys without io
It may be the case that the file property is already known and we can
avoid performing additional io by just passing in the value directly.
2019-02-05 10:00:27 -08:00
Jason Zaugg 65e2980e9d Avoid temporary string in JSON reading 2018-10-09 18:31:13 -04:00
Eugene Yokota cf0467609d -Xfatal-warnings 2018-09-19 22:46:38 -04:00
xuwei-k e97451d812 fix adapted argument warning
https://travis-ci.org/sbt/util/jobs/373445819#L517

```
[warn] /home/travis/build/sbt/util/util-cache/src/main/scala/sbt/util/Input.scala:19:23: No automatic adaptation here: use explicit parentheses.
[warn]         signature: Using.apply[R](src: Source)(f: T => R): R
[warn]   given arguments: input, IO.utf8
[warn]  after adaptation: Using((input, IO.utf8): (java.io.InputStream, java.nio.charset.Charset))
[warn]     Using.streamReader(input, IO.utf8) { reader =>
[warn]                       ^
```
2018-06-11 13:11:51 +09:00
Dale Wijnand 44a2f1d92c
Kill utilTesting
No need for a 1-line, 1-class jar
2018-02-23 18:16:30 +00:00