Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Support for Buildless #2

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Feature: Add Support for Buildless #2

wants to merge 3 commits into from

Conversation

sgammon
Copy link
Member

@sgammon sgammon commented Nov 28, 2023

Summary

Draft PR which adds Buildless support to sccache. If this goes well, later, we can maybe upstream it.

Task list

  • Produce an initial release
  • Backend Support: Add Buildless as a supported sccache backend
    • Add configuration support for Buildless
    • Implement WebDAV via "generic cache" endpoints
    • Implement RESP (Redis) via Buildless Cloud edge
    • Implement detection of local Buildless Agent
    • Detect and enable with BUILDLESS_APIKEY
  • Docs: Documenting this integration for both sccache and Buildless
    • Add doc to sccache
    • Update sccache readme
    • Add Buildless docs for sccache integration
    • Add Buildless docs for sccache fork and feature
  • Testing: Testing new functionality added in this PR
    • Add CI integration tests for sccache + buildless cloud
    • Add CI integration tests for sccache + buildless agent
    • Add basic configuration unit tests
    • Add tests for env-variable detection and config
    • Add tests for local agent + sccache
    • Add tests for cloud edge + sccache
  • Embedded: Investigate embedding sccache in releases of the buildless CLI
    • License compatibility
    • Binary size / embedding
    • Invocation from GVM

Changelog

  • feat(buildless): add configuration structures for buildless
  • feat(buildless): implement cache backend for buildless, using webdav
  • feat(buildless): implement cache backend for buildless, using redis
  • feat(buildless): implement agent detection and use (where enabled)
  • feat(buildless): decode agent config and use specified port
  • fix(buildless): don't use control port for cache traffic
  • docs(buildless): add docs/Buildless and root README references

@sgammon sgammon added the enhancement New feature or request label Nov 28, 2023
@sgammon sgammon self-assigned this Nov 28, 2023
@sgammon sgammon changed the title feat(buildless): add support for buildless (https://less.build) Feature: Add Support for Buildless Nov 28, 2023
@@ -2,7 +2,7 @@
edition = "2021"
name = "sccache"
rust-version = "1.67.1"
version = "0.7.4"
version = "0.7.5-buildless"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

released under a custom version, for now

Cargo.toml Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
Comment on lines +180 to +182
BuildlessTransport::AUTO => build_https(do_use_agent, endpoint, apikey, &agent_config),
BuildlessTransport::HTTPS => build_https(do_use_agent, endpoint, apikey, &agent_config),
BuildlessTransport::RESP => build_resp(do_use_agent, endpoint, apikey),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transport selection

"gha",
"webdav",
]
azure = ["opendal", "reqsign"]
buildless = ["opendal", "redis", "webdav"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since buildless implements webdav and redis, this code simply reuses those adapters to reduce code surface

Comment on lines +740 to +741
// ======= Buildless =======
let buildless = if env::var("SCCACHE_BUILDLESS").is_ok() || env::var("BUILDLESS_APIKEY").is_ok()
{
// read kill switch
let enable_var = env::var("SCCACHE_BUILDLESS").ok().unwrap_or_default();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildless takes last precedence over all other adapters (except fallback to local disk), to prevent conflicts with providers which expect to fail with incomplete config.

Copy link

codecov bot commented Nov 28, 2023

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

- feat(buildless): add configuration structures for buildless
- feat(buildless): implement cache backend for buildless, using webdav
- feat(buildless): implement cache backend for buildless, using redis
- feat(buildless): implement agent detection and use (where enabled)
- feat(buildless): decode agent config and use specified port
- fix(buildless): don't use control port for cache traffic
- docs(buildless): add `docs/Buildless` and root README references

Signed-off-by: Sam Gammon <sam@elide.ventures>
- test(buildless): add integration test for `buildless-cloud`
- test(buildless); add integration test for `buildless-agent`

Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant