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

Zstd - "you've found a bug in the Crystal compiler. Please open an issue .. " #14931

Closed
danabooth opened this issue Aug 21, 2024 · 2 comments · Fixed by #14932
Closed

Zstd - "you've found a bug in the Crystal compiler. Please open an issue .. " #14931

danabooth opened this issue Aug 21, 2024 · 2 comments · Fixed by #14932

Comments

@danabooth
Copy link

danabooth commented Aug 21, 2024

Very new to Crystal, Added shard "zstd" and just wanted to see if it had gone right, got this:

PS J:\code\crystal\ztest> crystal build ztest.cr
Error executing process: 'J:\\code\\crystal\\ztest\\lib\\zstd\\src\\zstd/../../build/pkg-libs.sh J:\\code\\crystal\\ztest\\lib\\zstd\\src\\zstd/../..': J:\code\crystal\ztest\lib\zstd\src\zstd/../../build/pkg-libs.sh J:\code\crystal\ztest\lib\zstd\src\zstd/../.. is not a valid Win32 application. (File::BadExecutableError)
  from D:\a\crystal\crystal\src\crystal\system\win32\process.cr:292 in 'spawn'
  from D:\a\crystal\crystal\src\process.cr:508 in '`'
  from D:\a\crystal\crystal\src\compiler\crystal\compiler.cr:335 in 'codegen'
  from D:\a\crystal\crystal\src\compiler\crystal\compiler.cr:211 in 'compile'
  from D:\a\crystal\crystal\src\compiler\crystal\command.cr:79 in 'run'
  from D:\a\crystal\crystal\src\compiler\crystal.cr:11 in '__crystal_main'
  from D:\a\crystal\crystal\src\crystal\main.cr:130 in 'main'
  from D:\a\crystal\crystal\src\crystal\system\win32\wmain.cr:37 in 'wmain'
  from D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 in '__scrt_common_main_seh'
  from C:\Windows\System32\KERNEL32.DLL +95092 in 'BaseThreadInitThunk'
  from C:\Windows\SYSTEM32\ntdll.dll +314513 in 'RtlUserThreadStart'
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

I've attached the directory. Sorry if I did this wrong, just following the directions on the screen.

PS J:\code\crystal\ztest> crystal --version
Crystal 1.13.1 [0cef61e]

LLVM: 18.1.1
Default target: x86_64-pc-windows-msvc

zstd_test.tar.gz

@Blacksmoke16
Copy link
Member

Blacksmoke16 commented Aug 21, 2024

I'd wager a guess that that lib just doesn't have support for Windows as it worked fine for me on linux:

$ shards install
Resolving dependencies
Fetching https://github.com/didactic-drunk/zstd.cr.git
Installing zstd (1.2.0)
Postinstall of zstd: ./build/zstd_install.sh
Writing shard.lock
$ crystal ztest.cr
hi

I'd maybe open something on that repo. However, we could also probably handle this scenario better as to not make people think it's a compiler bug?

Error seems to be coming from https://github.com/didactic-drunk/zstd.cr/blob/6e63bfcc80fb7ee14019216c1bf5839f09c7120f/src/zstd/lib.cr#L2, which is using a shell script as a way to build out the link flags.

@straight-shoota
Copy link
Member

Yeah, the root cause is that the shard doesn't support Windows.
But this should lead to a normal compiler error, it's not a bug in the compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants