Skip to content

Commit 0898bf5

Browse files
committed
Add new WINE.md help file
Slow and not 100% reliable but still very useful to quickly test Pathlib and other issues without juggling with multiple systems.
1 parent 2d883de commit 0898bf5

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

WINE.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
https://www.winehq.org/ provides a way to run Windows binaries on Linux.
2+
3+
Q: Why would a west developer need WINE considering west is portable Python code?
4+
A: To quickly put themselves in the shoes of Windows users and troubleshoot
5+
Windows-specific issues without:
6+
7+
- A Windows licence
8+
- A different computer to run it, or the inconvenience of dual-booting
9+
- The inconvenience of synchronizing source files across computers
10+
11+
Warning: WINE is not 100% identical to Windows and WINE is _not_ able to replicate all
12+
issues happening on Windows. But enough issues can be reproduced, including Path-related
13+
issues.
14+
15+
This is a quick and dirty recipe to run west tests using WINE. This process is not
16+
officially supported and these instructions can "bitrot" and may have fallen apart by the
17+
time you read them: you have been warned. Please submit fixes or better ways if you know
18+
them. If humanly possible, keep this working over ssh. That is: without any GUI.
19+
20+
Do NOT replace Windows by WINE to validate releases!
21+
22+
```
23+
# wenv seems to work and to simplify things
24+
# https://wenv.readthedocs.io/en/latest/usage.html
25+
pip install wenv
26+
export WENV_PYTHONVERSION=3.12.10 # or any other version that works
27+
wenv init
28+
# wenv help should now list "3.12"
29+
wenv help
30+
# Warning: pykwalify is being replaced by jsonschema, see #904 and west/pyproject.toml
31+
wenv pip -v install setuptools
32+
wenv pip -v install pyyaml pykwalify pytest pytest-xdist pytest-env
33+
```
34+
35+
An alternative to WENV_PYTHONVERSION is:
36+
```
37+
echo '{ "pythonversion": "3.12.10" }' > ~/.wenv.json
38+
```
39+
40+
Download MinGit-*-32bit.zip from https://github.com/git-for-windows/git/releases/
41+
```
42+
unzip -d ~/.local/share/wenv/win32/drive_c/MinGit MinGit-*-32-bit.zip
43+
```
44+
45+
Append this at the end of `west/pyproject.toml`
46+
47+
```
48+
# TODO: find a way to do this in "wenv" instead
49+
# Useful tip: pytest --pytest-env-verbose ...
50+
[tool.pytest_env]
51+
PATH = { value = "{PATH};C:\\MinGit\\cmd", transform = true }
52+
```
53+
54+
At last:
55+
```
56+
cd west
57+
wenv pytest -h
58+
wenv pytest -v -s -k round_trip -n auto
59+
60+
# Deletes pretty much everything for the current $WENV_PYTHONVERSION and reclaims
61+
# a couple Gigabytes
62+
wenv clean
63+
```
64+
65+

0 commit comments

Comments
 (0)