Have you ever wanted to run your build system of choice inside a sandbox that forbids looking up the absolute path of the current working directory (so `realpath`, `pwd`, and such all fail)? No?

Well now you can. https://github.com/ComputerDruid/anticanonicalize

GitHub - ComputerDruid/anticanonicalize: anticanonicalize is a tool which runs a command with the current working directory set to an "unreachable" version of the directory.

anticanonicalize is a tool which runs a command with the current working directory set to an "unreachable" version of the directory. - ComputerDruid/anticanonicalize

GitHub

In theory, this might be useful to ensure your build is independent of where the repository is cloned, a useful property for build caching.

In practice, it just breaks everything in amusing ways.

Please enjoy and report back if you find something funny or useful with it.

@computerdruid kind of like a chroot jail?

@aburka @computerdruid

No, this is way way more nuts. Oh my god 😅

@aburka yes, but kinda backwards? chroot limits what files you can see. This doesn't limit your ability to see any files, just gives you a directory and prevents you from figuring out where it is.

chroot is one of the ways you can get an unreachable directory, although this tool uses mount namespaces instead (which works without root)

@computerdruid @aburka so this is putting the build environment in a sandbox, in much the same presentation as tools like DOSbox present a simplified and stubbed-off directory tree to the game it's hosting? you can't climb out of the mounted / for the game from inside DOSbox
@computerdruid sounds like a fun challenge to try to make a build system compatible with this :D