Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental windows compatibility #116

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MrHedmad
Copy link
Owner

@MrHedmad MrHedmad commented Nov 26, 2024

This branch adds (tentative) support for the Windows architecture. This mainly impacts filesystem interactions (e.g. the MetadataExt module that we need to get file sizes) and the execution policies (i.e. supporting powershell instead of bash).

This would fix #48.

TODO

Before merging, tick all of these boxes:

  • cargo test -- --include-ignored passes without errors or warnings.
  • The CHANGELOG.md has been updated to reflect these changes.
  • Documentation is updated that reflect these changes, or this PR changes nothing that is reflected in the docs.
  • @all-contributors is made aware of this PR, or I am already in the all contributors list.

Powershell does not support running files (with `-File`) that do not
end in the `.ps1` extension. This is obviously dumb for interoperability:
you'd have kerblam shell workflows working on linux but not on windows,
and vice-versa.

A workaround is to use `Invoke-Command`, and source the file inside the
"CommandBlock" that Invoke-Command supports. This is fine, but then if
you find out that `Invoke-Command` is *not* a program, *it's a
powershell internal "magic" command*.
So when Kerblam! tries to spawn the `Invoke-Command` executable it
fails.

So, we combine both approaches: we use `powershell -Command` to spawn a
powershell, and pass a command to it. This command is `Invoke-Command`,
which takes care of reading the content of whatever workflow file we are
using, and execute it (in the current shell, so our sub-shell).

Fuck me!
@MrHedmad
Copy link
Owner Author

It is currently unknown if tests pass on Windows, as I do not have a system setup to run them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Windows compatibility
1 participant