Skip to content

Add experimental windows compatibility - #116

Open
MrHedmad wants to merge 4 commits into
mainfrom
windows_compatibility
Open

Add experimental windows compatibility#116
MrHedmad wants to merge 4 commits into
mainfrom
windows_compatibility

Conversation

@MrHedmad

@MrHedmad MrHedmad commented Nov 26, 2024

Copy link
Copy Markdown
Owner

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
Copy Markdown
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