diff --git a/man/meson.1 b/man/meson.1
index 0b2a3e4d8..d721e89c2 100644
--- a/man/meson.1
+++ b/man/meson.1
@@ -1,4 +1,4 @@
-.TH MESON "1" "January 2017" "meson 0.38.0" "User Commands"
+.TH MESON "1" "December 2016" "meson 0.37.1" "User Commands"
 .SH NAME
 meson - a high productivity build system
 .SH DESCRIPTION
diff --git a/man/mesonintrospect.1 b/man/mesonintrospect.1
index 8f9cfe805..a9ee2c237 100644
--- a/man/mesonintrospect.1
+++ b/man/mesonintrospect.1
@@ -1,4 +1,4 @@
-.TH MESONCONF "1" "January 2017" "mesonintrospect 0.38.0" "User Commands"
+.TH MESONCONF "1" "December 2016" "mesonintrospect 0.37.1" "User Commands"
 .SH NAME
 mesonintrospect - a tool to extract information about a Meson build
 .SH DESCRIPTION
diff --git a/man/wraptool.1 b/man/wraptool.1
index 35b56956a..e211ea3aa 100644
--- a/man/wraptool.1
+++ b/man/wraptool.1
@@ -1,4 +1,4 @@
-.TH WRAPTOOL "1" "January 2017" "meson 0.38.0" "User Commands"
+.TH WRAPTOOL "1" "December 2016" "meson 0.37.1" "User Commands"
 .SH NAME
 wraptool - source dependency downloader
 .SH DESCRIPTION
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index cae40095e..02ea6ba22 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2017 The Meson development team
+# Copyright 2012-2016 The Meson development team
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,9 +13,10 @@
 # limitations under the License.
 
 import pickle, os, uuid
-from .mesonlib import MesonException, default_libdir, default_libexecdir, default_prefix
+from .mesonlib import MesonException, commonpath
+from .mesonlib import default_libdir, default_libexecdir, default_prefix
 
-version = '0.38.1'
+version = '0.38.0.dev1'
 backendlist = ['ninja', 'vs2010', 'vs2015', 'xcode']
 
 class UserOption:
@@ -158,7 +159,7 @@ class CoreData:
         if option.endswith('dir') and os.path.isabs(value) and \
            option not in builtin_dir_noprefix_options:
             # Value must be a subdir of the prefix
-            if os.path.commonpath([value, prefix]) != prefix:
+            if commonpath([value, prefix]) != prefix:
                 m = 'The value of the {!r} option is {!r} which must be a ' \
                     'subdir of the prefix {!r}.\nNote that if you pass a ' \
                     'relative path, it is assumed to be a subdir of prefix.'
@@ -194,9 +195,9 @@ class CoreData:
         elif optname in self.builtins:
             prefix = self.builtins['prefix'].value
             value = self.sanitize_dir_option_value(prefix, optname, value)
-            self.builtins[optname].set_value(value)
         else:
             raise RuntimeError('Tried to set unknown builtin option %s.' % optname)
+        self.builtins[optname].set_value(value)
 
 def load(filename):
     load_fail_msg = 'Coredata file {!r} is corrupted. Try with a fresh build tree.'.format(filename)
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 2ad43c823..f0b20e1bd 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -496,3 +496,28 @@ def Popen_safe(args, write=None, stderr=subprocess.PIPE, **kwargs):
                          stderr=stderr, **kwargs)
     o, e = p.communicate(write)
     return p, o, e
+
+def commonpath(paths):
+    '''
+    For use on Python 3.4 where os.path.commonpath is not available.
+    We currently use it everywhere so this receives enough testing.
+    '''
+    # XXX: Replace me with os.path.commonpath when we start requiring Python 3.5
+    import pathlib
+    if not paths:
+        raise ValueError('arg is an empty sequence')
+    common = pathlib.PurePath(paths[0])
+    for path in paths[1:]:
+        new = []
+        path = pathlib.PurePath(path)
+        for c, p in zip(common.parts, path.parts):
+            if c != p:
+                break
+            new.append(c)
+        # Don't convert '' into '.'
+        if not new:
+            common = ''
+            break
+        new = os.path.join(*new)
+        common = pathlib.PurePath(new)
+    return str(common)
diff --git a/setup.py b/setup.py
index 300ddf1bc..e9bbdb4f0 100644
--- a/setup.py
+++ b/setup.py
@@ -74,7 +74,7 @@ setup(name='meson',
       data_files=[('share/man/man1', ['man/meson.1',
                                       'man/mesonconf.1',
                                       'man/mesonintrospect.1',
-                                      'man/mesontest.1',
+                                      'main/mesontest.1',
                                       'man/wraptool.1'])],
       classifiers=['Development Status :: 5 - Production/Stable',
                    'Environment :: Console',

AttributeError: 'module' object has no attribute 'commonpath'
```python
Traceback (most recent call last):
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/mesonmain.py", line 286, in run
    app.generate()
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/mesonmain.py", line 160, in generate
    intr = interpreter.Interpreter(b, g)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreter.py", line 1198, in __init__
    self.parse_project()
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 111, in parse_project
    self.evaluate_codeblock(self.ast, end=1)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 146, in evaluate_codeblock
    raise e
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 140, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 151, in evaluate_statement
    return self.function_call(cur)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 372, in function_call
    return self.funcs[func_name](node, self.flatten(posargs), kwargs)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreterbase.py", line 55, in wrapped
    return f(self, node, args, kwargs)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreter.py", line 1581, in func_project
    self.parse_default_options(kwargs['default_options'])
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/interpreter.py", line 1549, in parse_default_options
    self.coredata.set_builtin_option(key, value)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/coredata.py", line 196, in set_builtin_option
    value = self.sanitize_dir_option_value(prefix, optname, value)
  File "/builddir/build/BUILD/meson-0.38.0/mesonbuild/coredata.py", line 161, in sanitize_dir_option_value
    if os.path.commonpath([value, prefix]) != prefix:
AttributeError: 'module' object has no attribute 'commonpath'
```

I think it happened after one of tests failed
diff --git a/run_tests.py b/run_tests.py
index 2dfbaffad..005717e07 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -20,9 +20,11 @@ from mesonbuild import mesonlib
 
 if __name__ == '__main__':
     returncode = 0
+    print('Running unittests.\n')
     if mesonlib.is_linux():
-        print('Running unittests.\n')
         returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'])
+    else:
+        returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v', 'InternalTests'])
     # Ubuntu packages do not have a binary without -6 suffix.
     if shutil.which('arm-linux-gnueabihf-gcc-6') and not platform.machine().startswith('arm'):
         print('Running cross compilation tests.\n')
diff --git a/run_unittests.py b/run_unittests.py
index a1d99f392..e8659f40a 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -153,6 +153,23 @@ class InternalTests(unittest.TestCase):
         a = ['-Ldir', '-Lbah'] + a
         self.assertEqual(a, ['-Ibar', '-Ifoo', '-Ibaz', '-I..', '-I.', '-Ldir', '-Lbah', '-Werror', '-O3', '-O2', '-Wall'])
 
+    def test_commonpath(self):
+        from os.path import sep
+        commonpath = mesonbuild.mesonlib.commonpath
+        self.assertRaises(ValueError, commonpath, [])
+        self.assertEqual(commonpath(['/usr', '/usr']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr', '/usr/']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr', '/usr/bin']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr/', '/usr/bin']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr/./', '/usr/bin']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr/bin', '/usr/bin']), sep + 'usr' + sep + 'bin')
+        self.assertEqual(commonpath(['/usr//bin', '/usr/bin']), sep + 'usr' + sep + 'bin')
+        self.assertEqual(commonpath(['/usr/./bin', '/usr/bin']), sep + 'usr' + sep + 'bin')
+        self.assertEqual(commonpath(['/usr/local', '/usr/lib']), sep + 'usr')
+        self.assertEqual(commonpath(['/usr', '/bin']), sep)
+        self.assertEqual(commonpath(['/usr', 'bin']), '')
+        self.assertEqual(commonpath(['blam', 'bin']), '')
+
 
 class LinuxlikeTests(unittest.TestCase):
     def setUp(self):

pip install -e .[dev]
parse_log_pytest
pytest
pytest
apt-get update apt-get install -y gcc
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
-e git+https://github.com/mesonbuild/meson.git@380b9157b8a282552e1463ca9a0e486e5b6319e2#egg=meson
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work

name: meson
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
prefix: /opt/conda/envs/meson

run_unittests.py::InternalTests::test_commonpath
run_unittests.py::LinuxlikeTests::test_basic_soname run_unittests.py::LinuxlikeTests::test_build_by_default run_unittests.py::LinuxlikeTests::test_compiler_c_stds run_unittests.py::LinuxlikeTests::test_compiler_check_flags_order run_unittests.py::LinuxlikeTests::test_compiler_cpp_stds run_unittests.py::LinuxlikeTests::test_custom_soname run_unittests.py::LinuxlikeTests::test_custom_target_exe_data_deterministic run_unittests.py::LinuxlikeTests::test_install_introspection run_unittests.py::LinuxlikeTests::test_installed_modes run_unittests.py::LinuxlikeTests::test_installed_soname run_unittests.py::LinuxlikeTests::test_internal_include_order run_unittests.py::LinuxlikeTests::test_libdir_must_be_inside_prefix run_unittests.py::LinuxlikeTests::test_pic run_unittests.py::LinuxlikeTests::test_pkgconfig_gen run_unittests.py::LinuxlikeTests::test_run_target_files_path run_unittests.py::LinuxlikeTests::test_soname run_unittests.py::LinuxlikeTests::test_static_compile_order run_unittests.py::LinuxlikeTests::test_suite_selection run_unittests.py::LinuxlikeTests::test_uninstall run_unittests.py::LinuxlikeTests::test_vala_c_warnings
run_unittests.py::InternalTests::test_compiler_args_class run_unittests.py::InternalTests::test_mode_symbolic_to_bits run_unittests.py::InternalTests::test_version_number run_unittests.py::RewriterTests::test_basic run_unittests.py::RewriterTests::test_subdir
mesonbuild/mesonlib.py mesonbuild/coredata.py man/wraptool.1 setup.py man/meson.1 man/mesonintrospect.1
mesonbuild/mesonlib.py mesonbuild/coredata.py man/wraptool.1 setup.py man/meson.1 man/mesonintrospect.1