-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Devcontainer setup ad-hoc parsing fails on Rocky 8.5 #232159
Copy link
Copy link
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueIssues identified as good for first-time contributorsIssues identified as good for first-time contributorslinuxIssues with VS Code on LinuxIssues with VS Code on LinuxremoteRemote system operations issuesRemote system operations issues
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueIssues identified as good for first-time contributorsIssues identified as good for first-time contributorslinuxIssues with VS Code on LinuxIssues with VS Code on LinuxremoteRemote system operations issuesRemote system operations issues
Type
Fields
Give feedbackNo fields configured for issues without a type.
Does this issue occur when all extensions are disabled?: Yes
The
check-requirements-linux.shscript that runs as part of a devcontainer setup wants to parse the OS version from/etc/os-release.That file "is a newline-separated list of environment-like shell-compatible variable assignments" (see
man os-relaseon Linux).The script tries to parse the value it wants here, by running:
This looks for a key-value pair of the form
ID=valueand strips out theID=part.It assumes the pair is not of the form
ID="value", which appears to be permitted by the file format, and appears in the wild in Rocky 8.5 where the relevant line reads:In that case the
grepcommand will fail to match the line and the value ofOS_IDwill be empty, resulting in a non-zero exit code of 1.This could be fixed by changing the variable assignment to:
This will run a subshell in which the values in the file get assigned to environment variables, which removes any surrounding
"marks.Since this runs in a subshell the current shell's environment will not pick up these variables.
Steps to Reproduce: