Skip to content

Commit e094949

Browse files
committed
BUG: fix a problem with symlink support
Modifies the existing `symlinks` test package so it exercises the bug. The situation without a `version` keyword in `meson.build` is more difficult because the dist tarball generated by Meson will be named `<project-name>-undefined.tar.gz`, which meson-python then changes to `<project-name-version.tar.gz`.
1 parent 965c472 commit e094949

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

mesonpy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,9 @@ def sdist(self, directory: Path) -> pathlib.Path:
966966
warnings.warn(
967967
f'symbolic link pointing to a directory ignored: {name}', stacklevel=1)
968968

969+
# Copy `member` before starting to modify it
970+
member = copy.copy(member)
971+
969972
if member.isfile():
970973
file = meson_dist.extractfile(member.name)
971974

tests/packages/symlinks/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
project('symlinks', version: '1.0.0')
5+
project('symlinks')
66

77
py = import('python').find_installation()
88

tests/packages/symlinks/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
[build-system]
66
build-backend = 'mesonpy'
77
requires = ['meson-python']
8+
9+
[project]
10+
name = 'symlinks'
11+
version = '1.0.0'

0 commit comments

Comments
 (0)