turbo icon indicating copy to clipboard operation
turbo copied to clipboard

Caching, but to tar files.

Open nathanhammond opened this issue 3 years ago • 3 comments

So it's a bit more visible, here's the portion of the underlying cache work focused on tar file creation.

nathanhammond avatar Sep 17 '22 04:09 nathanhammond

@nathanhammond is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 17 '22 04:09 vercel[bot]

General comment, and not a blocker on this, but using AbsoluteSystemPath is causing us to lose a lot of the type safety we might otherwise get. Calls to things like os.Open are going to be hard to track down in the future. We can't just search for .ToString(), since that also covers places where we do in fact want the string value, rather just as a means to get to the filesystem. Maybe in the meantime duplicate some of the fs wrappers from AbsolutePath?

gsoltis avatar Sep 20 '22 21:09 gsoltis

General comment, and not a blocker on this, but using AbsoluteSystemPath is causing us to lose a lot of the type safety we might otherwise get. Calls to things like os.Open are going to be hard to track down in the future. We can't just search for .ToString(), since that also covers places where we do in fact want the string value, rather just as a means to get to the filesystem. Maybe in the meantime duplicate some of the fs wrappers from AbsolutePath?

#2026 sets me up to address this. I'll note that there is a large chunk of this that is intentionally working with strings because we don't actually know anything about the input.

Here are some examples of UnsafeJoins in the existing tar behavior:

  • https://github.com/vercel/turborepo/blob/8928b11306b42a0a31cb76b5560f7df014ee31dc/cli/internal/cache/cache_http.go#L254
  • https://github.com/vercel/turborepo/blob/8928b11306b42a0a31cb76b5560f7df014ee31dc/cli/internal/cache/cache_http.go#L295
  • https://github.com/vercel/turborepo/blob/8928b11306b42a0a31cb76b5560f7df014ee31dc/cli/internal/cache/cache_http.go#L301

nathanhammond avatar Sep 21 '22 08:09 nathanhammond

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
turbo-site ✅ Ready (Inspect) Visit Preview Oct 6, 2022 at 5:53PM (UTC)

vercel[bot] avatar Sep 28 '22 17:09 vercel[bot]

Lint error is a formatting issue with a comment. Going to force-merge if everything else passes and then submit a separate PR to fix it (or ignore it?)

gsoltis avatar Oct 06 '22 17:10 gsoltis