Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

Conversation

@Popaulol
Copy link

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)

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"])
Copy link
Member

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?

Copy link
Author

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.

Copy link
Author

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.

Copy link
Member

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?

Copy link
Author

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.

Copy link
Author

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.)
@Popaulol Popaulol marked this pull request as ready for review September 23, 2021 18:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants