Skip to content

Commit 0a6331e

Browse files
committed
FIX: PR #744 review — reconcile consolidate count (25->28 win-arm64), idempotent conda_builder, neutral TLS wording + }} brace escaping
1 parent d6d1d69 commit 0a6331e

3 files changed

Lines changed: 25 additions & 9 deletions

File tree

‎OneBranchPipelines/jobs/consolidate-conda-artifacts-job.yml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313
# package (which vendors the ODBC payload) is emitted per-Python by each build leg;
1414
# there is NO separate companion package:
1515
# win-64 : 5 py x mssql-python = 5
16+
# win-arm64 : 3 py x mssql-python (py3.12-3.14, cross-built on x64) = 3
1617
# osx-64 : 5 py x mssql-python (Intel Mac, cross-built via Rosetta) = 5
1718
# osx-arm64 : 5 py x mssql-python (Apple Silicon, native) = 5
1819
# linux-64 : 5 py x mssql-python (glibc x86_64 host, native) = 5
1920
# linux-aarch64 : 5 py x mssql-python (x86_64 host + QEMU, best-effort) = 5
2021
# ------------------------------------------------------------------------------
21-
# TOTAL (PyPI parity minus win-arm64 + musllinux) = 25
22-
# win-arm64 (no import-validation host on x64) and musllinux (no conda musl subdir)
23-
# are intentionally NOT conda-built. This job is BEST-EFFORT and never hard-fails on
24-
# a short set; the release pipeline's conda-release-step enforces the hard gate
25-
# (required subdirs present + complete Python matrix) before anything is published.
22+
# TOTAL (PyPI parity minus musllinux) = 28
23+
# win-arm64 is cross-built for py3.12-3.14 only (py3.10/3.11 have no win-arm64 deps
24+
# on Anaconda defaults); its runtime import is skipped on the x64 host, so its arch
25+
# is enforced by the PE-machine assert (assert_pe_machine.py). musllinux (no conda
26+
# musl subdir) is intentionally NOT conda-built. This job is BEST-EFFORT and never
27+
# hard-fails on a short set; the release pipeline's conda-release-step enforces the
28+
# hard gate (required subdirs present + complete Python matrix) before publish.
2629
parameters:
2730
- name: oneBranchType
2831
type: string

‎OneBranchPipelines/scripts/build-conda-packages.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ echo "Using conda: $conda"
139139
# rides along so the RUNPATH audit reads .conda metadata from this same env.
140140
condaBuildEnv="conda_builder"
141141
echo "=== creating dedicated conda-build env ($condaBuildEnv: conda-build<26) ==="
142+
# Idempotent: a reused agent/workdir may already have this env, and a pre-existing
143+
# env makes `conda create` fail under `set -e`. Remove it first (best-effort, like
144+
# the verify envs below) so a rerun recreates cleanly.
145+
"$conda" env remove -y -n "$condaBuildEnv" 2>/dev/null || true
142146
"$conda" create -y -n "$condaBuildEnv" -c conda-forge --override-channels "conda-build<26" zstandard
143147

144148
# ---------------------------------------------------------------------------

‎conda/tls_connect_probe.py‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def describe(exc):
105105
low = msg.lower()
106106
for marker in _OPENSSL_UNREACHABLE_MARKERS:
107107
if marker in low:
108-
return "OpenSSL backend unreachable -> " + msg[:300]
108+
return "TLS handshake did not complete -> " + msg[:300]
109109
return msg[:300]
110110

111111

@@ -114,23 +114,32 @@ def _split_top_level(conn):
114114
115115
An ODBC value wrapped in ``{...}`` may itself contain ``;`` (MS-ODBCSTR), so a
116116
naive ``split(';')`` would shred braced values. Track brace depth and break only
117-
at depth 0.
117+
at depth 0. Inside a braced value ``}}`` is an escaped literal ``}`` (MS-ODBCSTR),
118+
NOT a close -- consume both and keep the depth so the value is not split early.
118119
"""
119120
segments = []
120121
buf = ""
121122
depth = 0
122-
for ch in conn.strip():
123+
s = conn.strip()
124+
i = 0
125+
while i < len(s):
126+
ch = s[i]
123127
if ch == "{":
124128
depth += 1
125129
buf += ch
126130
elif ch == "}":
131+
if depth > 0 and i + 1 < len(s) and s[i + 1] == "}":
132+
buf += "}}" # escaped literal '}' inside a braced value; not a close
133+
i += 2
134+
continue
127135
depth = max(0, depth - 1)
128136
buf += ch
129137
elif ch == ";" and depth == 0:
130138
segments.append(buf)
131139
buf = ""
132140
else:
133141
buf += ch
142+
i += 1
134143
segments.append(buf)
135144
return segments
136145

@@ -279,7 +288,7 @@ def main():
279288
if tls_completed(outcome):
280289
print("TLS_OK (OpenSSL backend reachable; " + describe(outcome) + ")")
281290
return
282-
sys.exit("TLS/OPENSSL BACKEND UNREACHABLE: " + describe(outcome))
291+
sys.exit("TLS HANDSHAKE DID NOT COMPLETE: " + describe(outcome))
283292

284293

285294
if __name__ == "__main__":

0 commit comments

Comments
 (0)