文章摘要
英国用户无法通过fetchFromRepoOrCz下载tinycc、cdimgtools、docutils等软件包的源代码,导致构建失败。该问题已在NixOS/nixpkgs的444342号issue中报告。
文章总结
构建失败:英国地区无法通过fetchFromRepoOrCz下载tinycc、cdimgtools、docutils等软件包源码
问题描述
在NixOS/nixpkgs仓库的#444342号issue中,用户stefano-m报告了由于英国《在线安全法案》的限制,repo.or.cz网站屏蔽了来自英国IP的访问,导致使用fetchFromRepoOrCz函数的多个软件包(包括tinycc、cdimgtools、docutils等)无法正常下载源码进行构建。
关键细节
- 受影响函数:
fetchFromRepoOrCz(位于pkgs/build-support/fetchrepoorcz/default.nix) - 问题表现:英国IP访问repo.or.cz时会被重定向到
uk-blocked.html页面,导致下载的"源码"实为HTML文件,引发构建错误(如gzip格式校验失败) - 受影响的软件包:
- docutils(Python文档工具)
- tinycc(轻量级C编译器)
- cdimgtools(光盘映像工具)
- syslinux
- glpng
临时解决方案
- 使用VPN或代理绕过地域限制
- 对于docutils,已有提交改用PyPI源(commit de056b7)
长期建议
- 寻找可靠的repo.or.cz镜像源
- 考虑使用archive.org等替代下载方式
- 部分软件包(如docutils)可改用fetchPypi或fetchgit(需评估对构建链的影响)
状态更新
截至2025年10月,docutils问题已通过改用PyPI源解决,其他软件包的修复仍在讨论中。LLVM文档构建流程的变化可能为使用fetchgit创造条件。
(注:已过滤原始内容中重复的导航菜单、页脚信息等非核心内容,保留技术讨论主线)
评论总结
总结评论内容如下:
对大多数用户影响有限
- 多数用户使用cache.nixos.org,不受repo.or.cz地域封锁影响
- "This won't affect most users as they will be using the cache.nixos.org substituter" (评论1)
- "I use NixOS as a source distribution...My usual fix is to fetch the source from cache.nixos.org" (评论7)
对地域封锁的质疑
- 不清楚repo.or.cz为何被英国封锁,认为其内容不涉及敏感信息
- "I'm unclear why it has one, since it's highly unlikely...the site contains anything that is covered by the OSA" (评论4)
- "Peformatively over-compliant...freedom fighter silliness strikes again" (评论6)
建议改进源码获取方式
- 建议采用内容寻址或P2P模式替代传统源码托管
- "the right answer is to move/add a content addressed model/system" (评论7)
- "playing around with the idea of p2p source hosting...interesting ideas" (评论8)
其他观点
- 英国应为科研经济用途设置防火墙例外:"The UK should make exceptions for scientific and economic access" (评论2)
- 俄罗斯IP也常遇到类似问题:"Similar stuff happens often with Russian IP addresses" (评论5)
- 对repo.or.cz域名的困惑:"What is repo.or.cz? It sounds like the domain name is saying something" (评论3)