You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tools/jtag/mpsse_jtag.py: take the libftdi path from the environment, so B2 reads on Linux #7927
Problem.tools/jtag/mpsse_jtag.py loads libftdi from a fixed Homebrew path:
LIB="/opt/homebrew/lib/libftdi1.2.dylib"
On Linux the file is not there, so read_verdict.py (stage B2 of t27c silicon) fails with OSError: /opt/homebrew/lib/libftdi1.2.dylib: cannot open shared object file. This stopped die C of R3-3 (#7669) in the Linux lab; the run passed only after a symlink at that path inside the container (#7906, "Caveats").
Change (5 lines, one file).
importctypes, ctypes.util, os, sys, time# libftdi1: $T27_LIBFTDI if set; else Homebrew on macOS; else the loader search (Linux).LIB=os.environ.get("T27_LIBFTDI") or (
"/opt/homebrew/lib/libftdi1.2.dylib"ifsys.platform=="darwin"elsectypes.util.find_library("ftdi1") or"libftdi1.so.2")
macOS keeps today's path, so nothing changes on the existing benches.
Why no .t27 first. The file is hand-written Python, and the "Only t27" gate (specs/policy/own_language.t27) refuses it unless tools/policy/foreign-exceptions.txt lists it. There is no Python back end, so a spec cannot generate this file; the port specs/port/tools/jtag/mpsse_jtag.t27 is a stub. So the route is an owner-approved exception for this one file, then the 5-line change (well inside the 40-line budget).
Done when.
tools/jtag/mpsse_jtag.py is listed in foreign-exceptions.txt, approved by the owner (label owner-approved-foreign).
The change above is on master; python3 -c "import sys; sys.path.insert(0,'tools/jtag'); import mpsse_jtag" loads on Linux without a symlink, and t27c silicon B2 passes there.
Given a Linux machine without a symlink at /opt/homebrew/lib/libftdi1.2.dylib, when t27c silicon runs stage B2 (read_verdict.py), then mpsse_jtag.py loads libftdi via ctypes.util.find_library("ftdi1") and the stage passes.
Given T27_LIBFTDI=/usr/lib/x86_64-linux-gnu/libftdi1.so.2 in the environment on Linux, when Python imports mpsse_jtag, then the module uses that exact path and loads successfully.
Requirements
FR-001: tools/jtag/mpsse_jtag.py MUST read T27_LIBFTDI from the environment and use it as the library path when set.
FR-002: On macOS (sys.platform == "darwin"), the default path MUST remain /opt/homebrew/lib/libftdi1.2.dylib.
FR-003: On non-macOS platforms, the default MUST be ctypes.util.find_library("ftdi1") or "libftdi1.so.2" as fallback.
FR-004: tools/jtag/mpsse_jtag.py MUST be listed in tools/policy/foreign-exceptions.txt with owner approval (owner-approved-foreign label).
Success Criteria
python3 -c "import sys; sys.path.insert(0,'tools/jtag'); import mpsse_jtag" runs on Linux without a symlink and exits 0.
Activity
policy: exception for tools/jtag/mpsse_jtag.py so it reads libftdi on…
policy: exception for tools/jtag/mpsse_jtag.py so it reads libftdi on…
policy: exception for tools/jtag/mpsse_jtag.py so it reads libftdi on…
Merge origin/master into fix/jtag-libftdi-env (Refs gHashTag#7927)