Problem installing Neon locally (on Fedora)

Hi all,

I’ve been trying to install Neon locally on Fedora 34. I have a self-compiled and installed version 15.1 of PostgreSQL - I stopped the server for the install.

In my $PATH, I have

 /home/pol/Downloads/db/pg/15.1/inst/bin

I also set $LD_LIBRARY_PATH to

 /home/pol/Downloads/db/pg/15.1/inst/lib

I cloned the repo and am following the steps for a local install.

I installed all of the dependencies and Rust without a problem.

Then I arrived at the step

 BUILD_TYPE=release make -j`nproc`

and the following happens:

[pol@fedora neon]$ BUILD_TYPE=release make -j`nproc`
Configuring Postgres v14 build
mkdir -p /home/pol/Downloads/db/pg/neon//pg_install//build/v14
Configuring Postgres v15 build
mkdir -p /home/pol/Downloads/db/pg/neon//pg_install//build/v15
(cd /home/pol/Downloads/db/pg/neon//pg_install//build/v14 && \
env PATH=":$PATH" /home/pol/Downloads/db/pg/neon//vendor/postgres-v14/configure \
	CFLAGS='-O2 -g3 ' \
	--enable-debug --with-openssl --with-libseccomp INSTALL='/home/pol/Downloads/db/pg/neon//scripts/ninstall.sh -C' \
	--prefix=/home/pol/Downloads/db/pg/neon/pg_install/v14 > configure.log)
(cd /home/pol/Downloads/db/pg/neon//pg_install//build/v15 && \
env PATH=":$PATH" /home/pol/Downloads/db/pg/neon//vendor/postgres-v15/configure \
	CFLAGS='-O2 -g3 ' \
	--enable-debug --with-openssl --with-libseccomp INSTALL='/home/pol/Downloads/db/pg/neon//scripts/ninstall.sh -C' \
	--prefix=/home/pol/Downloads/db/pg/neon/pg_install/v15 > configure.log)
env: env: β€˜/home/pol/Downloads/db/pg/neon//vendor/postgres-v14/configureβ€™β€˜/home/pol/Downloads/db/pg/neon//vendor/postgres-v15/configure’: No such file or directory
: No such file or directory
make: *** [Makefile:75: /home/pol/Downloads/db/pg/neon//pg_install//build/v14/config.status] Error 127
make: *** Waiting for unfinished jobs....
make: *** [Makefile:84: /home/pol/Downloads/db/pg/neon//pg_install//build/v15/config.status] Error 127
[pol@fedora neon]$

I tried modifying the Makefile, but after a few attempts, I gave up. Can anyone tell me where the problem is? There’s mention of a patched version of PostgreSQL - I don’t have one - or does the make process patch the one on my $PATH?

Any help with this issue appreciated. Should you require any futher information, please reply here.

Hello!

Would you mind double-checking that you’ve cloned the submodules with the patched PostgreSQL as well? neon/vendor/postgres-v14 and neon/vendor/postgres-v15 should contain a bunch of code, including the configure file in each.

If these folders are empty, run git submodule update --recursive in the repository to download submodules and try running make again.

Hi, and thanks for getting back to me.

Would you mind double-checking that you’ve cloned the submodules with the patched PostgreSQL as well? neon/vendor/postgres-v14 and neon/vendor/postgres-v15 should contain a bunch of code, including the configure file in each.


I read here

https://github.com/neondatabase/neon

that the preferred default is debug, so instead of trying to run a release build, I deleted my repo and recloned. I checked the neon/vendor/postgres-v14/v15 folders and nothing.

If these folders are empty, run git submodule update --recursive in the repository to download submodules and try running make again.

So, I ran the git submodule update --recursive in my repo’s root and it returned to the prompt immediately - no sign of any git downloading activity. I double-checked the folders anyway and nothing in either.

I ran

make -j`nproc`

command again anyway, but obtained the same error!

I’ve tried various permutations of deleting the repo, recloning and running different commands and the two types of build. Again, nothing in the v14/v15 directories and always returning the error.

I’m curious as to why the patched PostgreSQL doesn’t come down with the git clone process - shouldn’t it? I’ve cloned repos before and had no issues - I’m running the default HEAD branch - not exactly sure what’s going on!

I would be grateful for any further input you might have on the matter and thanks again.

I’m curious as to why the patched PostgreSQL doesn’t come down with the git clone process - shouldn’t it?

It’s a git submodule, they’re not cloned by default, only with git clone --recursive.

no sign of any git downloading activity

Ah, sorry, forgot about one other command: try git submodule initin the repository (should say something like β€œSubmodule … registered for path vendor/postgres-v14”, and for v15 as well) followed by git submodule update --recursive --progress.

When I clone the neon repository as follows, git automatically clones the PostgreSQL submodules, too:

$ git clone --recurse-submodules git@github.com:neondatabase/neon.git
Cloning into 'neon'...
Enter passphrase for key '/home/matthias/.ssh/id_ed25519':
remote: Enumerating objects: 33625, done.
remote: Counting objects: 100% (801/801), done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 33625 (delta 532), reused 637 (delta 436), pack-reused 32824
Receiving objects: 100% (33625/33625), 16.72 MiB | 255.00 KiB/s, done.
Resolving deltas: 100% (24449/24449), done.
Submodule 'vendor/postgres-v14' (https://github.com/neondatabase/postgres.git) registered for path 'vendor/postgres-v14'
Submodule 'vendor/postgres-v15' (https://github.com/neondatabase/postgres.git) registered for path 'vendor/postgres-v15'
Cloning into '/home/matthias/test/neon/vendor/postgres-v14'...
remote: Enumerating objects: 904130, done.
remote: Counting objects: 100% (1847/1847), done.
remote: Compressing objects: 100% (1146/1146), done.
...

Something I do note, though, is that this tries to clone the whole PostgreSQL sources twice, which is fairly expensive due to the size of the history of that repository. You might want to limit the cloned data to only a few commits instead of all historical data:

$ git submodule init
$ git submodule update --depth 10 --recursive --progress
Cloning into '/home/matthias/test/neon/vendor/postgres-v14'...
remote: Enumerating objects: 6694, done.
remote: Counting objects: 100% (6694/6694), done.
remote: Compressing objects: 100% (5601/5601), done.
...
1 Like

Hi, and thanks for your input.

You were bang on about the --depth 10 - the entire download without it was 2.3GB! :slight_smile:

Now, I ran the release build, but apparently only v14 was actually built! This is fine for the time being, but there’s a new problem. Maybe because the release build isn’t the default? But that’s another day’s work - I can use the v14 build for the moment!

I set my paths ( PATH and LD_LIBRARY_PATH) appropriately, but the next section is Running neon database and it has

> ./target/debug/neon_local init

Now, there is no neon_local script anywhere in the built repo - I searched from the root. Neither is there an init script - there’s init directories alright, but no script (or other file) that I could find!

Maybe the BUILD=RELEASE make -jnproc process creates an init script with a different name for the release? Or have I misunderstood the build process?

I’m going to build the default debug release and report back - but ultimately I would like to run the release build. But, it’s late, so I’ll kick it off, but will have to report back tomorrow!

Any help on this much appreciated.

Hi again, and thanks for your efforts on my behalf!

See my answer to @Matthias for the details of the process - maybe you could weigh in?

I’m going to build the default debug release and report back - but ultimately I would like to run the release build. But, it’s late, so I’ll kick it off, but will have to report back tomorrow!

Any further input appreciated!

If you want the release version, it’s BUILD_TYPE=release, not BUILD=RELEASE (case-sensitive).
neon_local is not a script; it’s a binary executable compiled from Rust.

The BUILD_TYPE=release make -j$(nproc) command should create a target directory in the repository’s root (next to test_runner and scripts directories), which contains either debug or release directory with the binaries. Here is how it looks on my machine in a freshly cloned and built repository:

.
β”œβ”€β”€ CODEOWNERS
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ Cargo.lock
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ Dockerfile.compute-node-v14
β”œβ”€β”€ Dockerfile.compute-node-v15
β”œβ”€β”€ Dockerfile.compute-tools
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ NOTICE
β”œβ”€β”€ README.md
β”œβ”€β”€ cli-v2-story.md
β”œβ”€β”€ compute_tools
β”‚   └── ...
β”œβ”€β”€ control_plane
β”‚   └── ...
β”œβ”€β”€ docker-compose
β”‚   └── ...
β”œβ”€β”€ docs
β”‚   └── ...
β”œβ”€β”€ libs
β”‚   └── ...
β”œβ”€β”€ pageserver
β”‚   └── ...
β”œβ”€β”€ pg_install
β”‚   └── ...
β”œβ”€β”€ pgxn
β”‚   └── ...
β”œβ”€β”€ poetry.lock
β”œβ”€β”€ pre-commit.py
β”œβ”€β”€ proxy
β”‚   └── ...
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ pytest.ini
β”œβ”€β”€ run_clippy.sh
β”œβ”€β”€ rust-toolchain.toml
β”œβ”€β”€ safekeeper
β”‚   └── ...
β”œβ”€β”€ scripts
β”‚   └── ...
β”œβ”€β”€ setup.cfg
β”œβ”€β”€ target
β”‚   β”œβ”€β”€ CACHEDIR.TAG
β”‚   └── release
β”‚       β”œβ”€β”€ build
β”‚       β”œβ”€β”€ compute_ctl
β”‚       β”œβ”€β”€ compute_ctl.d
β”‚       β”œβ”€β”€ deps
β”‚       β”œβ”€β”€ draw_timeline_dir
β”‚       β”œβ”€β”€ draw_timeline_dir.d
β”‚       β”œβ”€β”€ examples
β”‚       β”œβ”€β”€ incremental
β”‚       β”œβ”€β”€ libcompute_tools.d
β”‚       β”œβ”€β”€ libcompute_tools.rlib
β”‚       β”œβ”€β”€ libcontrol_plane.d
β”‚       β”œβ”€β”€ libcontrol_plane.rlib
β”‚       β”œβ”€β”€ libetcd_broker.d
β”‚       β”œβ”€β”€ libetcd_broker.rlib
β”‚       β”œβ”€β”€ libmetrics.d
β”‚       β”œβ”€β”€ libmetrics.rlib
β”‚       β”œβ”€β”€ libpageserver.d
β”‚       β”œβ”€β”€ libpageserver.rlib
β”‚       β”œβ”€β”€ libpageserver_api.d
β”‚       β”œβ”€β”€ libpageserver_api.rlib
β”‚       β”œβ”€β”€ libpostgres_ffi.d
β”‚       β”œβ”€β”€ libpostgres_ffi.rlib
β”‚       β”œβ”€β”€ libpq_proto.d
β”‚       β”œβ”€β”€ libpq_proto.rlib
β”‚       β”œβ”€β”€ libremote_storage.d
β”‚       β”œβ”€β”€ libremote_storage.rlib
β”‚       β”œβ”€β”€ libsafekeeper.d
β”‚       β”œβ”€β”€ libsafekeeper.rlib
β”‚       β”œβ”€β”€ libsafekeeper_api.d
β”‚       β”œβ”€β”€ libsafekeeper_api.rlib
β”‚       β”œβ”€β”€ libtenant_size_model.d
β”‚       β”œβ”€β”€ libtenant_size_model.rlib
β”‚       β”œβ”€β”€ libutils.d
β”‚       β”œβ”€β”€ libutils.rlib
β”‚       β”œβ”€β”€ libwal_craft.d
β”‚       β”œβ”€β”€ libwal_craft.rlib
β”‚       β”œβ”€β”€ libworkspace_hack.d
β”‚       β”œβ”€β”€ libworkspace_hack.rlib
β”‚       β”œβ”€β”€ neon_local
β”‚       β”œβ”€β”€ neon_local.d
β”‚       β”œβ”€β”€ pageserver
β”‚       β”œβ”€β”€ pageserver.d
β”‚       β”œβ”€β”€ pageserver_binutils
β”‚       β”œβ”€β”€ pageserver_binutils.d
β”‚       β”œβ”€β”€ proxy
β”‚       β”œβ”€β”€ proxy.d
β”‚       β”œβ”€β”€ safekeeper
β”‚       β”œβ”€β”€ safekeeper.d
β”‚       β”œβ”€β”€ tenant_size_model
β”‚       β”œβ”€β”€ tenant_size_model.d
β”‚       β”œβ”€β”€ wal_craft
β”‚       └── wal_craft.d
β”œβ”€β”€ test_runner
β”‚   └── ...
β”œβ”€β”€ vendor
β”‚   β”œβ”€β”€ postgres-v14
β”‚   β”‚   β”œβ”€β”€ COPYRIGHT
β”‚   β”‚   β”œβ”€β”€ GNUmakefile.in
β”‚   β”‚   β”œβ”€β”€ HISTORY
β”‚   β”‚   β”œβ”€β”€ Makefile
β”‚   β”‚   β”œβ”€β”€ README
β”‚   β”‚   β”œβ”€β”€ README.git
β”‚   β”‚   β”œβ”€β”€ aclocal.m4
β”‚   β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ configure
β”‚   β”‚   β”œβ”€β”€ configure.ac
β”‚   β”‚   β”œβ”€β”€ contrib
β”‚   β”‚   β”œβ”€β”€ doc
β”‚   β”‚   └── src
β”‚   └── postgres-v15
β”‚       β”œβ”€β”€ COPYRIGHT
β”‚       β”œβ”€β”€ GNUmakefile.in
β”‚       β”œβ”€β”€ HISTORY
β”‚       β”œβ”€β”€ Makefile
β”‚       β”œβ”€β”€ README
β”‚       β”œβ”€β”€ README.git
β”‚       β”œβ”€β”€ aclocal.m4
β”‚       β”œβ”€β”€ config
β”‚       β”œβ”€β”€ configure
β”‚       β”œβ”€β”€ configure.ac
β”‚       β”œβ”€β”€ contrib
β”‚       β”œβ”€β”€ doc
β”‚       └── src
└── workspace_hack
β”‚   └── ...

116 directories, 377 files

Hi again, he says sheepishly…

This gave me the clue that I needed to get the system working! I have read that Rust takes quite a while to compile relative to C for example. I eyeballed my earlier attempts at compiling (make...) and the system flew through them, taking even less time than it usually takes me to compile a normal PostgreSQL cluster.

I double checked this page:

https://www.rust-lang.org/tools/install

esp. the parts about Configuring the PATH environment variable… I tried to run

`rustc --version` 

and got

command not found 

hangs head in shame…

So, I put my Rust install on my PATH and bingo! System took about 15 mins to complile with lots of Compiling rustc... - and the system ran - smooth sailing!

The reason I made this schoolboy error was that I thought that the Rust install process would do all the path setup and whatnot, and I also thought that the pgx system β€œturned” (transpiled?) Rust into C (there’s a directory - pgxn in neon) - so initially I thought the fact that there was nothing other than C during the compilation wasn’t necessarily indicative that something was wrong! Plus, I’m not used to using the -jnproc option which is why the fact that it flew through the compile didn’t raise a red flag at first.

Anyway, thanks for all your help - really appreciate it. Like what I’m seeing so far though! :slight_smile:

Couple of thoughts - might help eejits like me into the future and not clog up your lists with n00b questions

  • On the GitHub page, emphasise the recursive bit here git clone --recursive https://github.com/neondatabase/neon.git, maybe β€œgit clone –recursive https…” - basically, I just saw the .git, copied and pasted it. I know I should have actually read it, but it might help?

  • have a check for the Rust toolchain in the make? Again for muppets like me, but it might save some grief?

Just a couple of thoughts - Best…

1 Like

Hi again, and thanks for your input.

Check out my latest answer to @yeputons about how I eventually got the system working (:clown_face:) - but I did notice one thing which may (or may not) be relevant to what you wrote above.

I was eye-balling the cloning process (which I went through a number of times) and at first it seemed to me also that there was some sort of double download, but I think it might be the fact that it’s downloading two versions of PostgreSQL (14 & 15) and that may be the double download?

Anyway, thanks again - best…

Yes, there should be a download for each PostgreSQL version, so that’s why it looks like a double download, I think.

Glad to hear everything worked out! And thank you for the suggestions, a fresh look is good.

Hi - I tried using

git clone --recursive --depth 2 https://github.com/neondatabase/neon.git

and that worked fine. Maybe --depth 1 would work also?

Might be worth putting a note on the GitHub page suggesting that those who aren’t going to be developing/contributing should use one of these options - saves bandwidth both on their end and yours?

Best…