Ubuntu Server - Blender as a Python Module: Build Errors

Hi Blender Developer community!

I have been trying to build Blender as a Python module on MacOS, Windows and Linux.

When building the master branch on Ubuntu Server however, I get a strange error when trying to import bpy.so

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/tylergubala/.blenderpy/master/build_linux_bpy_custom_test/venv/lib/python3.7/site-packages/bpy.so: undefined symbol: BKE_main_idmap_lookup_id

My build script is the following, and everything seems to be going fine during the build:

mkdir .blenderpy
mkdir .blenderpy/master
cd .blenderpy/master
git clone http://git.blender.org/blender.git
cd blender
git submodule update --remote
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master
make update
cd ..
mkdir build_linux_bpy_custom
cd build_linux_bpy_custom


make install -j4 | tee ../build_linux_bpy_custom_build.log

mkdir ../build_linux_bpy_custom_test

python3.7 -m venv ../build_linux_bpy_custom_test/venv

cp bin/bpy.so ../build_linux_bpy_custom_test/venv/lib/python3.7/site-packages
cp -R bin/2.82 ../build_linux_bpy_custom_test/venv/lib/python3.7/site-packages

../build_linux_bpy_custom_test/venv/bin/python3.7 -c "import bpy; bpy.ops.render.render(write_still=True)" | tee ../build_linux_bpy_custom_test.log

I’m wondering what I could be doing wrong? The v2.80 tag works fine with the above script, just normal color management warnings.

Here are the warnings on v2.80

Python 3.7.5 (default, Nov  7 2019, 10:50:52)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bpy
Color management: using fallback mode for management
Color management: Error could not find role data role.
/run/user/1000/gvfs/ non-existent directory
Color management: scene view "Filmic" not found, setting default "Standard".
>>> quit()
Error: Not freed memory blocks: 8, total unfreed memory 0.010223 MB

Thanks in advance.