From nothing to a version on screen
From nothing installed to the CMake version a project needs on an Ubuntu laptop, without touching the system's own copy.
Duration ·
- Intro · 0:00
- Cold open · 0:42
- Cold open branches · 1:25
- Thesis · 2:08
- Install line · 2:37
- What setup touches · 3:17
- One command · 4:02
- Not a clean machine · 4:44
- Version is a name · 5:24
- Side by side · 6:06
- Close · 6:54
- Outro · 7:34
Transcript
A project needs a newer version of a tool than your system will hand over.
Before you can do any work on it, you have to track down that version yourself.
Count the steps it takes to get there, and you have a fair test of anything that offers to help.
This is the OCX Podcast for engineers who install tools on laptops and in pipelines.
This episode assumes one thing from last time: the registry you already run can hand out a tool with a build for each platform behind one name.
Today, we start with nothing installed and stop once that version is on screen.
Your project just raised the minimum CMake it needs.
You pull the change onto your Ubuntu laptop, open a terminal, and run the configure step.
It stops at the very first check with this: CMake 3.31 or higher is required.
You are running version 3.28.3.
You didn't pick that older one. It's simply what the system shipped with, and until now, that was fine.
That's how a long-term release works.
It holds its version still, and it does that on purpose.
The same freeze held back episode zero's runner in a pipeline.
This time it's on your desk, and your project has already moved past it.
The project setup instructions don't give you a single answer.
Ubuntu 24.04 has no newer CMake, and none is on the way, so they give you branches.
The vendor's own package repository for a start, or pip inside a virtual environment.
Or an archive you unpack into a folder of its own and add to your path by hand.
Someone even asked the project's maintainers whether they had to upgrade the whole operating system for this, and the answer was no.
All of them work on somebody's machine.
Which one fits this laptop is your call, and you have to make it before you've run the version you came for.
Trying a version of a tool should take one install and one command that names the version you want.
With the CMake that came with the system left exactly where it is.
And a second version asked for later shouldn't move the first one either.
We're testing a package manager against that, one that installs tools from a registry.
That laptop doesn't have it yet, and the system CMake is still the only one on it.
The install on that Ubuntu laptop is a single line for its shell.
That line hands the shell a script, and you'd want to know what it does before it runs.
It works out the platform, fetches the archive, and checks that download against the checksum in the release manifest.
Once it matches, its job is done.
The handoff goes to the OCX binary it just fetched, which carries on with a step called self-setup.
The fetching and checking are one way to reach that step, but not the only one.
If you won't pipe a script at all, you don't need it.
Download the archive by hand and run self-setup.
By default, the setup step at the end of the install edits your shell profiles.
On Linux, it also writes a file that sets your path for the session.
Those are files people guard closely, me included.
Mine should stay exactly the way I wrote them.
If you didn't use it, open a new terminal and ask OCX what it found on this machine.
It answers with its own version, the registry it uses by default, the platform.
Episode zero named the libc tax, and here the tool names the C library it found.
That's on screen before you've even asked for CMake.
For the CMake your project needs, you ask OCX's package exec to run 3.31 and print its version.
There's no refresh step beforehand and no install step either.
The first time it says the package isn't on the laptop yet and that it's pulling it.
After the pull, CMake itself answers, version 3.31.12.
That's the CMake the project asked for on a laptop whose own package manager couldn't supply it.
Run it again and it doesn't pull anything because the download stays on disk.
You got there without touching the system's package sources, building a virtual environment, or upgrading anything.
Running CMake through package exec doesn't put anything on your path.
No link goes into any folder your shell searches.
Nothing landing on my path is one half of it.
The other half is what CMake can see of my own setup while it's running.
The package's settings sit on top of yours, not instead of them.
For CMake, the package declares just one, and it's the search path.
A variable I've exported still reaches CMake in there, and a tool already on my path resolves inside the run too.
When a run succeeds, part of the reason could be something you set up yourself.
You asked for a CMake release and got a patch number you never typed.
The version you write after the package's name is a tag.
That tag means the newest patch it has in that release.
Which means changing the tag changes the answer.
Make it 4.0, run the same command, and CMake reports 4.0.7.
There's no switching step in between, and a missing tag fails with its own exit code instead of guessing one for you.
Good, because a typo should stop the run.
But running a version isn't installing it.
And that laptop's second project wants 4.0 every day.
Installing versions side by side takes its own command: package install.
The project's 3.31 goes in, and 4.0 goes in beside it, with nothing overwritten.
The stock CMake packages from apt, DNF, and Homebrew ship one version at a time.
To pick between the versions you installed, OCX keeps one folder for CMake, always at the same address.
Select decides which version you find in it.
Select 4.0, and that's the CMake in that folder.
Select 3.31, and the same folder gives you that one instead.
The route you needed, asking for a version and leaving the system's copy alone, was never in the project's setup instructions.
On that Ubuntu laptop, the project's configure step runs again.
Now, it goes through OCX's package exec, asking for CMake 3.31.
And this time, it gets past the version check and goes on to write the build files.
Ask the shell afterwards which CMake it finds, and it's still the system's at 3.28.
The project's setup instructions can drop their branches, too: the install line for your shell and, under it, the package exec for the configure step.
That's a change the project makes once in its own instructions.
Nobody has to wait for the distribution to move.
We've stayed with the commands this whole time and the versions they printed back.
I'd like to look underneath that at the disk itself.
When the second version arrived, what actually happened there with the first one already in place?
That's where episode three goes.
Every version at once, nothing overwritten.