Skip to content

feat: ubuntu - #9

Open
RohitKushvaha01 wants to merge 14 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:main
Open

RohitKushvaha01 wants to merge 14 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:main

Conversation

@RohitKushvaha01

@RohitKushvaha01 RohitKushvaha01 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Todo:

  • Ubuntu
  • Compile proot from source
  • Investigate loader32 bug
  • Fix NodeJs Memory bug in proot
  • Refactor
  • Add nodesource ppa
  • fix user prompts getting overwritten
  • script updates wont reach existing installs
  • stale lock file?

@RohitKushvaha01
RohitKushvaha01 marked this pull request as ready for review September 30, 2026 05:55
@RohitKushvaha01
RohitKushvaha01 marked this pull request as draft October 1, 2026 12:58
@RohitKushvaha01
RohitKushvaha01 marked this pull request as ready for review October 3, 2026 08:43
@RohitKushvaha01
RohitKushvaha01 marked this pull request as draft October 5, 2026 12:53
@RohitKushvaha01
RohitKushvaha01 marked this pull request as ready for review October 6, 2026 08:46
@bajrangCoder

Copy link
Copy Markdown
Member

Review of 350c73a and 0fa5681 (head 0fa5681). The prompt override fix and the stale group lock fix look good. These are the new problems:

1. nodejs npm conflicts with NodeSource, which breaks npm-based LSP installs (high)

NodeSource's nodejs package declares Provides: npm and Conflicts: npm. The npm installer still runs:

`apt-get install -y nodejs npm && ${npmCommand} ${installFlags} ${spec.packages.map((entry) => quoteArg(entry)).join(" ")}`,

Once the NodeSource repo is configured (arm64 and x86_64), apt has to install Ubuntu's real npm package, which conflicts with NodeSource's nodejs. The install then fails for every npm-based server (TypeScript, HTML/CSS/JSON, Tailwind). This comes from the package metadata; I haven't reproduced it with apt.

Suggested fix: install only nodejs (NodeSource bundles npm), and add npm only when command -v npm finds nothing (for example on the Ubuntu nodejs fallback).

2. NodeSource 26.x has no armhf packages

node_26.x/dists/nodistro/main/binary-armhf/Packages has 0 entries. 32-bit devices therefore configure the repo but quietly stay on Ubuntu's Node 18. Either skip NodeSource on armhf or log that fallback.

3. The prompt's red failure marker never shows

PROMPT_COMMAND='_PS1_PATH=$(_shorten_path); _PS1_EXIT=$?; if [ "$_PS1_EXIT" -ne 0 ]; then _PS1_MARK="\[\033[31m\]>$\[\033[0m\]"; else _PS1_MARK="$"; fi'

_PS1_EXIT=$? runs after _PS1_PATH=$(_shorten_path), so $? is the exit status of _shorten_path, which is always 0. Capture it first:

PROMPT_COMMAND='_PS1_EXIT=$?; _PS1_PATH=$(_shorten_path); ...'

4. Script updates still don't reach existing installs

refresh_generated_artifacts and write_version_marker only run under --installing:

--installing is only reached from Terminal.install(), which calls uninstall() first and wipes the rootfs. So the ACODE_GENERATED_VERSION / needs_refresh check never runs against an existing install, and a bump from 3 to 5 never updates initrc, acode or the MOTD for current users. terminalGeneratedArtifacts.test.js also asserts that a normal launch never refreshes.

Suggested fix: call refresh_generated_artifacts and write_version_marker on the launch path too. Both are cheap and guarded by needs_refresh, so they only write when the version is stale.

5. NodeSource setup runs as curl | bash

if curl -fsSL "$ACODE_NODESOURCE_SETUP" | bash; then

This runs a remote, unpinned script as root during install. It also installs gnupg and runs its own apt-get update. Writing the three files directly gives a predictable result:

  • the keyring (/usr/share/keyrings/nodesource.gpg)
  • /etc/apt/sources.list.d/nodesource.sources
  • the Pin-Priority: 600 preference

6. allowScripts and CONTRIBUTING changes

The version bumps match package-lock.json, so they're correct, but they aren't related to Ubuntu and would fit better in a separate PR. Also please check that the key "file:../../codemirror-lsp-client" actually matches the dependency spec "@codemirror/lsp-client": "file:codemirror-lsp-client". Otherwise the prepare script stays blocked.

@RohitKushvaha01

Copy link
Copy Markdown
Member Author

Review of 350c73a and 0fa5681 (head 0fa5681). The prompt override fix and the stale group lock fix look good. These are the new problems:

1. nodejs npm conflicts with NodeSource, which breaks npm-based LSP installs (high)

NodeSource's nodejs package declares Provides: npm and Conflicts: npm. The npm installer still runs:

`apt-get install -y nodejs npm && ${npmCommand} ${installFlags} ${spec.packages.map((entry) => quoteArg(entry)).join(" ")}`,

Once the NodeSource repo is configured (arm64 and x86_64), apt has to install Ubuntu's real npm package, which conflicts with NodeSource's nodejs. The install then fails for every npm-based server (TypeScript, HTML/CSS/JSON, Tailwind). This comes from the package metadata; I haven't reproduced it with apt.

Suggested fix: install only nodejs (NodeSource bundles npm), and add npm only when command -v npm finds nothing (for example on the Ubuntu nodejs fallback).

2. NodeSource 26.x has no armhf packages

node_26.x/dists/nodistro/main/binary-armhf/Packages has 0 entries. 32-bit devices therefore configure the repo but quietly stay on Ubuntu's Node 18. Either skip NodeSource on armhf or log that fallback.

3. The prompt's red failure marker never shows

PROMPT_COMMAND='_PS1_PATH=$(_shorten_path); _PS1_EXIT=$?; if [ "$_PS1_EXIT" -ne 0 ]; then _PS1_MARK="\[\033[31m\]>$\[\033[0m\]"; else _PS1_MARK="$"; fi'

_PS1_EXIT=$? runs after _PS1_PATH=$(_shorten_path), so $? is the exit status of _shorten_path, which is always 0. Capture it first:

PROMPT_COMMAND='_PS1_EXIT=$?; _PS1_PATH=$(_shorten_path); ...'

4. Script updates still don't reach existing installs

refresh_generated_artifacts and write_version_marker only run under --installing:

--installing is only reached from Terminal.install(), which calls uninstall() first and wipes the rootfs. So the ACODE_GENERATED_VERSION / needs_refresh check never runs against an existing install, and a bump from 3 to 5 never updates initrc, acode or the MOTD for current users. terminalGeneratedArtifacts.test.js also asserts that a normal launch never refreshes.

Suggested fix: call refresh_generated_artifacts and write_version_marker on the launch path too. Both are cheap and guarded by needs_refresh, so they only write when the version is stale.

5. NodeSource setup runs as curl | bash

if curl -fsSL "$ACODE_NODESOURCE_SETUP" | bash; then

This runs a remote, unpinned script as root during install. It also installs gnupg and runs its own apt-get update. Writing the three files directly gives a predictable result:

  • the keyring (/usr/share/keyrings/nodesource.gpg)
  • /etc/apt/sources.list.d/nodesource.sources
  • the Pin-Priority: 600 preference

6. allowScripts and CONTRIBUTING changes

The version bumps match package-lock.json, so they're correct, but they aren't related to Ubuntu and would fit better in a separate PR. Also please check that the key "file:../../codemirror-lsp-client" actually matches the dependency spec "@codemirror/lsp-client": "file:codemirror-lsp-client". Otherwise the prepare script stays blocked.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants