Skip to content

Commit 2e06132

Browse files
committed
Use meson dep & repair malformed shims
Replace direct git dependency on a meson fork with the standard meson package in contourpy and pandas recipes (recipes/contourpy/meta.yaml, recipes/pandas/meta.yaml). In src/forge/build.py add handling to detect and repair a legacy malformed shim where the separator line was accidentally merged with Python code (e.g. "' '''import sys"). The builder now logs the repair and rewrites the shim with a proper separator line (and preserves any trailing suffix). Also small formatting/newline adjustments to shim writing were made to ensure correct output.
1 parent ecfa8f9 commit 2e06132

3 files changed

Lines changed: 21 additions & 4 deletions

File tree

recipes/contourpy/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requirements:
66
build:
77
- ninja
88
- cmake
9-
- git+https://github.com/flet-dev/meson@ios-dynamiclib
9+
- meson
1010
host:
1111
- pybind11
1212
# {% if sdk == 'android' %}
@@ -16,4 +16,4 @@ requirements:
1616
build:
1717
backend-args:
1818
- -Csetup-args=--cross-file
19-
- -Csetup-args={MESON_CROSS_FILE}
19+
- -Csetup-args={MESON_CROSS_FILE}

recipes/pandas/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package:
88
requirements:
99
build:
1010
- ninja
11-
- git+https://github.com/flet-dev/meson@ios-dynamiclib
11+
- meson
1212
host:
1313
- numpy ^2.0.0
1414
# {% if sdk == 'android' %}

src/forge/build.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,27 @@ def fix_host_tool_shims(self):
104104
[
105105
"#!/bin/sh\n",
106106
"'''exec' {} \"$0\" \"$@\"\n".format(python_path),
107-
"' '''\n",
107+
"' '''\n\n",
108108
]
109109
+ lines[1:]
110110
)
111+
elif (
112+
len(lines) > 2
113+
and lines[0].strip() == "#!/bin/sh"
114+
and lines[1].startswith("'''exec' ")
115+
and lines[2].startswith("' '''")
116+
and lines[2].strip() != "' '''"
117+
):
118+
# Repair legacy malformed shim output where the separator line was
119+
# accidentally merged with Python code (e.g. "' '''import sys").
120+
log(self.log_file, f"Repairing malformed host shim: {shim}")
121+
suffix = lines[2][len("' '''") :]
122+
repaired = [lines[0], lines[1], "' '''\n"]
123+
if suffix:
124+
repaired.append(suffix)
125+
repaired += lines[3:]
126+
with open(shim, "w") as f:
127+
f.writelines(repaired)
111128

112129
@abstractmethod
113130
def download_source_url(self): ...

0 commit comments

Comments
 (0)