Skip to content
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

vscode, vscodium: 1.51.1 -> 1.52.1 & add aarch64-linux, armv7l-linux builds #107052

Merged
merged 3 commits into from
Dec 28, 2020

Conversation

drewrisinger
Copy link
Contributor

Motivation for this change

Add VSCode/VSCodium ARM builds (added a few versions ago in v1.50.0 (Sept): https://code.visualstudio.com/updates/v1_50#_linux-arm-builds).
Closes #106739 (cherry-picks those changes into this branch)

HELP NEEDED: when testing the aarch64 build (on WSL, testing with binfmt-support), the build errors out when patching /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node. I don't believe this file should be patched, because I get the following not a dynamic executable message when calling ldd .../keytar.node. It seems that the auto-patchelf.sh::isExecutable() function is incorrectly reading this as an executable.

Detailed build log for autoPatchelfHook failure
+++ isELF /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/vscode-oniguruma/release/onig.wasm
+++ local fn=/nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/vscode-oniguruma/release/onig.wasm
+++ local fd
+++ local magic
+++ exec
+++ read -r -n 4 -u 11 magic
+++ exec
+++ '[' $'asm\001' = $'\177ELF' ']'
+++ return 1
+++ continue
+++ IFS=
+++ read -r -d '' file
+++ isELF /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ local fn=/nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ local fd
+++ local magic
+++ exec
+++ read -r -n 4 -u 11 magic
+++ exec
+++ '[' $'\177ELF' = $'\177ELF' ']'
+++ return 0
++++ LANG=C
++++ readelf -l /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ segmentHeaders='
Elf file type is DYN (Shared object file)
Entry point 0x4340
There are 7 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x0ff58 0x0ff58 R E 0x1000
  LOAD           0x010bd0 0x00011bd0 0x00011bd0 0x0063c 0x00640 RW  0x1000
  DYNAMIC        0x010e7c 0x00011e7c 0x00011e7c 0x00130 0x00130 RW  0x4
  NOTE           0x000114 0x00000114 0x00000114 0x00024 0x00024 R   0x4
  GNU_EH_FRAME   0x00ccd0 0x0000ccd0 0x0000ccd0 0x00214 0x00214 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x10
  GNU_RELRO      0x010bd0 0x00011bd0 0x00011bd0 0x00430 0x00430 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .note.gnu.build-id .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .plt.got .text .fini .rodata .eh_frame_hdr .eh_frame .gcc_except_table
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .got.plt .data .bss
   02     .dynamic
   03     .note.gnu.build-id
   04     .eh_frame_hdr
   05
   06     .init_array .fini_array .jcr .data.rel.ro .dynamic .got '
++++ grep '^Program Headers:'
++++ echo '
Elf file type is DYN (Shared object file)
Entry point 0x4340
There are 7 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x0ff58 0x0ff58 R E 0x1000
  LOAD           0x010bd0 0x00011bd0 0x00011bd0 0x0063c 0x00640 RW  0x1000
  DYNAMIC        0x010e7c 0x00011e7c 0x00011e7c 0x00130 0x00130 RW  0x4
  NOTE           0x000114 0x00000114 0x00000114 0x00024 0x00024 R   0x4
  GNU_EH_FRAME   0x00ccd0 0x0000ccd0 0x0000ccd0 0x00214 0x00214 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x10
  GNU_RELRO      0x010bd0 0x00011bd0 0x00011bd0 0x00430 0x00430 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .note.gnu.build-id .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .plt.got .text .fini .rodata .eh_frame_hdr .eh_frame .gcc_except_table
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .got.plt .data .bss
   02     .dynamic
   03     .note.gnu.build-id
   04     .eh_frame_hdr
   05
   06     .init_array .fini_array .jcr .data.rel.ro .dynamic .got '
+++ '[' -n 'Program Headers:' ']'
+++ isExecutable /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
++++ LANG=C
++++ grep '^ *Type: *EXEC\>\|^ *INTERP\>'
++++ readelf -h -l /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ isExeResult=
+++ '[' -n '' ']'
+++ patchelf /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ autoPatchelfFile /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ local dep rpath= toPatch=/nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ local interpreter
+++ interpreter=/nix/store/izx89ff9anm1a5yhllp1hr8mjp4vcah3-glibc-2.32-10/lib/ld-linux-aarch64.so.1
+++ isExecutable /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
++++ grep '^ *Type: *EXEC\>\|^ *INTERP\>'
++++ LANG=C
++++ readelf -h -l /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ isExeResult=
+++ '[' -n '' ']'
+++ echo 'searching for dependencies of /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node'
searching for dependencies of /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ runPatchelf --remove-rpath /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ patchelf --remove-rpath /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
+++ local missing
++++ ldd /nix/store/f8xv80klmw2lpxhw68qqm168h4zqr03g-vscodium-1.52.0/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
++++ sed -n -e 's/^[\t ]*\([^ ]\+\) => not found.*/\1/p'
+++ missing=
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@eadwu
Copy link
Member

eadwu commented Dec 16, 2020

Patchelf issue is known, #106830.

Don't have an arm device with a display so cannot test.

@drewrisinger
Copy link
Contributor Author

Link to actual patchelf script issue & solution for future reference: #101142 (comment)

@drewrisinger drewrisinger changed the title [HELP NEEDED: patchelf for .node file??] vscode, vscodium: 1.51.1 -> 1.52.0 & add aarch64-linux, armv7l-linux builds [Waiting for #106830] vscode, vscodium: 1.51.1 -> 1.52.0 & add aarch64-linux, armv7l-linux builds Dec 17, 2020
@drewrisinger drewrisinger changed the title [Waiting for #106830] vscode, vscodium: 1.51.1 -> 1.52.0 & add aarch64-linux, armv7l-linux builds [Waiting for #106830] vscode, vscodium: 1.51.1 -> 1.52.1 & add aarch64-linux, armv7l-linux builds Dec 20, 2020
@drewrisinger drewrisinger changed the title [Waiting for #106830] vscode, vscodium: 1.51.1 -> 1.52.1 & add aarch64-linux, armv7l-linux builds vscode, vscodium: 1.51.1 -> 1.52.1 & add aarch64-linux, armv7l-linux builds Dec 25, 2020
@drewrisinger drewrisinger marked this pull request as ready for review December 25, 2020 14:47
@colemickens
Copy link
Member

This appears to obsolete my old, unrebased PR: #100641

@colemickens
Copy link
Member

colemickens commented Dec 27, 2020

It works on my Pinebook Pro (and my regular x86_64-linux desktop). Thanks!

@grahamc grahamc merged commit 14c2379 into NixOS:master Dec 28, 2020
@drewrisinger drewrisinger deleted the dr-pr-vscode-arm branch January 3, 2021 03:01
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.

4 participants