doujiebo9849 2016-09-25 12:37
浏览 29

一致的构建/从二进制文件中删除个人信息

I've now realized that Go saves absolute paths to source code in binaries for the purpose of printing stack-traces and the likes. I don't want to completely remove this information, however, this also means that every developer building the same program will produce an executable with a different checksum. Before I try to reimplement the build using chroot or something like that: isn't there any way to tell Go not to use absolute paths for this purpose?

  • 写回答

1条回答 默认 最新

  • doutuoshou8915 2016-09-27 16:27
    关注

    I know it doesn't directly address what you asked, but @JimB's suggestion does indicate a class of solutions to the problem you seem to be having.

    One of the easier ones (I think) would be to have your developers install Docker and create an alias so that the go command runs:

    docker run --rm --tty --volume $GOPATH:/go golang:1.7.1(-$YOUR_PLATFORM) go
    

    Then, every build (and test and run) thinks it's using a GOPATH of /go and your developers' checksums won't disagree based on that.

    See here for more info.

    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退