-
Notifications
You must be signed in to change notification settings - Fork 748
fix(amazonq):support chat in al2 aarch64 and CDM #7270
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
Conversation
|
packages/amazonq/src/lsp/client.ts
Outdated
| export async function getGlibcPatch(): Promise<string | undefined> { | ||
| for (const file of [ | ||
| '/opt/vsc-sysroot/lib64/ld-linux-x86-64.so.2', | ||
| '/opt/vsc-sysroot/lib64/ld-linux-aarch64.so.1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't there a generic path (symlink or something like that) that the team mentioned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the call-out. Lei and I are going to chat today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using the API interface now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean VSCODE_SERVER_CUSTOM_GLIBC_LINKER ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly. These are the AL2 "APIs"
|
test failure is not relevant to this change |
…r Linux/Ubuntu in web/container env as AL2 (#8073) ## Problem PR: #7270 introduced a bug where the `isAmazonLinux2()` function incorrectly identifies regular Linux/Ubuntu systems in web/container environments as Amazon Linux 2. This happens because: 1. The function checks `os.release()` for `.amzn2.` or `.amzn2int.` patterns 2. In containerized environments (like VS Code web/remote), `os.release()` returns the __host's kernel version__, not the container's OS 3. If the host is Amazon Linux 2 but the container is Ubuntu/Linux, the function incorrectly returns `true` 4. This prevents Amazon Q LSP from starting because it thinks it's on AL2 without the required GLIBC patch ## Solution - __Skip AL2 detection for web environments__ - Returns `false` immediately since web mode runs in a browser - __Check `/etc/os-release` first__ - In containerized environments, this file contains the actual container OS, not the host OS - __Trust container OS over kernel version__ - If `/etc/os-release` shows it's not AL2 (e.g., Ubuntu), return `false` regardless of kernel version - __Fall back to kernel check only when necessary__ - Only use `os.release()` if we can't read `/etc/os-release` or if it confirms AL2 - Prioritized container OS detection over kernel version detection - Maintained backward compatibility for actual AL2 systems - Added comprehensive test coverage for the new scenarios --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
Problem
LSP cannot start without GLIBC>=2.28 in AL2 aarch64 and CloudDevMachine
Solution
feature/xbranches will not be squash-merged at release time.