aws / aws/aws-toolkit-vscode

SAM run/debug: eliminate temporary directory

Open
#2,050 4 comments 0 reactions 0 assignees View on GitHub
feature-request performance sam
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

Toolkit currently always builds and runs from a temporary `/tmp/vstck-xx` directory. This confuses tooling and may defeat SAM CLI "cache" functionality.

- #1988
- #2024
- https://github.com/aws/aws-toolkit-vscode/issues/3413#issuecomment-1652170148

Reason for the temporary directory:

- we wanted to avoid building artifacts into the user's workspace (which then might be accidentally committed)

Related notes:

- A similar but not identical concept is that Toolkit copies the actual `template.yaml` to a temporary counterpart.
- #1159
- #990

## Proposal

1. what does [aws-toolkit-jetbrains](https://github.com/aws/aws-toolkit-jetbrains) do?
1. Switch to building in the user's workspace.
- auto-add to `.git/info/excludes` ?
2. in `.aws-sam/` directory?
- Bonus: works better with `sam` invocations outside of the Toolkit
3. Strategy: instead of "temp dir per execution", change the model to "temp dir per _template_"?

Alternative:

1. Mostly keep the same logic, but always re-use the same `/tmp/vstck-xx` directory for the same `template.yaml`
- risk: does this complicate the logic that maps the temporary template.yaml from the actual template.yaml ? #1159

Alternative:

1. are we passing the temporary as `--build-dir` correctly? Maybe this will avoid needing to remap the paths in the temporary template.yaml #1159 #990 ?

Contributor guide

Open the contributing guide

Research direction

Review the existing SAM run/debug flow and the temporary template.yaml handling, then compare the alternatives in #1988, #2024, #1159, and #990 with aws-toolkit-jetbrains. Determine which workspace, .aws-sam, or reusable temporary-directory strategy should be adopted. Done means one strategy is chosen with its path-mapping and exclusion risks resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript, vscode
Domain
build-system, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.