Skip to content

(windows) - plugins do not exit cleanly, if invoked from batch/ps1 script #73

@YOU54F

Description

@YOU54F

xy problem.

Trying to get the pact-avro-plugin working on windows, with Std::Process::Command in rust.

It uses a batch file, which means we get a terminate batch file y/n prompt, and it fails to exit cleanly, leaving test to hang unless cancelled via task manager.

We can replace it with a powershell script, to avoid the batch file prompt, but there is no way to invoke the powershell script, with powershell directly in the current impl, as we try and run the plugin entrypoint, from the plugins current working directory.

let mut child_command = Command::new(path.clone());

could we potentially

  1. if we detect a *.ps1 script, invoke powershell -Command `
    1. If this does solve it, it may be worth me dropping a pr into the https://github.com/sbt/sbt-native-packager project for it to also emit ps1 files as well as its current bat files.
  2. if args are supplied, they are not able to be provided on a case by case basis (so only for windows). I anticipated I may need extra args, but only in windows.

This follows on from austek/pact-avro-plugin#42

Where I now have the plugin starting and the tests passing, but the plugin is just failing to cleanly exit.

open to other ideas :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions