Tiltfile OUTPUT_TO_NULL_COMMAND not recognized on Windows
Describe the bug
After cloning the steeltoe-weatherforecast accelerator to a Windows OS, running tilt up fails by default, raising a "path not found" error:
Successfully loaded Tiltfile (3.024ms)
sample-app â"‚
sample-app â"‚ Initial Build
sample-app â"‚ STEP 1/1 â€" Deploying
sample-app â"‚ Running cmd: tanzu apps workload apply -f config/workload.yaml --update-strategy replace --debug --live-update --local-path . --source-image your-registry.io/project/steeltoe-weatherforecast-source --build-env BP_DEBUG_ENABLED=true --namespace default --yes > /dev/null && kubectl get workload sample-app --namespace default -o yaml
sample-app â"‚ The system cannot find the path specified.
sample-app â"‚
sample-app â"‚ ERROR: Build Failed: apply command exited with status 1
To Reproduce Steps to reproduce the behavior:
- Open the steeltoe-weatherforecast accelerator in Windows
- Invoke
tilt upfrom the root project directory
Expected behavior
tilt up command to succeed.
Additional context
- This error goes away after removing the
OUTPUT_TO_NULL_COMMANDfrom the default Tiltfile'sapply_cmdstring. > NULmight be a suitable Windows equivalent to> /dev/null
Update: we should be able to override this env var before invoking tilt up (making it runnable on Windows), but in general I'm guessing NUL might be a friendlier default than /dev/null, assuming a majority of folks using this accelerator will be using Windows?
another option is to use apply_cmd_bat as well in the tiltfile the relevant part could look like:
apply_cmd="tanzu apps workload apply -f config/workload.yaml --debug --live-update" +
" --local-path " + LOCAL_PATH +
" --source-image " + SOURCE_IMAGE +
" --namespace " + NAMESPACE +
" --build-env BP_DEBUG_ENABLED=true" +
" --yes " +
" > /dev/null " +
" && kubectl get workload " + NAME + " --namespace " + NAMESPACE + " -o yaml",
apply_cmd_bat="tanzu apps workload apply -f config/workload.yaml --debug --live-update" +
" --local-path " + LOCAL_PATH +
" --source-image " + SOURCE_IMAGE +
" --namespace " + NAMESPACE +
" --build-env BP_DEBUG_ENABLED=true" +
" --yes " +
" > NUL " +
" && kubectl get workload " + NAME + " --namespace " + NAMESPACE + " -o yaml",
based on tilt docs:
apply_cmd_bat ( Union [ str , List [ str ]]) – If non-empty and on Windows, takes precedence over apply_cmd . Ignored on other platforms. If a string, executed as a Windows batch command executed with cmd /S /C ; if a list, will be passed to the operating system as program name and args.
This will allow the accelerator Tilt config to work on any OS. while i hardcoded the values, there could be 2 VARS set at the top something like:
OUTPUT_TO_NULL_COMMAND_WIN = ' > NUL '
OUTPUT_TO_NULL_COMMAND = ' > /dev/null '
@trisberg I think this issue can be closed now that tanzu apps has added -oyaml