Closed awly closed 1 year ago
I think I would advise that if we're going to do this (and I think we should) then it should be like this:
Makefile
will be altered to use Docker for all operations and tidied upbuild.assets
directory is completely removedMakefile.local
(or a build.local
directory with a Makefile
) that can be used for local builds in extreme circumstances, or for environments where Docker isn't available/desirable, for architectures such as darwin
or arm
.
local-all
, local-full
, local-release
etc targets in the root Makefile
- but that's probably still quite confusing.The reason is that build.assets
is currently very overloaded as a directory name and many things assume that it exists. Removing the Makefile
will make those targets fail, rather than have them unexpectedly start building locally vs in Docker and create weird issues for us.
We should also look to consolidate the Makefile
in the e
submodule into the root Makefile
. Having two similar-but-not-quite-the-same Makefile
s with duplicated targets, variables and other parts is needlessly confusing.
(Also, perhaps weirdly, I'm not a huge fan of having Docker as a hard requirement to simply run make
and quickly build a binary for testing. With that said, we can add some checks which will validate that Docker is installed and working, and having a standardised build environment for anyone trying to build Teleport will help a lot, especially as we scale)
This would make development on macOS or (potentially Windows) really slow.
A lot of our make
scripts assume the GNU versions of utilities like sed
, find
etc which means that they don't work as intended on MacOS anyway. I actually have a much better time mounting my git
checkouts into a Vagrant VM which runs Linux - this is way faster than Docker on MacOS (because of its weird hypervisor implementation)
Currently, we have the root
Makefile
with a bunch of targets that all run locally. We also havebuild.assets/Makefile
that runs these targets inside docker.Since everyone has a different local setup, we constantly have friction as people figure out how to tweak their environment to work with our root
Makefile
.Instead I propose we make all
make
targets in the root of the repo run inside docker. And if you really really want to run locally,build.assets
should provide those targets.One caveat here is performance - we must carefully build the
docker run
commands to reuse all the local caches and avoid excessive disk writes not in volumes.