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

Use build-specific settings for effect across windows and unix #107

Merged
merged 1 commit into from Nov 22, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Nov 22, 2021

Summary

  • On Windows, we use the standard os/exec functionality. As Windows doesn't really have the concept of a PTY.
  • On Unix, we use a PTY. This allows commands started through effect to appear like a user is actually running them. In many cases, this doesn't matter, but some commands will change their output if there is a user or pipe. The PTY fakes the spawned process into thinking it's a user. This will generally cause the spawned process to emite human-friendly output.
  • This change is due to the fact that recent Windows builds of paketo-buildpacks/procfile have been failing. This traces back to pty.start() creack/pty#50. It's not clear why this is happening now, since the issue is a few years old. With recent changes in libpak, we're now affected by this.
  • Initial tests with paketo-buildpacks/procfile show that making the PTY stuff conditional on the OS, allows this to work as expected.

Uses go conditional builds as described here.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

- On Windows, we use the standard os/exec functionality. As Windows doesn't really have the concept of a PTY.
- On Unix, we use a PTY. This allows commands started through effect to appear like a user is actually running them. In many cases, this doesn't matter, but some commands will change their output if there is a user or pipe. The PTY fakes the spawned process into thinking it's a user. This will generally cause the spawned process to emite human-friendly output.
- This change is due to the fact that recent Windows builds of paketo-buildpacks/procfile have been failing. This traces back to creack/pty#50. It's not clear why this is happening now, since the issue is a few years old. With recent changes in libpak, we're now affected by this.
- Initial tests with paketo-buildpacks/procfile show that making the PTY stuff conditional on the OS, allows this to work as expected.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa added type:bug A general bug semver:patch A change requiring a patch version bump labels Nov 22, 2021
@dmikusa dmikusa requested a review from a team November 22, 2021 17:06
@dmikusa dmikusa merged commit 37d737d into main Nov 22, 2021
@dmikusa dmikusa deleted the split-build branch November 22, 2021 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant