Skip to content
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

fix: don't package detection script in legacy server #208274

Merged
merged 3 commits into from
Mar 21, 2024
Merged

Conversation

deepak1556
Copy link
Collaborator

@deepak1556 deepak1556 commented Mar 21, 2024

@deepak1556 deepak1556 added this to the March 2024 milestone Mar 21, 2024
@deepak1556 deepak1556 self-assigned this Mar 21, 2024
@deepak1556 deepak1556 force-pushed the robo/fix_legacy_server branch from 93dc697 to c993e30 Compare March 21, 2024 07:48
@deepak1556 deepak1556 requested a review from aeschli March 21, 2024 10:14
@aeschli
Copy link
Contributor

aeschli commented Mar 21, 2024

I thought having a separate code-server-linux-legacy.sh without all the check code is much more elegant and less confusing. Why doing all the checks /tmp/vscode-skip-server-requirements-check "$(echo "$@" | grep -c -- "--skip-requirements-check")" -eq 0 ] having the extra file is there's not really any checking going on?

#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#

case "$1" in
	--inspect*) INSPECT="$1"; shift;;
esac

ROOT="$(dirname "$(dirname "$(readlink -f "$0")")")"

"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" "$@"

just as it was before.

@deepak1556
Copy link
Collaborator Author

Why doing all the checks /tmp/vscode-skip-server-requirements-check "$(echo "$@" | grep -c -- "--skip-requirements-check")" -eq 0 ] having the extra file is there's not really any checking going on?

We need this for devcontainers, as the extension runs check-requirements.sh directly without going through the server entry script. Then next time when calling the server entry script we want to avoid calling check-requirements.sh again, so the flag --skip-requirements-check was added for it.

/tmp/vscode-skip-server-requirements-check however seems unnecessary here, I can remove that.

@deepak1556
Copy link
Collaborator Author

Sorry I misunderstood your comment, are you suggesting that extensions should make sure to call the check-requirements.sh before running the server and we remove the script from the server entry point script ?

@deepak1556 deepak1556 marked this pull request as ready for review March 21, 2024 12:27
@deepak1556 deepak1556 requested a review from chrmarti March 21, 2024 12:30
@deepak1556
Copy link
Collaborator Author

@chrmarti this PR does 3 things

  1. Removes check-requirements.sh from the server entry script. The extension should call the script explicitly before starting the server which I think you already do it for devcontainers. So the flag --skip-requirements-check can be removed
  2. Renames asset from legacy-server-linux-* => server-linux-legacy-*
  3. Adds a dummy check-requirements.sh as part of the legacy server

@aeschli aeschli merged commit 5e0394c into main Mar 21, 2024
6 checks passed
@aeschli aeschli deleted the robo/fix_legacy_server branch March 21, 2024 13:11
@aeschli
Copy link
Contributor

aeschli commented Mar 21, 2024

Removes check-requirements.sh from the server entry script.

It's still there (for both legacy and normal), but for legacy it doesn't do anything except printing a message.
Not my favourite solution, but good for now. I would polish that next milestone, if that's ok.

It's as Deepak writes, it's gone and now it's up to extensions to call it beforehand.

Copy link
Collaborator

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@Imebeez Imebeez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Remote-SSH Bug]: ./bin/helpers/check-requirements.sh: not found
5 participants