dlang-community / DCD

The D Completion Daemon is an auto-complete program for the D programming language
GNU General Public License v3.0
349 stars 71 forks source link

macOS binaries broken #641

Closed VisualEhrmanntraut closed 3 years ago

VisualEhrmanntraut commented 3 years ago

Also tried downloading binaries manually. Log from code-d:

Installing DCD: DCD is outdated. Expected: 0.13.5, got none
Downloading from https://github.com/dlang-community/DCD/releases/download/v0.13.5/dcd-v0.13.5-osx-x86_64.tar.gz to /Users/visual/.code-d/bin
Finished downloading
Extracting download...
> tar xvfz dcd-v0.13.5-osx-x86_64.tar.gz
x dcd-client
x dcd-server
Successfully installed DCD
Failed to find workspace to start DCD for <project>

When running command manually:

❯ ~/.code-d/bin/dcd-client
zsh: exec format error: /Users/visual/.code-d/bin/dcd-client
❯ ~/.code-d/bin/dcd-server
zsh: exec format error: /Users/visual/.code-d/bin/dcd-server

Extra information:

❯ file ~/.code-d/bin/dcd-client
/Users/visual/.code-d/bin/dcd-client: data
❯ file ~/.code-d/bin/dcd-server
/Users/visual/.code-d/bin/dcd-server: data
WebFreak001 commented 3 years ago

are they marked as executable? Not quite sure how this could happen as we only recently switched to github actions and upgraded dependencies to fix issues like this.

VisualEhrmanntraut commented 3 years ago

That would give a different error. The error would be permission denied: <executable>, exec format error means the executable format is not recognised by the operating system. You can obviously tell this is correct due to the fact that the "file" command output says the file is data, not an executable. E.g.

❯ file `where zsh`
/bin/zsh: Mach-O 64-bit executable x86_64
VisualEhrmanntraut commented 3 years ago

Also, the only contents the binaries have is just symbol names. The rest are just 0 image

WebFreak001 commented 3 years ago

is it really all just 0? I could imagine there being padding, but don't think it would be that much.

Is this possibly some issue with tar? The CI tests the executables before upload and they worked fine.

Can you share more system & processor information?

VisualEhrmanntraut commented 3 years ago

Could be an issue with your tar. OS: macOS Catalina 10.15.7 19H1323 x86_64 Host: Hackintosh (SMBIOS: MacPro7,1) Kernel: 19.6.0 CPU: AMD Ryzen 5 2600 (There's no reason using a hackintosh would cause this issue) EDIT: When I extract the tar.gz manually, it gives me a weird GNUSparse.0 folder with those files being in there Also, building the binaries manually works fine on my machine as well, the tar is probably the problem

VisualEhrmanntraut commented 3 years ago

Also, about the padding, no, executables do not have padding in their headers, neither does anything. And yes, it's all 0s.

WebFreak001 commented 3 years ago

found some discussion about an issue like this: https://github.com/actions/virtual-environments/issues/2619

Running sudo /usr/sbin/purge before archiving or using gtar instead of tar seems to fix it for those people.

VisualEhrmanntraut commented 3 years ago

image

WebFreak001 commented 3 years ago

the actions environment should have it preinstalled according to the comments over there and other PRs in other projects

VisualEhrmanntraut commented 3 years ago

oh I just noticed that's in the workflow, alright

WebFreak001 commented 3 years ago

new tar working?

VisualEhrmanntraut commented 3 years ago

Yes, though, your VSCode extension didn't automatically update to it. Downloading and extracting the tar manually works though, so yeah, issue resolved.