Skip to content

Commit a2eb125

Browse files
committed
Handle nested build paths
1 parent 8ef373f commit a2eb125

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

spin/cmds/meson.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ def build(
293293
Which can then be used to build (`spin-clang build`), to test (`spin-clang test ...`), etc.
294294
295295
"""
296+
abs_build_dir = os.path.abspath(build_dir)
296297
install_dir = _get_install_dir(build_dir)
298+
abs_install_dir = os.path.abspath(install_dir)
299+
297300
cfg = get_config()
298301
distname = cfg.get("project.name", None)
299302
if distname and _is_editable_install_of_same_source(distname):
@@ -355,7 +358,7 @@ def build(
355358
"--destdir",
356359
install_dir
357360
if os.path.isabs(install_dir)
358-
else os.path.join("..", install_dir),
361+
else os.path.relpath(abs_install_dir, abs_build_dir),
359362
],
360363
output=(not quiet) and verbose,
361364
)

spin/tests/test_build_cmds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,18 @@ def test_lldb():
159159
@skip_py_lt_311 # python command does not run on older pythons
160160
def test_parallel_builds():
161161
spin("build")
162-
spin("build", "-C", "parallel-build")
162+
spin("build", "-C", "parallel/build")
163163
p = spin("python", "--", "-c", "import example_pkg; print(example_pkg.__file__)")
164164
example_pkg_path = stdout(p).split("\n")[-1]
165165
p = spin(
166166
"python",
167167
"-C",
168-
"parallel-build",
168+
"parallel/build",
169169
"--",
170170
"-c",
171171
"import example_pkg; print(example_pkg.__file__)",
172172
)
173173
example_pkg_parallel_path = stdout(p).split("\n")[-1]
174174
assert "build-install" in example_pkg_path
175-
assert "parallel-build-install" in example_pkg_parallel_path
176-
assert "parallel-build-install" not in example_pkg_path
175+
assert "parallel/build-install" in example_pkg_parallel_path
176+
assert "parallel/build-install" not in example_pkg_path

0 commit comments

Comments
 (0)