python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

linux-arm64 For Raspberry Pi 4 Support

Open lishewen opened this issue 4 years ago • 6 comments

Passed on VSCode Remote SSH to Ubuntu 20.04 LTS For Raspberry Pi 4 aarch64

lishewen avatar Jun 15 '20 11:06 lishewen

CLA assistant check
All CLA requirements met.

I'd probably separate package upgrades from just adding the platform. Also, adding new platform won't make LS load in Python Extension since it does its own platform checks and may or may not permit ARM. Extension needs to be modified to properly calculate URL for the ARM download.

https://github.com/microsoft/vscode-python/blob/master/src/client/activation/languageServer/languageServerPackageService.ts

MikhailArkhipov avatar Jun 15 '20 17:06 MikhailArkhipov

I'd probably separate package upgrades from just adding the platform. Also, adding new platform won't make LS load in Python Extension since it does its own platform checks and may or may not permit ARM. Extension needs to be modified to properly calculate URL for the ARM download. https://github.com/microsoft/vscode-python/blob/master/src/client/activation/languageServer/languageServerPackageService.ts

https://github.com/microsoft/vscode-python/blob/master/src/client/activation/languageServer/languageServerPackageService.ts#L39 This place treats arm64 as x64 that causes the PLS to crash at startup.

Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-linux-x64.0.5.50.nupkg... Language server download complete Unpacking archive... done [Error - 7:11:48 AM] Connection to server is erroring. Shutting down server. [Error - 7:11:48 AM] Connection to server is erroring. Shutting down server. [Error - 7:11:48 AM] Connection to server is erroring. Shutting down server. /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 1: cannot create 5@@8J@8 @ @@@@@00pp@p@@@4949  < <a <a  ==a=a@@ @ @DD < <a <aP td A A Q tdR td < <a <a  /lib64/ld-linux-x86-64.so.2GNU GNU fS[ wD 㶱 kF (FCI !  j Cֺ |CE : 2b K qX : yIk    } 4     s      - Q(A  ~ [! I    m1 .;   /   : Directory nonexistent /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 1: ELF: not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 4: _: not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 5:  : not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 6:  : not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 12:    % G     Efr       @ w/Db       ["   "P   y    " Qk  I  X        Ca Ha Ha   Ca 5@p: not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 13:  @ : not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 1:  @U: not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 18:  @ @e Ha h+@ : not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 19:  p @j: not found /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 20: t @ [email protected]_ITM_deregisterTMCloneTable_Jv_RegisterClasses_ITM_registerTMCloneTable__pthread_key_create__errno_locationpthread_mutex_lockpthread_mutex_unlocklibdl.so.2__gmon_start__dlclosedlsymdladdrdlopendlerrorlibstdc++.so.6_ZNSs4_Rep10_M_destroyERKSaIcE_ZNKSs5rfindEPKcmm_Znam_ZNKSs12find_last_ofEPKcmm_ZNKSt5ctypeIcE13_M_widen_initEv_ZNSi4peekEv_ZSt17__throw_bad_allocv_ZNSs6appendERKSsmm_ZNSi5seekgElSt12_Ios_Seekdir_ZSt16__throw_bad_castv_ZdaPv_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l_ZNKSs7compareEmmRKSs__cxa_throw_ZSt20__throw_system_errori__cxa_rethrow_ZSt9terminatev_ZNSsC1ERKSsmm_ZNKSs5rfindEcm_ZNSt8__detail15_List_node_base7_M_hookEPS0__ZNSt8ios_base4InitD1Ev_ZNSt6localeD1Ev_ZNSs6appendEmc_ZNSsC1EPKcRKSaIcE_ZNKSs7compareEPKc_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1Ev_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode_ZNSi4readEPcl_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate_ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv_ZTTSt13basic_fstreamIcSt11char_traitsIcEE_ZSt20__throw_out_of_rangePKc_ZNKSs4findEcm_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1ERKSsSt13_Ios_Openmode_ZNKSs17find_first_not_ofEPKcmm_ZNSs6assignEPKcm_ZNKSs4findEPKcmm__cxa_begin_catch_ZTVN10__cxxabiv116__enum_type_infoE_ZNSs4_Rep20_S_empty_rep_storageE_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv__gxx_personality_v0_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_ES4__ZNSs12_M_leak_hardEv_ZNSs6appendEPKcm_ZSt24__throw_invalid_argumentPKc_ZNSs4swapERSs_ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE_ZTVSt15basic_streambufIcSt11char_traitsIcEE_ZNSolsEi_Znwm_ZNSs9_M_mutateEmmm_ZNSs4_Rep9_S_createEmmRKSaIcE_ZNSt8ios_baseD2Ev_ZNSs6assignERKSs__cxa_allocate_exception__cxa_end_catch_ZNSt13basic_fstreamIcSt11char_traitsIcEED2Ev_ZTTSt18basic_stringstreamIcSt11char_traitsIcESaIcEE_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode_ZNSs4_Rep11_S_terminalE_ZNSsC1ERKSs_ZNSs7reserveEm_ZNSt8ios_base4InitC1Ev_ZNSs6appendERKSs_ZdlPv_ZNKSs7compareEmmPKclibm.so.6libgcc_s.so.1_Unwind_Resumelibc.so.6fflushfnmatchreaddirfopenstrncmpperrorclosedir__stack_chk_failmkdirtolowergetpidstrftimegmtimestrtolfgetsstrlen__cxa_atexitmemsetrmdirfseekmemcmpvsnprintfstdoutfputcfputsmemcpyfclosestrtoulstrcasecmprealpathremoveopendirgetenvsscanfstderrstrncasecmpusleepgetcwd__getdelimfwritefreadrename__xstataccessstrcmp__libc_start_mainvfprintffreeld-linux-x86-64.so.2__tls_get_addr/netcoredeps__libc_csu_fini_IO_stdin_used__data_start_ZNSt6vectorISsSaISsEE19_M_emplace_back_auxIJRKSsEEEvDpOT___libc_csu_init__bss_start_end_edata_ZN9__gnu_cxx12__to_xstringISscEET_PFiPT0_mPKS2_P13__va_list_tagEmS5_zGCC_3.0GLIBC_2.2.5GLIBC_2.3GLIBC_2.14GLIBC_2.4GLIBCXX_3.4.9GLIBCXX_3.4.15CXXABI_1.3GLIBCXX_3.4.11GLIBCXX_3.4 : File name too long /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/Microsoft.Python.LanguageServer: 21: Syntax error: "(" unexpected

lishewen avatar Jun 20 '20 14:06 lishewen

My current solution:

Add linux-arm64 RuntimeIdentifiers and Build

dotnet publish -c release -r linux-arm64

Replace the output to the directory /home/ubuntu/.vscode-server/extensions/ms-python.python-2020.6.88468/languageServer.0.5.50/

Add permissions

sudo chmod +x Microsoft.Python.LanguageServer

Normal after reopen vscode

lishewen avatar Jun 20 '20 14:06 lishewen

For what it's worth - and at the risk of introducing scope creep ...... linux-arm64 (in this case, native Linux on arm64/aarch64 on a Raspberry Pi...) ... But would this also work for Windows on ARM? And especially WSL2 on ARM?

Given that Microsoft has doubled-down on ARM (you gotta be pretty serious to make a custom processor and not something off-the-shelf), it seems wise to ensure that this runs not only on linux-arm64 but wsl2-arm64 win-arm64, etc.

See: https://www.github.com/microsoft/vscode/issues/33620

danieldjewell avatar Jul 08 '20 22:07 danieldjewell

Have you tried Pylance LS? It is in typescript so should run on any platform. https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

MikhailArkhipov avatar Jul 09 '20 17:07 MikhailArkhipov