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

[Deepin Integration]~[V23-Beta3] feat: update sccache to 0.8.2-2 by deepin-community-bot[bot]@deepin-community/sccache by deepin-community-ci-bot[bot] #10861

Closed
deepin-bot bot opened this issue Nov 8, 2024 · 5 comments
Assignees
Labels
Project:integrated 集成管理相关 吴波 吴波
Milestone

Comments

@deepin-bot
Copy link

deepin-bot bot commented Nov 8, 2024

Package information | 软件包信息

包名 版本
sccache 0.8.2-2

Package repository address | 软件包仓库地址

deb [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/CI:/TestingIntegration:/test-integration-pr-2083:/community/testing/ ./

Changelog | 更新信息

sccache (0.8.2-2) unstable; urgency=medium

  • update and rename patch 2001_itertools -> 1004_itertools;
    tighten build-dependency for crate itertools
  • add patch cherry-picked upstream
    to fix cache collision between object file and precompiled headers
  • add patch 1004_env_logger
    to accept newer branch of crate env_logger;
    bump build-dependency for crate env_logger;
    closes: bug#1084849, thanks to Matthias Geiger
  • add patch 1004_base64
    to accept newer branch of crate base64;
    bump build-depenency for crate base64;
    closes: bug#1084518, thanks to Matthias Geigeri
@deepin-bot deepin-bot bot added the Project:integrated 集成管理相关 label Nov 8, 2024
@deepin-bot deepin-bot bot added this to the V23-Beta3 milestone Nov 8, 2024
@deepin-bot deepin-bot bot moved this to In progress in v23-集成管理 Nov 8, 2024
@deepin-bot
Copy link
Author

deepin-bot bot commented Nov 8, 2024

Integration Test Info

Test suggestion | 测试建议

sccache 是一种编译缓存工具,旨在加速 C/C++ 编译过程。它的工作原理类似于 ccache,但 sccache 是专门为分布式环境设计的,提供远程缓存功能。sccache 最初由 Mozilla 开发,广泛应用于需要频繁编译的项目中,比如 Firefox,它支持通过缓存和复用编译结果来减少重新编译相同文件的时间。

sccache 的主要特点

  1. 分布式缓存:支持分布式缓存,缓存可以存储在本地磁盘、S3 兼容存储、Redis 等远程存储中。
  2. 多语言支持:支持 C、C++、Rust 编译,能缓存 gccclangrustc 等编译器的输出。
  3. 高性能:相比 ccachesccache 针对大规模项目进行了性能优化,支持并行和远程缓存。

安装 sccache

可以通过以下几种方式安装 sccache

1. 通过包管理器安装

某些发行版提供了 sccache 包,可以直接使用包管理器安装,例如在 Arch Linux 上:

sudo pacman -S sccache

2. 使用 Rust 安装

scache 是用 Rust 编写的,可以使用 Rust 包管理器 cargo 安装:

cargo install sccache

注意:安装 cargo 后才能使用该命令。可以通过包管理器安装 rustcargo

3. 从源码编译

如果想要自定义 sccache,可以从源码构建:

git clone https://github.com/mozilla/sccache
cd sccache
cargo build --release
# 二进制文件位于 target/release/sccache
sudo cp target/release/sccache /usr/local/bin/

配置 sccache

安装后,将 sccache 设置为默认编译器缓存工具:

export RUSTC_WRAPPER=$(which sccache)
export SCCACHE_CACHE_SIZE="5G" # 设置缓存大小

设置编译器别名

可以通过别名或替换 CCCXX 编译器变量,使 sccache 成为默认编译缓存。例如:

export CC="sccache gcc"
export CXX="sccache g++"

这样,sccache 会在调用 gccg++ 时缓存编译结果。

常用配置环境变量

  • SCCACHE_CACHE_SIZE:设置缓存大小(例如 5G)。
  • SCCACHE_DIR:指定缓存存储路径,默认是 ~/.cache/sccache
  • SCCACHE_BUCKET:用于 S3 存储的桶名称。
  • SCCACHE_REDIS:用于 Redis 缓存的 URL,格式为 redis://host:port/.

检查缓存状态

可以通过以下命令查看缓存状态:

sccache --show-stats

该命令会输出缓存命中率、已用空间等信息,帮助你了解 sccache 的缓存效果。

在 CI/CD 中使用 sccache

scache 非常适合在 CI/CD 系统中使用,能加速重复构建的过程。可以将缓存目录挂载到共享存储上,或者使用 Redis/S3 作为远程缓存存储,提高 CI 构建速度。

总结

sccache 是一个灵活且高效的编译缓存工具,适用于加速 C、C++、Rust 等项目的编译过程。尤其是在需要频繁编译和持续集成的场景中,sccache 提供了显著的性能提升。

Influence | 影响范围

ADDITIONAL INFORMATION | 额外补充

@deepin-bot
Copy link
Author

deepin-bot bot commented Nov 8, 2024

IntegrationProjector Notify the author
@deepin: Integrated issue updated

@deepin-bot
Copy link
Author

deepin-bot bot commented Nov 8, 2024

IntegrationProjector Bot
Deepin Testing Integration Project Manager Info
Link to deepin-community/Repository-Integration#2083

@Zeno-sole Zeno-sole assigned babyfengfjx and unassigned Zeno-sole and hudeng-go Nov 8, 2024
@babyfengfjx babyfengfjx assigned kobe337 and unassigned babyfengfjx Nov 8, 2024
@babyfengfjx babyfengfjx moved this from In progress to 测试中 in v23-集成管理 Nov 8, 2024
@babyfengfjx babyfengfjx added the 吴波 吴波 label Nov 8, 2024
@babyfengfjx
Copy link

@kobe337 请开展集成验证。

@kobe337
Copy link

kobe337 commented Nov 8, 2024

【环境】:
镜像:Deepin OS-25-20241107064136-1_x86_64
内核:Linux deepin-PC 6.6.52-amd64-desktop-hwe #23.01.00.38 SMP PREEMPT_DYNAMIC Tue Sep 24 17:30:32 CST 2024 x86_64 GNU/Linux

【结论】:
测试通过,暂无严重问题及影响,安装校验,版本核对, 启动/停止 sccache 服务,检查 sccache 的缓存状态, 验证通过,请研发同事确认是否推送内测。
Image

@kobe337 kobe337 assigned Zeno-sole and unassigned kobe337 Nov 8, 2024
@kobe337 kobe337 moved this from 测试中 to 测试通过 in v23-集成管理 Nov 8, 2024
@Zeno-sole Zeno-sole moved this from 测试通过 to 已集成 in v23-集成管理 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project:integrated 集成管理相关 吴波 吴波
Projects
Archived in project
Development

No branches or pull requests

4 participants