Skip to content

Android code-server ARM issues #6090

Description

我在我的安卓手机上利用linux deploy部署了一个linux环境
I deployed a linux environment using "linux deploy" on my Android phone

然后通过"npm install -g code-server"安装了code-server
Then installed code-server through "npm install -g code-server"

发现两个问题
Two problems found

首先C源码无法格式化
First, the C source code cannot be formatted

原因是以下文件没有可执行权限
The reason is that the following files do not have executable permissions

~/.local/share/code-server/extensions/ms-vscode.cpptools-0.30.0-insiders/LLVM/bin/clang-format

还有libtinfo5不存在,我通过以下命令解决
And libtinfo5 does not exist, I solved it with the following command

chmod +x clang-format
apt install libncurses5

第二个问题是无法启动debug
The second problem is unable to start debug

这三个其中一个没有执行权限:mono.linux-arm64 mono.linux-armhf OpenDebugAD7
One of these three has no executable permission: mono.linux-arm64 mono.linux-armhf OpenDebugAD7

~/.local/share/code-server/extensions/ms-vscode.cpptools-0.30.0-insiders/debugAdapters$ ls
bin  framework  mono.linux-arm64  mono.linux-armhf  OpenDebugAD7

./OpenDebugAD7 是个shell脚本,会根据uname -m的结果来执行"mono.linux-arm64"或"mono.linux-armhf",在我的设备上uname -m的结果是aarch64,所以它会执行"mono.linux-arm64",但实际我设备上只能运行"mono.linux-armhf"
./OpenDebugAD7 is a shell script that will execute "mono.linux-arm64" or "mono.linux-armhf" according to the result of uname -m, and the result of uname -m on my device is aarch64, so It will execute "mono.linux-arm64", but actually only "mono.linux-armhf" can be run on my device

Originally posted by zengming00 in #429 (comment)

Activity

  1. sean-mcmanus commented on Sep 8, 2020

    @sean-mcmanus
    ContributorAuthor

    zengming00 We don't currently support running our extension on Android with code-server.

  2. zengming00 commented on Sep 9, 2020

    @zengming00

    我安装的vsix是此条评论中给出的版本:

    https://github.com/microsoft/vscode-cpptools/issues/429#issuecomment-669502684 
    

    所以它并不是最新的,我还没有尝试使用最新版本

    clang-format的问题因为在那里有提到,所以我很快就发现它没有可执行权限,然后安装缺少的支持库后问题就解决了

    当我准备调试一个程序时发现无法启动debug,我不知道发生了什么,因为没有任何错误日志或提示,我猜想可能像clang-format那样是可执行权限的问题,然后我就找到了mono.linux-arm64和mono.linux-armhf这两个文件,mono.linux-armhf确实是没有可执行权限,但给予权限后仍然无法启动debug,然后我看到了OpenDebugAD7发现它执行的是"mono.linux-arm64",当我改成运行"mono.linux-armhf"成功解决了这个问题

    在我的设备上uname -m的结果是aarch64,可能是linuxdeploy的问题(https://github.com/meefik/linuxdeploy)

    我目前还不知道怎样调试vscode的扩展程序,所以我无法提供更多有帮助的信息

    在这里最主要的问题就是当文件没有可执行权限时没有任何提示,这对我找到问题的根源造成了一些麻烦


    The vsix I installed is the version given in this comment:

    https://github.com/microsoft/vscode-cpptools/issues/429#issuecomment-669502684 
    

    So it is not the latest version, I have not tried to use the latest version

    The problem with clang-format was mentioned there, so I quickly discovered that it did not have executable permissions, and the problem was solved after installing the missing support library

    When I started debugging a program, I found that the debug could not be started. I don't know what happened, because there is no error log or prompt. I guess it might be an executable permission problem like clang-format, and then I found mono.linux -arm64 and mono.linux-armhf are two files, mono.linux-armhf does not have executable permissions, but after granting permissions, debugging still cannot be started. Then I saw OpenDebugAD7 and found that it was executing "mono.linux-arm64" ", when I changed to run "mono.linux-armhf" successfully solved the problem

    The result of uname -m on my device is aarch64, which may be a problem with linuxdeploy (https://github.com/meefik/linuxdeploy)

    I don’t know how to debug the extension of vscode yet, so I can’t provide more helpful information

    The main problem here is that there is no prompt when the file does not have executable permissions, which caused some trouble for me to find the source of the problem.

  3. zengming00 commented on Nov 2, 2020

    @zengming00

    I found a solution, change the output of 'uname -m'

    sudo mv /usr/bin/uname /usr/bin/uname_old

    Create file /usr/bin/uname, and the content is:

    #!/bin/sh
    if [ "$#" -eq 1 ] && [ "$1" = -m ]; then
        echo armv7l
    else
        command uname_old "$@"
    fi

    Set executable permissions

    sudo chmod +x /usr/bin/uname

    If use js code to detect hardware, it should be more reliable than uname -m

    const os = require('os');
    console.log(os.arch());
  4. sean-mcmanus commented on Nov 10, 2020

    @sean-mcmanus
    ContributorAuthor
  5. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Nov 10, 2020
  6. locked and limited conversation to collaborators on Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedCheck the Milestone for the release in which the fix is or will be available.more info neededThe issue report is not actionable in its current state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions