人生得意须尽欢是什么意思| 隔离霜和防晒霜有什么区别| 白细胞低吃什么补| 什锦菜是什么菜| 尿频吃什么药| 梦见孩子被蛇咬是什么意思| 左灯右行什么意思| 木是什么生肖| 高烧吃什么药退烧快| 什么时候会怀孕| ph什么意思| 补骨脂是什么东西| 孽缘是什么意思| eeg是什么意思| 湿疹是什么皮肤病| 厚颜无耻是什么意思| 蜜月是什么意思| 尿液弱阳性什么意思| 血色素低吃什么补得快| 胃肠性感冒吃什么药| 预包装食品指的是什么| 眼睛浮肿是什么原因引起的| 胡椒粉是什么做的| 总胆红素偏高什么意思| 心阴不足吃什么中成药| 酸梅汤不能和什么一起吃| 涂防晒霜之前要涂什么| 核子是什么| 七月七日是什么日子| pdt是什么意思| 打篮球对身体有什么好处| 阳春三月是什么生肖| 六月八号什么星座| 安全总监是什么级别| 5月21日什么星座| 落魄是什么意思| 养流浪猫需要注意什么| 花开半夏是什么意思| 生死劫是什么意思| 属蛇的和什么属相最配| 毁三观是什么意思啊| 房东是什么意思| 笃怎么读什么意思| 99年属兔的是什么命| 白是什么结构的字| 金戈铁马是什么生肖| 追什么| kerry英文名什么意思| 上海话册那是什么意思| 世界上最坚硬的东西是什么| 裸钻是什么| 柠檬泡水喝有什么功效| 女人喝红酒有什么好处| 葡萄柚是什么| 硫黄和硫磺有什么区别| 月亮是什么生肖| 甄别是什么意思| 腰椎钙化是什么意思| ca125高是什么原因| 职业暴露是什么意思| 铁剂不能与什么同服| 肝硬化前期有什么症状| 什么的寒冷| 肋骨突出是什么原因| 8月13号什么星座| 料理机是干什么用的| 炖羊肉都放什么调料| 中性粒细胞偏高是什么意思| 观音菩萨的坐骑是什么| 为什么开空调没蚊子| 无厘头是什么意思| c3c4补体是什么意思| 女性分泌物少是什么原因| 平均红细胞体积偏高是什么意思| 良民是什么意思| 黄瓜吃了有什么好处| 办身份证需要带什么| 智齿是什么样的| 为什么叫白俄罗斯| prbpm是什么意思| 秃噜皮是什么意思| 易经的易是什么意思| 心率过快有什么危害| 眼睛充血是什么原因造成的| 心脏病人吃什么水果好| 梦见月经血是什么预兆| 什么样的泥土| 曲安奈德针治疗什么| 红肉是什么肉| 什么不动| gl小说是什么意思| 宫颈纳氏囊肿是什么意思严重吗| 藕带是什么| 西腾手表属于什么档次| 迷茫是什么意思| 孩子拉肚子吃什么药| 南京市徽为什么是貔貅| 冒节子是什么东西| 检查尿酸挂什么科| 鸟在电线上为什么不会触电| 17号来月经什么时候是排卵期| 耳洞发炎流脓用什么药| 打茶围是什么意思| 起水痘不能吃什么食物| 9月14号是什么星座| 今年什么时候进入伏天| 公历年份是什么意思| 木加炎念什么| 神夫草抑菌乳膏主治什么| 下一个台风什么时候来| 什么节气开始凉快| gp是什么意思| 女人抖腿代表什么意思| 澳门什么时候回归| 老年人吃什么钙片补钙好| 嘴唇上火起泡用什么药| 男女授受不亲是什么意思| 马齿苋什么人不能吃| qq2g在线是什么意思| 吃什么可以化掉息肉| 长寿花什么时候开花| 9.22什么星座| 堪忧是什么意思| 医院什么时候下班| 蜂窝网络是什么| 爆竹声中一岁除下一句是什么| 小孩急性肠胃炎吃什么药| 黑茶有什么功效| 收悉是什么意思| 什么叫放疗治疗| 为什么膝盖弯曲就疼痛| 人丝是什么面料| 阴道感染有什么症状| 运动裤配什么上衣好看| 眼睛黄是什么原因| 判缓刑是什么意思| 生地麦冬汤有什么功效| 恢复伤口吃什么好得快| 正营级是什么军衔| 二毛二是什么军衔| 长期吸烟容易引起什么疾病| 血脂高不能吃什么食物| 子鱼是什么鱼| 肚脐眼周围痛挂什么科| 便秘了吃什么容易排便| 流产可以吃什么水果| 驾驶证体检挂什么科| 待业是什么意思| 什么鱼适合清蒸| 淤泥是什么意思| 天蝎男和什么星座最配| 锋芒毕露什么意思| 梦见家被偷了什么预兆| 红颜知己是什么意思| 你为什么爱我| 小雪时节吃什么| mlb是什么牌子| 何如是什么意思| 胎儿左肾盂分离是什么意思| 去威海玩需要准备什么| 慢阻肺吃什么药最有效| 乾隆是什么朝代| 属牛的生什么属相的孩子好| 脚上长痣代表什么| 末梢神经炎吃什么药| 钠尿肽高是什么原因| 戊肝是什么病| 长期口腔溃疡挂什么科| 篮板是什么意思| 甲亢是什么症状| 承欢膝下什么意思| 儿童头痛挂什么科| 外翻是什么意思| 16周检查什么项目| 血糖低有什么症状| 尿喝起来是什么味道| 梦见自己怀孕生孩子是什么意思| 锁阳是什么东西| 吃粽子是什么节日| 下眼袋浮肿是什么原因| 屁多且臭是什么原因| 4月22日什么星座| 急性心肌炎有什么症状| 朱迅和朱军是什么关系| 高考什么时候恢复| 为什么要喝酒| 睑腺炎是什么原因造成| 什么是比例| 鼻窦炎是什么样子的| 喝醋对身体有什么好处| 装藏是什么意思| 牙龈出血吃什么| nbcs是什么意思| 心绞痛有什么症状| 胆囊炎是什么| 寄生虫感染吃什么药| 小便清长是什么意思| 白细胞满视野是什么意思| 叶酸有什么作用和功效| 思维是什么意思| 茹什么饮什么| 美女的阴暗是什么样的| 猪脚炖什么好吃| 妈妈a型爸爸b型孩子是什么血型| 耳朵后面痒是什么原因| 全糖是什么意思| 路上遇到蛇是什么征兆| 芸豆长什么样子| 四岁属什么生肖| 湿疹为什么一热就出来| 儿童哮喘挂什么科| 皮肤长痘痘是什么原因| 3e是什么意思| 吃亏是什么意思| 十二生肖叫老大是什么生肖| 什么叫戈壁滩| 水落石出是什么生肖| 抽电子烟有什么危害| 色痨是什么病| 放屁多是什么原因呢| 非钙化斑块是什么意思| 金瓜是什么瓜| 心脏不舒服挂什么科室| 肠胃炎是什么引起的| 瓜蒌根为什么叫天花粉| nt检查前需要注意什么| 肾气不足有什么症状| 打扰是什么意思| 杀青了是什么意思| 商朝之后是什么朝代| 5月10日什么星座| 排卵期什么症状和反应| 晚上总是做梦是什么原因引起的| 康复治疗是做什么的| 相生什么意思| 舍什么救什么| 比音勒芬是什么档次| 裸辞是什么意思| 阴道没水什么原因| 早餐吃什么英语怎么说| 为什么越吃越饿| 蚕除了吃桑叶还能吃什么| 显妣是什么意思| 为什么特别招蚊子| 猪肝不能和什么一起吃| 氨酶偏高是什么意思| 金风送爽是什么意思| 什么叫失眠| 基因是什么| 嗜睡什么意思| 内蒙有什么特产| 九月份什么星座| 红黑相间的蛇是什么蛇| 制剂是什么意思| 科普一下是什么意思| 脚踝韧带拉伤吃什么| 阿拉伯是什么意思| 光斑是什么意思| 小孩晚上睡觉出汗是什么原因| 什么程度算节食减肥| 2月1号是什么星座| 植树造林的好处是什么| 古人的婚礼在什么时间举行| josiny是什么牌子| 百度
百度 五是坚持以结果运用为关键。

/!\ A DRAFT version of the spec is available.

This is a standard that defines an environment variable BUILD_PATH_PREFIX_MAP that distributions can set centrally, and have build tools consume this in order to produce reproducible output.

Before implementing this, you should scan through our checklist to see if you can avoid implementing it.

Proposal

Please read our DRAFT specification for details.

See Standard Environment Variables for more detailed discussion of the rationales behind this mechanism.

Below we also have more detailed discussion about this specific variable, as well as documentation on history and alternative proposals.

Example code

See our git repo for example code in various languages.

TODO:

Adoption

The following toolchains have adopted this already:

Implementation notes

Language-specific

Since our encoding only deals with ASCII-compatible characters, and UTF-16 uses surrogate pairs to encode code points not in the BMP, it should be possible to implement our encoding by "naively" operating on string units, regardless of whether a unit is an 8-bit octet (e.g. POSIX C), 16-bit wchar_t (e.g. Windows C++), or an actual decoded Unicode code point (e.g. Python 3). However in practise, this is only possible when your language provides APIs that do not attempt to automatically decode environment variables or filesystem paths, or does this in a reversible (non-standard) way.

For example, on Python 3, os.getenv and the path functions normally return a unicode string (where each unit is a decoded Unicode code point), unless you specifically use os.getenvb instead or give "bytes"-type path arguments.

Luckily on Python 3.3+ one can implement our encoding without duplicating code, in a cross-platform way. Yes, paths and environment variables are presented as (decoded) Unicode strings. However on POSIX where the underlying OS values are bytes, values which cannot be UTF-8 decoded to valid Unicode are instead decoded into a lone "low surrogate" character which is not present in standard Unicode - Python calls this the "surrogateescope" encoding. The resulting string, when UTF-8 encoded back into bytes, preserves the original byte value - which is invalid UTF-8 but that doesn't matter to a POSIX OS. Therefore, it is correct to implement a "naive" algorithm that operates on Python unicode strings even when the OS type is bytes, and the benefit is that the same code will also work on Windows.

For example, in Rust the OsString type is platform-dependent and opaque; one must write platform-specific code to either convert this to an array of u8 (for POSIX) or an array of u16 (for Windows). In the latter case, u16 units that are invalid UTF-16 are represented internally as WTF-8, but this is only an implementation detail not exposed to Rust stdlib API users.

For example, in NodeJS (as of v4.6.1), non-UTF-8 bytes in environment variables are *not supported* - they will get replaced by U+FFFD instead. Best to file a bug against them, if you need to map non-UTF-8 paths.

Our testcases includes a non-UTF-8 case, so you can test how to make this work (or not) in your favourite language. Unfortunately, we do not yet have invalid UTF-16 test cases for windows.

Transmitting these values

Our encoding only transforms sequences of printable ASCII characters. If you have reason to believe that you need to escape or encode your file paths before transmitting it across your chosen medium, e.g. because they contain non-printable or non-ASCII characters, it should suffice to simply apply the same escape or encoding mechanism to this environment variable as well. This is an entirely separate concern from anything else mentioned in this document, and the code to do this should be clearly separated from code that implements this document.

More detailed discussion

(See Standard Environment Variables for general arguments.)

Comparison to SOURCE_DATE_EPOCH

SOURCE_DATE_EPOCH's underlying information (date of last modification) is a property of the source code, and is therefore a constant reproducible value by definition. By contrast, BUILD_PATH_PREFIX_MAP's underlying information (maps from paths to other paths) is not itself a property of the source code.

What it is, is roughly the "difference" between build-time path information, and a property of the source code. In other words, build tools read paths from the filesystem, then "subtract" SOURCE_DATE_EPOCH from it to get reproducible paths out of it. These might be relative paths, or they could be abstract absolute paths that might not exist on the build machine, but could exist (based on a contract with other tools) on the end user's run-time machine. This latter information is output, instead of the build-time path information.

Why don't we use a reproducible value directly? In fact some buildsystems can do this, and they don't need this variable. For example, some buildsystems and programming languages force a very rigid structure to the source tree, and either both the high-level and low-level build tools are able to determine the relative paths of every source file, or else the high-level tools detect this information and pass it down into the low-level tools.

However, this is only easy to arrange for vertically-integrated build stacks where the whole stack is controlled by just a few parties. For C/C++ and other languages, there are several different buildsystems that each want to work for several different compilers at the same time, so there is a disincentive to add special logic for tool-specific command-line options.

For example, GCC does in fact support a -fdebug-prefix-map option where a high-level build tool (or human) can supply information on "what to subtract". But historically, the only use-case that was imagined for this was debug info (hence its name) and the map does not apply to other things like __FILE__ macros. It's unlikely that a higher-level buildsystem would want to spend the effort to detect appropriate values for this automatically, merely to have nicer debuginfo. More generally, command-line based solutions are hard for us the Reproducible Builds project to scale across the whole FOSS ecosystem; see "We'll add a command line flag instead" for more discussion.

This environment variable therefore, can also act as a standard interface between parent buildsystems and low-level build tools. The former can pass to the latter, information about the path structure of the overall software project. This can even be done without co-ordination: unlike command-line options, programs usually ignore environment variables that they don't recognise. So a parent buildsystem can pre-emptively choose to set this variable, even if not all of its child build tools can read it yet.

Similarly, our usage of SOURCE_DATE_EPOCH so far has been for the distribution's package builder program to set this value in an envvar, but it is conceivable that buildsystems could set this themselves, e.g. by reading it from VCS or a ChangeLog file in the source tarball, for lower-level build tools to consume.

History and alternative proposals

FIXME: stuff about --fdebug-prefix-map, DW_AT_producer, etc.

Rejected options


Footnotes:

今年30岁属什么生肖 手痛挂什么科 补肾壮阳吃什么 ad和d3有什么区别 皮肤痒用什么药膏
心口疼吃什么药 什么奶粉对肠胃吸收好 ohs是什么意思 射手后面的星座是什么 upc码是什么意思
鸡皮肤用什么药膏最好 exp是什么日期 仁字五行属什么 六月八号是什么星座 1988年属什么今年多大
功课是什么意思 上火有什么症状 梦见自己鼻子流血是什么预兆 锥切手术是什么意思 观音位置摆放什么方向
高血糖喝什么茶好hcv8jop4ns6r.cn 青定读什么hcv9jop6ns9r.cn nlp是什么hcv9jop5ns8r.cn 圆房要做什么hcv9jop6ns1r.cn 苦荞茶有什么功效hcv8jop5ns1r.cn
什么生日的人有佛缘gangsutong.com 心悸是什么症状hcv8jop7ns4r.cn 午餐吃什么好又能减肥hcv8jop9ns7r.cn 什么什么为什么hcv9jop2ns7r.cn 现在有什么赚钱的路子1949doufunao.com
朕是什么时候开始用的beikeqingting.com 梦见喝酒是什么意思jinxinzhichuang.com 尿微量白蛋白是什么意思hcv7jop9ns3r.cn 鼻窦炎吃什么药好得快hcv7jop9ns9r.cn 道和集团是干什么的hcv9jop3ns0r.cn
前庭大腺囊肿是什么原因引起的hcv8jop0ns0r.cn 肾阳虚吃什么药最好最有效hcv9jop4ns5r.cn 妇科臭氧治疗是什么hcv8jop9ns0r.cn 容易长痣是什么原因xjhesheng.com 1972年是什么命hcv9jop2ns4r.cn
百度