Skip to content

Conversation

@leigaol
Copy link
Contributor

@leigaol leigaol commented May 8, 2025

Problem

LSP cannot start without GLIBC>=2.28 in AL2 aarch64 and CloudDevMachine

Solution


  • 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.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@leigaol leigaol requested a review from a team as a code owner May 8, 2025 21:06
@leigaol leigaol marked this pull request as draft May 8, 2025 21:06
@github-actions
Copy link

github-actions bot commented May 8, 2025

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@leigaol leigaol changed the title support al2 aarch64 fix(amazonq):support chat in al2 aarch64 May 8, 2025
@leigaol leigaol marked this pull request as ready for review May 8, 2025 21:22
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',
Copy link
Contributor

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?

Copy link

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

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"

@leigaol leigaol changed the title fix(amazonq):support chat in al2 aarch64 fix(amazonq):support chat in al2 aarch64 and CDM May 9, 2025
@leigaol
Copy link
Contributor Author

leigaol commented May 9, 2025

test failure is not relevant to this change

@nkomonen-amazon nkomonen-amazon merged commit 6081f89 into aws:master May 14, 2025
28 of 31 checks passed
laileni-aws added a commit that referenced this pull request Sep 24, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants