gpt4 book ai didi

python - 在 Alpine 上安装 crcmod CRC32C C 扩展

转载 作者:太空宇宙 更新时间:2023-11-03 15:11:55 25 4
gpt4 key购买 nike

我正在尝试将我的 CI 构建迁移到基于 alpine 的 docker 镜像。

构建的一部分是使用 gsutil 命令从 Firebase 测试实验室检索工件:

gsutil -m cp -r -U $BUCKET_DIR* $OUTPUT_DIR

此命令失败,因为它无法对下载的工件执行 CRC 检查:

CommandException: 
Downloading this composite object requires integrity checking with CRC32c, but your crcmod installation isn't using the module's C extension, so the hash computation will likely throttle download performance. For help installing the extension, please see "gsutil help crcmod".

To download regardless of crcmod performance or to skip slow integrity checks, see the "check_hashes" option in your boto config file.

NOTE: It is strongly recommended that you not disable integrity checks.
Doing so could allow data corruption to go undetected during uploading/downloading.
CommandException: 1 file/object could not be transferred.

gsutil help crcmod 不提供有关如何在 Alpine 上安装 C 扩展的说明。

我尝试安装以下软件包,虽然安装成功,但未安装 C 扩展,仍然导致 gsutil 命令失败并出现相同的错误。

apk add --update --no-cache python py-pip gcc python-dev
pip install -U crcmod

有什么线索吗?

最佳答案

很确定一定有更好的选择来做到这一点,但这是我的解决方法

# Install Alpine Python dependencies
apk add --update --no-cache python python-dev gcc musl-dev

# Compile CRC32c
# See for more information: https://cloud.google.com/storage/docs/gsutil/addlhelp/CRC32CandInstallingcrcmod
#
curl -L -o crcmod.tar.gz "https://downloads.sourceforge.net/project/crcmod/crcmod/crcmod-1.7/crcmod-1.7.tar.gz"
tar -xzf crcmod.tar.gz
cd crcmod-1.7/
python setup.py install
cd ..

关于python - 在 Alpine 上安装 crcmod CRC32C C 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44156905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com