Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:07
    Blacksmoke16 labeled #12783
  • 00:07
    Blacksmoke16 labeled #12783
  • Nov 26 23:55
    carlhoerberg opened #12783
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 02:15
    straight-shoota assigned #11331
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota opened #12782
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota opened #12781
  • Nov 25 23:01
    straight-shoota synchronize #11635
  • Nov 25 22:56
    straight-shoota synchronize #11840
  • Nov 25 22:49
    straight-shoota labeled #12636
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota opened #12780
  • Nov 25 19:11
    straight-shoota labeled #12779
Johannes Müller
@straight-shoota
one message
From IRC (bridge bot)
@FromIRC
<mps> thanks
Rishav Sharan
@rishavs
two message
From IRC (bridge bot)
@FromIRC
<mps> also thanks
Lewis E. Bogan
@lebogan
 Hi. After a lot of head scratching and mild cussing, I finally managed to compile crystal 1.0.0 on a Raspberry Pi 4 running Raspbian Buster 10. Why? Cuz Crystal is cool. `crystal -v` shows the version minus the compile date. Ok. When I try to build an application I get this error: `Error: can't find file 'prelude'` 'prelude' is located in /usr/share/crystal/src.  How do I tell crystal that? Thanks
Benjamin Wade
@RespiteSage
What's the output of crystal env?
Lewis E. Bogan
@lebogan
CRYSTAL_CACHE_DIR=/home/pi/.cache/crystal
CRYSTAL_PATH=/usr/share/crystal/src/
CRYSTAL_VERSION=1.0.0
CRYSTAL_LIBRARY_PATH=/usr/bin/../lib/crystal/lib
CRYSTAL_OPTS=''
Benjamin Wade
@RespiteSage
Huh. I'd expect that to work, then.
Maybe try deleting everything in that cache directory?
George Dietrich
@Blacksmoke16
ls /usr/share/crystal/src/ prints what?
Lewis E. Bogan
@lebogan
ls prints a lot .cr files including prelude
Benjamin Wade
@RespiteSage
What's the command you're using to compile? And does this happen with an empty source file?
Also, you only have the one crystal binary that you're using, right?
Lewis E. Bogan
@lebogan
Just a test hello.cr with puts "Hello". I have only one binary.
I built the binary using llvm-7. Is this a problem?
Benjamin Wade
@RespiteSage
I'm really not sure. I know the most recent LLVM release that Crystal is definitely compatible with is LLVM 11. I'm not sure what the earliest is.
And I have no idea how it would affect the prelude.
Or whether it would.
I'm sorry, I have to go now, else I'd try to help you more to figure out what's wrong. Good luck.
From IRC (bridge bot)
@FromIRC
<straight-shoota> The error is definitely that the compiler can't find the stdlib source code
<straight-shoota> Maybe try CRYSTAL_PATH=/usr/share/crystal/src/ crystal build (even though it already reports this path)
George Dietrich
@Blacksmoke16
is it possible its a symlink and something doesnt follow those?
From IRC (bridge bot)
@FromIRC
<straight-shoota> Yeah, some file system trouble could be a reason for this not working
Lewis E. Bogan
@lebogan
I removed the cache.

I ran CRYSTAL_PATH=/usr/share/crystal/src/ crystal run ./hello.cr
Now I'm getting a different error like: Invalid memory access (signal 11) at address 0x0
[0xb1cea8] ???
[0xa4c2bc] __crystal_sigfault_handler +148
Invalid memory access (signal 11) at address 0x0 Error: execution of command failed with code: 1: cc "${@}" -o /home/pi/.cache/crystal/crystal-run-hello.tmp -rdynamic -L/usr/bin/../lib/crystal/lib -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl
...
Error: execution of command failed with code: 1: cc "${@}" -o /home/pi/.cache/crystal/crystal-run-hello.tmp -rdynamic -L/usr/bin/../lib/crystal/lib -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl

Huh?

From IRC (bridge bot)
@FromIRC
<straight-shoota> Well it seems that at least found you your stdlib sources
From IRC (bridge bot)
@FromIRC
<straight-shoota> It seems weird tho that there's supposedly an invalid memory access in Crystal code while executing cc
Lewis E. Bogan
@lebogan
I'm going to redo all this using llvm-9 instead of 7. Shot in the dark.
Lewis E. Bogan
@lebogan
Ok. So I can cross-compile apps and the Portalier version 0.33.0 works. Thanks @Blacksmoke16 , @RespiteSage , straight-shoota for all your help. 1.0.0 would be nice though.
George Dietrich
@Blacksmoke16
wait
what happens if you remove the /usr/share/crystal/src/ext/libcrystal.a
pretty sure in 1.0.0 that is no longer used so maybe it's causing issues?
Daniel Worrall
@Daniel-Worrall
1.0 still uses it, 1.1 has it removed
George Dietrich
@Blacksmoke16
ah, ok
From IRC (bridge bot)
@FromIRC
<postmodern> what is the convention for targets in shards? is there a directory they are usually stored in to separate them from regular code?
George Dietrich
@Blacksmoke16
i just keep them in src
From IRC (bridge bot)
@FromIRC
<postmodern> so i take it crystal doesn't raise a SystemExit exception when you call exit()?
George Dietrich
@Blacksmoke16
no, why?
From IRC (bridge bot)
@FromIRC
<postmodern> porting some ruby code which catches exit() in a context and safely returns the status code. I just defined my own SystemExit exception.
George Dietrich
@Blacksmoke16
why not just do exit status_code
From IRC (bridge bot)
@FromIRC
<postmodern> because that would exit the process. i want to catch it for testing purposes
<postmodern> er i should probably trap the exit signal instead
George Dietrich
@Blacksmoke16
ohh
From IRC (bridge bot)
@FromIRC
<postmodern> another awesome thing about crystal, is it correctly exits with 130 on SIGINT, and handles Errno::EPIPE gracefully when stdout is closed prematurely. So I can delete that ruby code that rescues Interrupt and Errno::EPIPE
George Dietrich
@Blacksmoke16
:thumbsup:
From IRC (bridge bot)
@FromIRC
<postmodern> since crystal doesn't have documentation @tags, how do people document individual arguments of a method?
George Dietrich
@Blacksmoke16
in regard to what? Their type?
or extra textual information?
From IRC (bridge bot)
@FromIRC
<postmodern> @Blacksmoke16, additional meaning or purpose of the argument beyond it's name