tilt-dev / tilt-dev/tilt

local_resource should have a way to expose stdin

Open
#3,442 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

Repro steps:

  1. Checkout tilt
  2. Add this Tiltfile
local_resource('web', serve_cmd='cd web && yarn run start')

Expected behavior:

We should start up the tilt webpack server on 3000

Actual behavior:

The tilt webpack server dies with exit code 0 immediately

The problem:

Webpack exits immediately if no stdin is attached to the process

The workaround:

Rewrite the Tiltfile like this:

local_resource('web', serve_cmd='cd web && tail -f /dev/null | yarn run start')

which creates a "dumb" stdin that webpack can pull from forever

Possible solutions:

Most orchestration systems have an stdin parameter so you can specify stdin
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the local_resource entry point and trace how serve_cmd processes are started and how stdin is handled. Compare the behavior with the reported webpack reproduction and the Kubernetes stdin reference; done means local_resource can keep a process that requires stdin running without the shell workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.