Here is my best attempt to articulate why I believe all dependencies, including compiler toolchains, belong in version control.
https://www.forrestthewoods.com/blog/dependencies-belong-in-version-control/
Here is my best attempt to articulate why I believe all dependencies, including compiler toolchains, belong in version control.
https://www.forrestthewoods.com/blog/dependencies-belong-in-version-control/
@forrestthewoods @morten_skaaning SVN was designed as a direct replacement for CVS, and included such novelties as tracking the state of the entire repository tree, rather than per-file checkouts, or branches that you could actually understand how to use.
Anyone who has used CVS is not laughing at the circus.
@wolfpld @morten_skaaning @forrestthewoods SVN was an incredible breath of modern fresh air over CVS.
I still prefer SVN over git in a lot of ways even though git obviously has some upsides as well. It just feels like the world collectively gave up on it and moved on. (At least the public world, I know a lot of closed source stuff still runs it successfully.)
@forrestthewoods @mtothevizzah as you pointed out, your dream VCS exists (more than once?). Google monorepo + VFS + VCS is exactly like that. Everything checked in from LLVM through libraries to your project, everything passing tests, everything building, everything updated to the same version (so you don't end up with 10 libraries using 10 versions of Eigen or whatever).
I absolutely loved it. :)
Oh, and I obviously also strongly agree with all your post's points. This is the only sane way.
@BartWronski @mtothevizzah yeah Meta is the same way. But with Buck and a custom Mercurial. It really is The Way.
If only the tooling were more accessible to the outside world!
@BartWronski @mtothevizzah there’s definitely a “more than the sum of its parts” aspect. Bazel/Buck both work in the wild. But the monorepo is missing which is effectively what I’m arguing should exist in the public sphere.
Build cache, build farm, CI systems etc are another layer. But I think there’d be value in “Perforce but sucks less and is broadly available”
@dotstdy yeah with the right sparse, shallow, and maybe LFS(?) you can make it work. I’m so sad Microsoft abandoned GitVFS in favor of sparse. Not sure why.
Sparse is still inferior to VFS imho. VFS “just works” (modulo bugs). Sparse requires maintenance and can be fragile. But it can be done! FWIW at work we use to have sparse lists and VFS is soooo much better.
@dotstdy makes sense. But seems like a bad reason!
The world clearly needs a decent cross-platform VFS library. Unfortunately it needs to wrap FUSE for Linux, ProjFS for Windows, and macFUSE for Mac.
And possibly something else in the future when Apple inevitably breaks things with more lockdown.
@dotstdy I couldn’t tell if they were actually gone or not.
FWIW we have a VFS at work that works across the board. Public GitHub leads me to believe macOS uses NFSv3. Three parallel implementations for three platforms, woo!
@forrestthewoods @dotstdy Isn't Scalar supposed to be their replacement for GitVFS:
Scalar: A set of tools and extensions for Git to allow very large monorepos to run on Git without a virtualization layer - GitHub - microsoft/scalar: Scalar: A set of tools and extensions for Git t...
@forrestthewoods Agreed! We haven’t taken the step to also include the compiler, but otherwise every single dependency is in P4. A build on a clean machine is just 1) sync 2) install VS 3) build.
Regarding a virtual filesystem based VCS, it’s something that comes up now and then, but it feels to me like something that would only work in an environment where *everything* is aware of the VFS-ness. E.g. stuff like a “find in files” in your editor would end up pulling the whole source tree.
@aras @logicalerror it requires setting up your build tool to point at the committed toolchains. And C++ has a million different build systems.
At the end of the day some process calls cl.exe and link.exe. There is surprisingly little magic.
I’m increasingly a fan of nuking environment variables to prevent random PATH bullshit from leaking in. :)
@aras @forrestthewoods I miss that sooooo much. Stevedore, the thing downloading all the toolchains, was one of the best part or our buildsystem at Unity!
Getting a lil bit closer now again by using https://prefix.dev/ at work to define all the tooling dependencies. But obviously it can't redistribute stuff like Visual Studio (but pins the version for that one at least :))
@forrestthewoods
I largely agree. I go so far as to check in generated code, because it both saves other people time, and it reduces opportunities for skew (and unexpected diffs show where there's a problem!)
You'll need the system image too with all the system libraries. At some point, is better to archive the entire disk. Use a well defined VM (or container) for building, so it's reproducible forever!
@StompyRobot I’m also a fan of committing generated code. Makes things easier to search. Can cause merge pain though.
I think it’s potentially worth having a full system image. But if you commit full toolchains it is largely unnecessary!
@forrestthewoods
You'll want the runtime libraries the toolchain uses.
Libc versions, .net runtime versions, msvc dll versions, ...
Sadly, most of this isn't statically linked.
Btw, if you get a conflict in the generated code, just blow away upstream, because you have the current source version and generation is deterministic. (Right?)
(If this doesn't work, you have some determinism problems to fix!)
@StompyRobot correct. When I say commit the full toolchain I really do mean everything in the Visual Studio/LLVM/etc directory! All of it!
Yeah re-generating code should definitely work. But it can make VCS cranky when it fails to cleanly merge/rebase and it wants to run merge tools or inject conflict markers.
Ideally VCS knows what files are generated and how to regenerate them. But that’s a separate story!
@StompyRobot @forrestthewoods
re:
> You'll need the system image too with all the system libraries.
note, this will not work on macOS on Big Sur or later, because:
> New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem.
[...]
@StompyRobot @forrestthewoods
[cont'd]
> Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)