TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Refix: Fast, Debuggable, Reproducible Builds

106 pointsby luuabout 1 year ago

13 comments

YoshiRulzabout 1 year ago
Author doesn&#x27;t mention Nix by name, so I wonder if they&#x27;re aware of it. While it as a build system has more than its fair share of &quot;dark corners&quot;, it does solve the reproducibility of all paths (including with a chroot, to get fixed-length paths), and has automagic debuginfod support via [1].<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;symphorien&#x2F;nixseparatedebuginfod">https:&#x2F;&#x2F;github.com&#x2F;symphorien&#x2F;nixseparatedebuginfod</a>
评论 #39906052 未加载
hamandcheeseabout 1 year ago
Is it possible to embed relative paths (i.e. starting with .&#x2F;), and instruct your debugger where the source root is?
评论 #39905627 未加载
评论 #39903564 未加载
IshKebababout 1 year ago
This is definitely a hack and despite their claims that it&#x27;s more robust they&#x27;ve introduced a load of more failure modes.<p>I can&#x27;t imagine it&#x27;s really that slow to edit the paths properly. It&#x27;s probably just accidental N^2 or something.<p>Also it feels like there should be a proper field in ELF&#x2F;DWARF for this if people are wanting to do it a lot (and it seems like a reasonable thing to do).
评论 #39903868 未加载
评论 #39903316 未加载
Cloudefabout 1 year ago
__FILE__ is pain of my existence, recently contributed this code to run&#x2F;build ds3os using nix instead of docker, where I hit issues with __FILE__<p><a href="https:&#x2F;&#x2F;github.com&#x2F;TLeonardUK&#x2F;ds3os&#x2F;blob&#x2F;main&#x2F;default.nix#L41-L45">https:&#x2F;&#x2F;github.com&#x2F;TLeonardUK&#x2F;ds3os&#x2F;blob&#x2F;main&#x2F;default.nix#L4...</a>
评论 #39903944 未加载
Joker_vDabout 1 year ago
I am kinda struggling to understand the proposed solution. So, okay, I have an EXE, and I have a PDB file for it, and that PDB file states that the source code lived at the Q:\Users\raymond.chen\Documents\work\projects\ContosoFoobar\src\main.c. Instead of having some sort of debugger setting to allow me to remap the path to something existing on my machine (my disks go up only to H:, for once), the proposed solution is to monkey-patch the PDB file itself. But, like, why? It doesn&#x27;t solve the main problem that you still need to somehow find the sources, manually.<p>Also: if you really, really want to never go looking for the sources ― just store them in the finished executable&#x2F;debug info file. Seriously. For some reason, they&#x27;re (when gzip&#x27;ed) somehow smaller than the resulting executable with debug info.
评论 #39908119 未加载
MarkSweepabout 1 year ago
The premise of the tool seems very useful: edit debug symbols and assert messages so that source code can be found by debuggers. But this description does not make it clear how this tool accomplishes the whole task:<p>&gt; Why not fix the binary coming out of the build cache, so it points to the absolute path of the source files?<p>What is the absolute path? If you had a virtual file system that allowed you to construct a path to any file at a given commit, this would work great. But who does that other than Google? Or if you agree that every developer will check out the same source code repo at the same path, but the you have to have the right commit checked out.<p>Ideally you would want your binary to point back to your code repo, like SourceLink does.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dotnet&#x2F;sourcelink">https:&#x2F;&#x2F;github.com&#x2F;dotnet&#x2F;sourcelink</a>
评论 #39905330 未加载
humanrebarabout 1 year ago
What about debuginfod instead? Look up your source and even your debug symbols by your build identifier.
评论 #39903805 未加载
rurbanabout 1 year ago
&gt; firstly, GNU memmem is slower than memchr::memmem::Finder,<p>Not only slower than the rust version, also slower than most other &gt;200 string search functions. Whilst musl has the fastest string search function for less than 32 substring chars.<p>See <a href="https:&#x2F;&#x2F;rurban.github.io&#x2F;smart&#x2F;results&#x2F;all&#x2F;rand2.html" rel="nofollow">https:&#x2F;&#x2F;rurban.github.io&#x2F;smart&#x2F;results&#x2F;all&#x2F;rand2.html</a> with libc1 being GNU libc memmem() and musl1 being musl&#x27;s memmem().
beeboobaa3about 1 year ago
Weird post. It raises questions, then admonishes you for reading them.<p>&gt; &quot;Well you&#x27;re not supposed to get core dumps from versions with uncommitted changes, unless it&#x27;s your local version that you haven&#x27;t given to anyone but are testing locally, so you know which version it is. You should only release versions externally thru CI&quot; - so giving anything to anyone to test is now considered &quot;releasing externally&quot; and must necessarily go thru CI, and having trouble finding the source code is now a punishment for straying from proper procedure? How did this discussion, which started at how build caches speed up the build, deteriorate to the point where we&#x27;re telling developers to change how they work, in ways which will slow them down?<p>Hey, you brought it up. Don&#x27;t put this on the reader.
评论 #39907228 未加载
agentultraabout 1 year ago
The author is much too self deprecating! IMHO this isn’t the dreaded “premature optimization,” it’s avoiding pessimization. I’d like to read them in their unrestricted voice!<p>Great article!
评论 #39905381 未加载
评论 #39907664 未加载
QuantumGabout 1 year ago
I love this. The kind of simple solution that gets the job done.
xvilkaabout 1 year ago
Just for the record, for nicer inspection of files with such debug information, including compressed sections, and debuginfod support, Rizin[1] can be used, since starting from the 0.7.0 release[2] all of those were added.<p>[1] <a href="https:&#x2F;&#x2F;rizin.re" rel="nofollow">https:&#x2F;&#x2F;rizin.re</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;rizinorg&#x2F;rizin&#x2F;releases&#x2F;tag&#x2F;v0.7.0">https:&#x2F;&#x2F;github.com&#x2F;rizinorg&#x2F;rizin&#x2F;releases&#x2F;tag&#x2F;v0.7.0</a>
Mbartuabout 1 year ago
Refix proposes an intriguing approach to achieving fast, debuggable, and reproducible builds - a triad often considered difficult to attain simultaneously. Its methodology, emphasizing minimal binary manipulation to preserve debuggability while ensuring reproducibility, introduces a potentially game-changing technique in software development practices. However, the practicality of implementing Refix in diverse development environments, especially those with complex dependency graphs and varying build processes, raises some concerns. Additionally, while the focus on C&#x2F;C++ is understandable given the language&#x27;s compilation model, the broader applicability to other programming paradigms remains to be seen. The proposition of modifying binaries post-compilation might also introduce unforeseen complexities in continuous integration workflows. Refix&#x27;s novel idea undoubtedly sparks interest, but its adaptation to the multifaceted landscape of build systems calls for a thorough examination of its implications and integrations.
评论 #39905940 未加载