Post Ax5n7SzvOGIe42FMpc by chn@xn--s8w913fdga.chn.moe
 (DIR) More posts by chn@xn--s8w913fdga.chn.moe
 (DIR) Post #Ax5n7SzvOGIe42FMpc by chn@xn--s8w913fdga.chn.moe
       2025-08-12T09:41:15.178Z
       
       0 likes, 0 repeats
       
       感觉在跑编译的上下文中,qemu-aarch64性能损失很大,似乎能损失一个数量级。不知道是否正常、有没有什么优化的方法。
       
 (DIR) Post #Ax5n7TwPsn5UzRc50C by Candinya@nya.one
       2025-08-12T11:08:41.154Z
       
       0 likes, 0 repeats
       
       @chn@xn--s8w913fdga.chn.moe 是正常的,之前跑带 arm 支持的容器时候就发现它构建时间非常离谱,最好的办法应该是找原生的 aarch64 设备(比如 arm 处理器的服务器)直接构建
       
 (DIR) Post #Ax5n7UtyJMj5y9TdpY by shironeko@fedi.tesaguri.club
       2025-08-12T11:40:36.773689Z
       
       0 likes, 0 repeats
       
       @Candinya @chn cross compile 的话应该就没有什么性能损失了吧
       
 (DIR) Post #Ax626GrWWUAnRvCmg4 by chn@xn--s8w913fdga.chn.moe
       2025-08-12T14:25:11.243Z
       
       0 likes, 0 repeats
       
       @shironeko@fedi.tesaguri.club @Candinya@nya.one 是的,但cross compile无法命中nixos的缓存,会导致需要全量重新编译。
       
 (DIR) Post #Ax626HatnmT9ieR1P6 by shironeko@fedi.tesaguri.club
       2025-08-12T14:28:31.057532Z
       
       0 likes, 0 repeats
       
       @chn @Candinya 有意思,cross compile不能保证artifact是reproducible的?
       
 (DIR) Post #Ax63ZuJH2KvC96sf9U by chn@xn--s8w913fdga.chn.moe
       2025-08-12T14:34:43.764Z
       
       0 likes, 0 repeats
       
       @shironeko@fedi.tesaguri.club @Candinya@nya.one 不是不能,只是nixos的infra没有准备交叉编译的缓存(否则要编译的arch就太多了)
       
 (DIR) Post #Ax63Zv8JyXkqhQlQie by shironeko@fedi.tesaguri.club
       2025-08-12T14:45:04.534418Z
       
       0 likes, 0 repeats
       
       @chn @Candinya 我的意思是说cross compile的结果和native的结果hash不一样?
       
 (DIR) Post #Ax63yMQS9dReINtnoe by chn@xn--s8w913fdga.chn.moe
       2025-08-12T14:46:51.022Z
       
       0 likes, 0 repeats
       
       @shironeko@fedi.tesaguri.club @Candinya@nya.one 我不清楚是否一样(大概率是不一样的),但nix的绝大多数缓存并不是content-addressed(即取的是构建方法的哈希,而不是构建结果的哈希)。
       
 (DIR) Post #Ax63yNfNXcyi8xtEie by shironeko@fedi.tesaguri.club
       2025-08-12T14:49:29.903737Z
       
       0 likes, 0 repeats
       
       @chn @Candinya 有意思,为什么不用结果来index?
       
 (DIR) Post #Ax64OD3VcAZAlQUc6a by shironeko@fedi.tesaguri.club
       2025-08-12T14:54:10.886424Z
       
       0 likes, 0 repeats
       
       @chn @Candinya 如果native是reproducible那么cross compile应该也是reproducible,因为compiler执行的代码是一样的
       
 (DIR) Post #Ax66a16U4rxl4wdsjQ by chn@xn--s8w913fdga.chn.moe
       2025-08-12T15:16:38.682Z
       
       1 likes, 0 repeats
       
       @shironeko@fedi.tesaguri.club @Candinya@nya.one 因为在实践中这会导致很多问题。https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue%20%22content%20addressed%22