-
Notifications
You must be signed in to change notification settings - Fork 48
Add Pseudo Windows 10/11 support #36
base: master
Are you sure you want to change the base?
Conversation
It requires a wsl(version irelevant) installation with nasm and ld (gnu binutils) install on the default Distro The test.py still doesn't work on windows, but it will get fixed in the next commit (the tests run fine on linux with the changed porth.py)
| if platform.system() == "Windows": # Pseudo Windows 10/11 support, requiring a wsl(version irelevant) installation with nasm and ld (gnu binutils) install on the default Distro | ||
| win_basepath = basepath.replace("\\", "/") | ||
| cmd_call_echoed(["wsl", "nasm", "-felf64", win_basepath + ".asm"]) | ||
| cmd_call_echoed(["wsl", "ld", "-o", win_basepath, win_basepath + ".o"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to prefix the commands with wsl if you are running everything from within the WSL console?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trick I am doing, is that you don't have to run it from wsl, since wsl is a completely contained linux distro, It was able to run porth before this change fine, but for ease of devolopment and tool uage on windows (configuriung wsl for IDE's or toolchains it pretty annoying) It now works if you run it from anywhere, without havin to worry to specifically run it through wsl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it autodectects if not run through wsl (since wsl will return "Linux" for platform.system()) and will then switch to run all the external commands through wsl, while still running on the windows host itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that if you simply run everything from within WSL no changes in the code are required at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you understand me correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But as I said, configuring tools and other systems to run through wsl is often very hard, annoying or straight up impossible.
(tested on Linux, tests run also there.)
It requires a wsl(version irelevant) installation with nasm and ld (gnu binutils) install on the default Distro
The test.py still doesn't work on windows, this is why the PR ist currently marked as draft.
(the tests run fine on linux with the changed porth.py)