document single step build and adjust makefile for rebuild of curl if needed
1 parent cc7f2b3 commit e1bea1a49bf741e1bdde20f3a80f5a0338d3b389
@tundra tundra authored on 24 Dec 2020
Showing 2 changed files
View
42
README.md
# Build Standard Tools
 
This is automation support for the linuxbrew-based tools procedure
documented at:
 
https://www.tundraware.com/TechnicalNotes/Divorce-Your-Linux-Admin
documented at
[Divorce Your Linux Admin](https://www.tundraware.com/TechnicalNotes/Divorce-Your-Linux-Admin).
 
This document is a bit outdated as it does not describe the simplified
build noted below, but the document does describe the overall idea
of what we're trying to accomplish.
 
 
## How To Use The Makefile
 
This most likely bite you the first time you untar a bootstrap tarball
to perform a full build. DAMHIKT.
 
 
## Building The Tools - The Simple Way
 
When this process was first defined, we split the build into two
steps. First, we did a "bootstrap" on a machine with a full set of
local development tools and saved the result. Then, we loaded that
minimal `brew` image onto a machine with no local compiler to finish
building the toolset.
 
After running this a bunch of times on a variety of VMs and
containers, we discovered that this two-step process is unnecessary,
and may even make it harder for the process to complete.
 
That process is still described in the following sections but the
easier - and more likely to succeed - way to do this is to do
everything on a single machine that has system compilers and languages
installed:
 
. brewenvs
make getbrew bootstrap-build bootstrap-release full-build full-release clean
 
Notice that we still save off a small boostrap tarball. Why? There
may be times when you want to start with a "minimal" `brew`
installation for other work. This process preserves both that minimal-
and then, the full toolset you've defined as separate installable
tarballs
 
Take care to read the note below to ensure that your build environment
is the "right" one to build binaries that will work when deployed on
your running systems.
 
 
## Building The Bootstrap Image
 
1. Log into your build machine, VM, or`docker`image.
View
7
makefile
# Name of the tools directory
TOOLS = tools
 
# Things that have to be built during the bootstrap phase with system tools
BOOTSTRAP = gcc make
BOOTSTRAP = gcc make curl git
 
# Support and languages to install after bootstrap but before other packages
LANGS = curl git go perl python
LANGS = go perl python
 
# Stuff we want pip to install
PIPMODULES = pip ansible pew pythonz-bd
 
bootstrap-build:
@echo "Make sure you have the OS development tools installed!"
sudo yum -y install texinfo
${BREW} install --verbose ${BOOTSTRAP}
# ${BREW} reinstall -s --verbose curl
 
 
bootstrap-release: tidyup
echo "${FULLDATE}" > ${TOOLSDIR}/tools-builder.bootstrap.datetime
echo "${GITREVISION}" > ${TOOLSDIR}/tools-builder.bootstrap.gitrevision
full-build:
@echo "Make sure the bootstrap is installed at ${TOOLSDIR}"
sudo yum -y install autoconf automake patch perl texinfo
${BREW} install -s --verbose ${LANGS}
# ${BREW} reinstall -s --verbose curl
${BREW} link --verbose python
ln -nfs ${TOOLSDIR}/bin/python3 ${TOOLSDIR}/bin/python
ln -nfs ${TOOLSDIR}/bin/pip3 ${TOOLSDIR}/bin/pip
pip install ${PIPMODULES} -U --ignore-installed