microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.21k stars 28.55k forks source link

Add direct download link for GNU x64/arm builds #168389

Open valord577 opened 1 year ago

valord577 commented 1 year ago

I have tested many ArchLinux devices and all of them have error:

[user@host ~]% code-cli tunnel --log trace
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[2022-12-08 12:02:00] debug No code server tunnel found, creating new one
[2022-12-08 12:02:00] trace No token in keyring, getting a new one
[2022-12-08 12:02:00] debug [reqwest::connect] starting new connection: https://github.com/
[2022-12-08 12:02:05] error error listing current tunnels: authorization error: error requesting https://github.com/login/device/code: error sending request for url (https://github.com/login/device/code): error trying to connect: dns error: failed to lookup address information: Try again
[user@host ~]%
[user@host ~]%
[user@host ~]%
[user@host ~]% resolvectl 
Global
           Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: foreign
  Current DNS Server: 8.8.8.8
         DNS Servers: 8.8.8.8
Fallback DNS Servers: 8.8.4.4

Link 2 (ens5)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 8.8.8.8
       DNS Servers: 8.8.8.8 100.100.2.136 100.100.2.138

Link 3 (docker0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
[user@host ~]%
[user@host ~]%
[user@host ~]%
[user@host ~]% cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
[user@host ~]% 
connor4312 commented 1 year ago

Thanks for the report. I'm not able to readily hit this in a fresh Arch Linux container under Docker, via docker run -it archlinux. Can you share more details about your setup or network to help me hit the same failure?

valord577 commented 1 year ago

There is no problem in the docker container. But there is a problem in the physical machine. Would you mind providing an email address please? I will provide a machine with SSH-KEY.

connor4312 commented 1 year ago

Sure, connor@peet.io. My public key can be found on my GH profile: https://github.com/connor4312.keys

valord577 commented 1 year ago

I have sent the email. All the steps of the operation can be viewed through command history.

connor4312 commented 1 year ago

Thanks! I will look at it, though may take some extra time due to the upcoming holiday.

connor4312 commented 1 year ago

Looks to be related, or at least some difference, in musl libc's getaddrinfo vs gnu's (docs). Namely it doesn't support nsswitch.conf and (only?) uses resolve.conf, which in your case was empty. Adding a nameserver to resolve.conf fixed the issue.

What's your opinion on the best solution here? An alternatively download for arch linux users? That would work, but feels cludgy. There is an option to use an alternative Rust resolver, but that doesn't support nsswitch yet, either.

valord577 commented 1 year ago

For a wide range of linux devices, glibc is still the reliable and preferred choice. In my opinion, musl should not be forced into the glibc environment. I think musl is a solution for specific scenarios, such as cloud services and embedded devices. For code-cli, it needs to be adapted to a variety of scenarios. And developers don't have full control over these scenarios.

For musl users, I think they know exactly what musl they are using and they are ready to step into the hole.

Maintaining two download items is not ugly, as most of vscode's users are developers and there is good enough documentation to read. If this is done, the only thing that needs to change is the build environment (CI). The code can remain just one set, or even remain the same.

So, my opinion is maintaining two download items.

https://dotnet.microsoft.com/download/dotnet/7.0

dotnet-download-page

valord577 commented 1 year ago

Thanks! I will look at it, though may take some extra time due to the upcoming holiday.

I will keep this machine until this issue is closed. Or you can email me and tell me that the machine is no longer needed.

Vacation is just as important as work. Happy Holidays!

connor4312 commented 1 year ago

Thanks and likewise 🙂 We'll take this into advisement, and I'll use this issue to track adding such downloads. I should no longer need access to the machine.

valord577 commented 1 year ago

BTW, there is no full static when it comes to IO outside of computation. The network driver is not exactly the same for each device. Full static packaging just packages everything in the build environment.

In my work, when I build FFmpeg for Android devices with --extra-ldexeflags="-static", getaddrinfo also does not work properly.