Summary
Trying to run genlayer-test's direct-mode pytest fixtures (direct_vm, direct_deploy, etc.) on a stock Windows 11 machine fails in three separate, independent ways depending on which one you work around first. Together they make direct-mode testing completely unusable on Windows out of the box.
Issue 1: ImportError: cannot import name 'Buffer' from 'collections.abc' on Python 3.10
File "...\site-packages\genlayer_py\types\calldata.py", line 4, in <module>
from collections.abc import Sequence, Mapping, Buffer
ImportError: cannot import name 'Buffer' from 'collections.abc'
collections.abc.Buffer was only added in Python 3.12. genlayer-test (via its genlayer-py dependency) can't even be imported on Python 3.10, with no version constraint in the package metadata warning about this. Worked around by switching to Python 3.12.
Issue 2: SDK download 404s on the current default/latest pinned version
Downloading https://github.com/genlayerlabs/genvm/releases/download/v0.3.0-rc7/genvm-universal.tar.xz...
urllib.error.HTTPError: HTTP Error 404: Not Found
The genvm release v0.3.0-rc7 (currently "Latest") only publishes these assets:
genvm-linux-amd64-executor.tar.xz
genvm-linux-amd64.tar.xz
genvm-linux-arm64-executor.tar.xz
genvm-linux-arm64.tar.xz
genvm-macos-arm64-executor.tar.xz
genvm-macos-arm64.tar.xz
genvm-runners-all.tar.xz
There is no genvm-universal.tar.xz and no Windows-specific asset at all. Older releases (e.g. v0.2.16) DO publish a genvm-universal.tar.xz asset — this looks like a regression where the "universal" (presumably cross-platform, needed for Windows) build was dropped starting somewhere around the v0.3.0-rc* release train. Worked around by explicitly passing sdk_version="v0.2.16" to direct_deploy(...), which is not documented as a fallback anywhere.
Issue 3: os.unlink() on a still-open file fails with PermissionError on Windows
After working around issues 1 and 2, contract deployment itself fails:
File "...\site-packages\gltest\direct\loader.py", line 293, in <module>
os.unlink(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\...\AppData\Local\Temp\tmp....'
The code creates a temp file, writes encoded calldata to it, os.dup2()s it onto fd 0 (stdin) for a subprocess to read, then immediately calls os.unlink(path) while the duped file descriptor is still open. This pattern works on POSIX (unlinking an open file just removes the directory entry; the data stays available via the open fd) but Windows enforces file locking and refuses to delete a file that still has an open handle, even via a duplicated fd. This needs either os.close() on the original fd before unlinking, delayed cleanup after the subprocess exits, or a Windows-specific temp-file strategy (e.g. tempfile.NamedTemporaryFile(delete=False) + explicit cleanup after the subprocess consuming it has finished, or piping the calldata directly via subprocess.Popen(..., stdin=PIPE) instead of stdin redirection through a temp file).
Environment
- OS: Windows 11
- Python: 3.12.2800 (issue 1 also reproduced separately on 3.10.0)
genlayer-test version: 0.1.2
Impact
All three issues combined mean genlayer-test's direct-mode pytest fixtures cannot deploy a single contract on a stock Windows setup without manual patching of the installed package or an unsupported SDK version override. This blocks anyone trying to add direct-mode test coverage to a GenLayer contract from a Windows machine, which the direct-tests skill/docs otherwise present as a fully supported first-class workflow ("no server, no Docker — tests run in ~30-50ms").
Ask
- Add a Python version floor (>=3.12) to package metadata, or drop the
Buffer import dependency for broader compatibility.
- Restore a
genvm-universal.tar.xz (or platform-specific Windows) asset in current genvm releases, or make genlayer-test pin/select an SDK version that's known to have a working asset for the host platform instead of always defaulting to "latest".
- Fix the temp-file lifecycle in
gltest/direct/loader.py (~line 293) to be Windows-safe (close-before-unlink, or defer cleanup, or avoid stdin-via-tempfile entirely).
Summary
Trying to run
genlayer-test's direct-mode pytest fixtures (direct_vm,direct_deploy, etc.) on a stock Windows 11 machine fails in three separate, independent ways depending on which one you work around first. Together they make direct-mode testing completely unusable on Windows out of the box.Issue 1:
ImportError: cannot import name 'Buffer' from 'collections.abc'on Python 3.10collections.abc.Bufferwas only added in Python 3.12.genlayer-test(via itsgenlayer-pydependency) can't even be imported on Python 3.10, with no version constraint in the package metadata warning about this. Worked around by switching to Python 3.12.Issue 2: SDK download 404s on the current default/latest pinned version
The
genvmreleasev0.3.0-rc7(currently "Latest") only publishes these assets:There is no
genvm-universal.tar.xzand no Windows-specific asset at all. Older releases (e.g.v0.2.16) DO publish agenvm-universal.tar.xzasset — this looks like a regression where the "universal" (presumably cross-platform, needed for Windows) build was dropped starting somewhere around thev0.3.0-rc*release train. Worked around by explicitly passingsdk_version="v0.2.16"todirect_deploy(...), which is not documented as a fallback anywhere.Issue 3:
os.unlink()on a still-open file fails withPermissionErroron WindowsAfter working around issues 1 and 2, contract deployment itself fails:
The code creates a temp file, writes encoded calldata to it,
os.dup2()s it onto fd 0 (stdin) for a subprocess to read, then immediately callsos.unlink(path)while the duped file descriptor is still open. This pattern works on POSIX (unlinking an open file just removes the directory entry; the data stays available via the open fd) but Windows enforces file locking and refuses to delete a file that still has an open handle, even via a duplicated fd. This needs eitheros.close()on the original fd before unlinking, delayed cleanup after the subprocess exits, or a Windows-specific temp-file strategy (e.g.tempfile.NamedTemporaryFile(delete=False)+ explicit cleanup after the subprocess consuming it has finished, or piping the calldata directly viasubprocess.Popen(..., stdin=PIPE)instead of stdin redirection through a temp file).Environment
genlayer-testversion: 0.1.2Impact
All three issues combined mean
genlayer-test's direct-mode pytest fixtures cannot deploy a single contract on a stock Windows setup without manual patching of the installed package or an unsupported SDK version override. This blocks anyone trying to add direct-mode test coverage to a GenLayer contract from a Windows machine, which thedirect-testsskill/docs otherwise present as a fully supported first-class workflow ("no server, no Docker — tests run in ~30-50ms").Ask
Bufferimport dependency for broader compatibility.genvm-universal.tar.xz(or platform-specific Windows) asset in currentgenvmreleases, or makegenlayer-testpin/select an SDK version that's known to have a working asset for the host platform instead of always defaulting to "latest".gltest/direct/loader.py(~line 293) to be Windows-safe (close-before-unlink, or defer cleanup, or avoid stdin-via-tempfile entirely).