diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-05-16 16:01:20 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-05-16 16:51:31 +0900 |
commit | b7e75da3f75495097874957591a6b861c156dc5f (patch) | |
tree | 7b0e324fb774c1818d048750df8f3220f1caa64d /tests/examples/flatpak-autotools.py | |
parent | bb8bd1cf46538540ec042d37e8a5f29df6e9e0f2 (diff) | |
download | buildstream-b7e75da3f75495097874957591a6b861c156dc5f.tar.gz |
tests/examples/flatpak-autotools.py: Workaround setuptools bug
Until the setuptools bug is fixed, symlinks are not included
in source distributions - this works around the problem until which
point we can use a setuptools version without the bug.
Diffstat (limited to 'tests/examples/flatpak-autotools.py')
-rw-r--r-- | tests/examples/flatpak-autotools.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py index 8cda7d150..3965725c7 100644 --- a/tests/examples/flatpak-autotools.py +++ b/tests/examples/flatpak-autotools.py @@ -14,6 +14,22 @@ DATA_DIR = os.path.join( ) +# FIXME: Workaround a setuptools bug which fails to include symbolic +# links in the source distribution. +# +# Remove this hack once setuptools is fixed +def workaround_setuptools_bug(project): + os.makedirs(os.path.join(project, "files", "links"), exist_ok=True) + try: + os.symlink(os.path.join("usr", "lib"), os.path.join(project, "files", "links", "lib")) + os.symlink(os.path.join("usr", "bin"), os.path.join(project, "files", "links", "bin")) + os.symlink(os.path.join("usr", "etc"), os.path.join(project, "files", "links", "etc")) + except FileExistsError: + # If the files exist, we're running from a git checkout and + # not a source distribution, no need to complain + pass + + # Test that a build upon flatpak runtime 'works' - we use the autotools sample # amhello project for this. @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @@ -21,6 +37,7 @@ DATA_DIR = os.path.join( def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') + workaround_setuptools_bug(project) result = cli.run(project=project, args=['build', 'hello.bst']) assert result.exit_code == 0 @@ -40,6 +57,7 @@ def test_autotools_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) + workaround_setuptools_bug(project) result = cli.run(project=project, args=['build', 'hello.bst']) assert result.exit_code == 0 |