-
Notifications
You must be signed in to change notification settings - Fork 260
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
Post commands not longer follow execution order #4855
Comments
I'm suffering of the same issue: the Python extension tries to load Because of that, I have to wait until the postCreateCommand finishes and then reload the window. Very annoying. An approach different than restoring the old behavior would be to add a new option which would respect this workflow, something like:
Of course the name could be improved. |
Can you move what you are doing in |
How would that work? I mean, isn't VSCode mounting the workspace as volume to the container? Copying workspace, running some steps on it, then mounting it on top of the files copied (and possibly changed), what would that cause? Also, COPY uses .dockerignore, which are supposed to prune files not needed in production. Here we are in dev mode, we don't want to prune such files. Maybe I'm missing something. |
I think this really depends on your particular case. So the request is for a property in devcontainer.json to disable parallelization of the post-create stage. There are also dotfiles, postStartCommand and postAttachCommand being run as part of that stage and we could add a flag for each, but I would prefer a single flag. E.g.: |
@chrmarti I think there's kind of two things here. One is whether to wait for dotfiles, the other is whether serialize lifecycle events. Dotfiles cross repos, so I think that needs to be separate. Dotfiles also seems like a user setting, while the other is a devcontainer.json setting. Obviously the "settings" object could also be used to force dotfiles behaviors as a user setting. |
To avoid adding a new configuration object, something like the following could also be done {
"postCreateCommand": "npm install", // a string, as before
},
// or
{
"postCreateCommand": [ "npm install", "beforeWindowLoad" ] // a tuple of two strings, the command line and the "mode"
}
// or
{
"postCreateCommand": {
"commandLine": "npm install",
"mode": "beforeWindowLoad"
} // an object
} And the extension could handle different inputs. |
That doesn't work because vscode is what updates the UID and GID information inside the container after the dockerfile is built. |
@thaney071 Not sure if that's an option, but we @Chuxel I was thinking for simplicity, we could have a single flag to wait for all 'post create' operations (postCreateCommand, dotfiles, postStartCommand, postAttachCommand) to finish, like we used to do. dotfiles is currently not separate because we install them before postStart/AttachCommand, so these two run after dotfiles are installed not only on second and later, but also on first run. This is to ensure consistent results. |
@chrmarti Got it. Or as discussed we could introduce a step that does block before VS Code server spins up along with this that does not for scenarios where blocking is needed. |
@chrmarti I think we can consider this implemented with the upcoming |
Indeed, you could set |
@thaney071 @felipecrs Could you check if that works for you? (Currently requires VS Code Insiders and will be available with VS Code 1.57.) |
Awesome, it works. Thank you! |
Marked as verified based on comment above. |
Since #4446 was completed, the execution order of the post command has changes. This causes problems for start up that is order dependent. In our case we need to modify the permissions for the go directory so that the user has access to the folder. Previously the post create command would run before any of the vscode extensions started running. Now since the create command runs in the background, we get errors from our linters because the directory for where modules is stored is not accessible when the gopls server starts to run.
In general, that changed the start up behavior of the post commands since they are now running at the same time we cannot use them to prepare the container in a particular way before other things are allowed to start.
Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A
The text was updated successfully, but these errors were encountered: