jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
deavmi_ has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
<FromGitter> <j8r> No need to "remove the block" @sirikon
<FromGitter> <j8r> > it gives a block to the running process
<FromGitter> <j8r> What block in particular?
<FromGitter> <j8r> Ok I think I understanf what you do
<FromGitter> <j8r> So no, nothing in the stdlib – this is the base
<FromGitter> <j8r> You can maintain a Set of WebSocket
<FromGitter> <sirikon> 👍 will implement my thing then :) thanks!
<FromGitter> <j8r> When new text is retrieved from your process stdout, iterate over the set. When a WS connection closes, remove the set entry in `on_close`
<FromGitter> <j8r> Note also there is no graceful disconection when `HTTP::Server#close` is called
<FromGitter> <j8r> For another project, I use the set of connection to close each active connection properly
<FromGitter> <sirikon> > Note also there is no graceful disconection when `HTTP::Server#close` is called ⏎ ⏎ Oh didn't knew that, thanks for the tip
<FromGitter> <j8r> You're welcome 👍
HumanG33k has joined #crystal-lang
HumanG33k has quit [Max SendQ exceeded]
HumanG33k has joined #crystal-lang
Elouin has quit [Ping timeout: 240 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 260 seconds]
<FromGitter> <mixflame> great success guys. I made a fully encrypted chat using libsodium
sagax has joined #crystal-lang
Elouin has joined #crystal-lang
HumanG33k has quit [Ping timeout: 260 seconds]
oddp has joined #crystal-lang
ua has quit [Remote host closed the connection]
<postmodern> can you use Slice with a struct and have it map an array into the struct fields?
Munto has joined #crystal-lang
ua has joined #crystal-lang
<FromGitter> <j8r> postmodern, a slice which values map those of a struct? Not really... ⏎ ⏎ > A Slice is a Pointer with an associated size.
<FromGitter> <j8r> Maybe you want to use StaticArray?
<FromGitter> <j8r> you can transform an array to a slice, but that's unsafe
<postmodern> i want something like StaticArray but for wrapping around an existing Pointer. Going to be reading video frames, which is basically an array of uint8s. if i could map the array to an array of Pixel structs (y u y v), that would make processing the pixels much nicer.
<postmodern> it's late, i should get some sleep
postmodern has quit [Quit: Leaving]
<oprypin> postmodern, just convert the `pointer.as(ThatStruct*)` and use it, either directly or `.to_slice`
<oprypin> oh if you dont have a pointer in the first place, that'd be `array.to_unsafe` to get a pointer
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
ua_ has quit [Ping timeout: 246 seconds]
ua has joined #crystal-lang
_whitelogger has joined #crystal-lang
ua_ has joined #crystal-lang
ua has quit [Read error: Connection reset by peer]
ua_ is now known as ua
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<oddp> What's up with ary's pr closing spree?
<FromGitter> <asterite> old PRs that are not going gyi be merged
<oddp> What a shame, new block args/syntax looked intriguing.
<FromGitter> <mixflame> How should I package my crystal server for release? Do I have to do each package system by hand? Probably making a shard is first right?
<FromGitter> <mixflame> I wanna get on Brew, APT, maybe pacman and yum
<FromGitter> <mixflame> Is that an insanely big task or is there any tools that you guys know of
<FromGitter> <mixflame> or is flatpak or snap or appimage better
<FromGitter> <mixflame> better question
<FromGitter> <mixflame> can I publish a shard from within a monorepo?
<FromGitter> <mixflame> and how do you actually even publish a shard? the guide isn't clear on that. there's no `gem publish` like command
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 260 seconds]
<FromGitter> <Daniel-Worrall> Shards are hosted on git
<raz> and yes, maintaining multiple distro packages is unfortunately still a pain in the rectangle
<raz> snap is pretty easy, but not all distros support it and there's the usual holy war going on about whether it should be abandoned altogether, etc.
<raz> there are tools that can build various distro pkgs from one source (pacur, fpm) but i've had mixed results when i last tried
<FromGitter> <Blacksmoke16> prob easiest to just start off with static x86, snap, and brew versions
<FromGitter> <ImAHopelessDev_gitlab> hi
<FromGitter> <Blacksmoke16> those 3 would prob give the most bang for the buck and are pretty straightforward
<FromGitter> <ImAHopelessDev_gitlab> a diablo 2 rust storm in full effect on github, nice ;D
<FromGitter> <Blacksmoke16> ?
<FromGitter> <mixflame> nice @Blacksmoke16 ty. I couldn't find any info about making a Crystal snap but that's ok
<FromGitter> <mixflame> I'm compiling my code for release now! 8-)
<FromGitter> <mixflame> nice Godot logo
<FromGitter> <mixflame> Godot+Crystal
<FromGitter> <mixflame> so after I compile for release, I can just distribute that binar(ies)?
<FromGitter> <mixflame> radical !
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <mixflame> For the static x86 thing... Do I have to use Alpine Linux? Seems like I need Ubuntu for snaps and Alpine for static. Did you use both?
<FromGitter> <Blacksmoke16> static needs alpine yes
<FromGitter> <mixflame> but the binary that alpine creates can run anywhere?
<FromGitter> <mixflame> any linux
<FromGitter> <Blacksmoke16> that is x86 yes
<FromGitter> <mixflame> cool. so your CI system is instantiating alpine in order to compile for release?
<FromGitter> <Blacksmoke16> it uses docker, like all actions
<FromGitter> <Blacksmoke16> (mostly all)
<FromGitter> <Blacksmoke16> i.e. uses the alpine docker image that build the binary
<FromGitter> <mixflame> oh so github actions supports everything you're doing. does it cost money?
<FromGitter> <Blacksmoke16> no
<FromGitter> <mixflame> wow
<FromGitter> <Blacksmoke16> i mean its not really any different than like travisCI or circle etc
<FromGitter> <mixflame> ahh. that's good. I have no experience with them really but I think I have enough to go on based on your blog posts/code. :D
<FromGitter> <mixflame> I whipped out my slow linux system to help
<FromGitter> <mixflame> so @Blacksmoke16 when does your github action run? on push or when you create a release
<FromGitter> <Blacksmoke16> when i create a new release
<FromGitter> <mixflame> ah nice
<FromGitter> <Blacksmoke16> it triggers the build then uploads the binary to the release
<FromGitter> <mixflame> got it
<FromGitter> <mixflame> I'm not sure what to do though because I made two binaries
<FromGitter> <mixflame> can I just replicate the Upload section twice?
<FromGitter> <Blacksmoke16> two binaries? what are they?
<FromGitter> <mixflame> crystal-gchat-server.cr and change-passwords.cr
<FromGitter> <mixflame> i could maybe combine them if its not possible/wise
<FromGitter> <Blacksmoke16> then assuming the build step builds both, you would just use the upload step twice, might be worth looking into if it supports multiple uploads tho
<FromGitter> <Blacksmoke16> might be able to give it an array of something
<FromGitter> <mixflame> ah k
<FromGitter> <mixflame> do I have to enable GH actions? I made a deployment.yml based on yours and pushed it in the same folder structure
<FromGitter> <Blacksmoke16> did you create a release?
<FromGitter> <mixflame> yes
<FromGitter> <Blacksmoke16> got a link to your repo?
<FromGitter> <Blacksmoke16> pretty sure you just created a tag
<FromGitter> <Blacksmoke16> you need to create a release in github
<FromGitter> <mixflame> I did create a release but then I deleted it
<FromGitter> <Blacksmoke16> right but that was created before you added the GH action tho?
<FromGitter> <mixflame> yeah
<FromGitter> <Blacksmoke16> then that wouldnt work, because it only runs when you create a release
<FromGitter> <Blacksmoke16> 2nd one
<FromGitter> <mixflame> hmm
<FromGitter> <mixflame> thanks
<FromGitter> <Blacksmoke16> might be worth deleting `1.0.1` and running everything manually to ensure it all works
<FromGitter> <mixflame> how do you run it manually?
<FromGitter> <Blacksmoke16> as i imagine your build steps are going to be diff than mine
<FromGitter> <mixflame> yeah
<FromGitter> <Blacksmoke16> like run the same command in the same docker image that the action would be doing
<FromGitter> <Blacksmoke16> example being you (prob) dont need like libxml/libyaml
<FromGitter> <mixflame> i def need libyaml
<FromGitter> <Blacksmoke16> okey dokey
<FromGitter> <mixflame> I guess I need to get my docker skills up to par
<FromGitter> <mixflame> `docker run crystallang/crystal:0.35.1-alpine` isn't working to run the container
<FromGitter> <mixflame> am I doing it wrong?
<FromGitter> <Blacksmoke16> what are you running exactly and whats the error?
<FromGitter> <mixflame> `docker pull crystallang/crystal:0.35.1-alpine` then `docker run crystallang/crystal:0.35.1-alpine` and then `docker ps` and it doesn't show as running
<FromGitter> <Blacksmoke16> its running but you didnt give it a command so it exits immediately
<FromGitter> <mixflame> ah
<FromGitter> <Blacksmoke16> try like `docker run -it crystallang/crystal:0.35.1-alpine sh`
<FromGitter> <Blacksmoke16> to get into a shell within the continer
<FromGitter> <mixflame> ah nice it worked
<FromGitter> <Blacksmoke16> mhm
<FromGitter> <mixflame> ```--: line 1: /workspace/lib/sodium/src/sodium/../../build/pkg-libs.sh: not found``````
<FromGitter> <mixflame> alpine doesn't like the sodium.cr that I used
<FromGitter> <Blacksmoke16> try running `shards install` before building
<FromGitter> <mixflame> `shards install` runs but doesn't fix
<FromGitter> <Blacksmoke16> what version of sodium.cr are you using?
<FromGitter> <Blacksmoke16> i never used that lib so im not sure
<FromGitter> <mixflame> 1) 2.0
<FromGitter> <Blacksmoke16> check if that file is there within the container/
<FromGitter> <mixflame> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f1df9f4c83e6242ed57cd03]
postmodern has joined #crystal-lang
<FromGitter> <mixflame> well it is there
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <mixflame> yeah
<FromGitter> <mixflame> np
<FromGitter> <mixflame> I found out why
<FromGitter> <Blacksmoke16> oh?
<FromGitter> <mixflame> the scripts want to use bash while alpine wants to use sh
<FromGitter> <Blacksmoke16> ah good find
<FromGitter> <mixflame> thx
<FromGitter> <mixflame> looks like I got libsodium to compile in docker alpine
<FromGitter> <mixflame> woohoo!!
ua has quit [Ping timeout: 256 seconds]
ua has joined #crystal-lang
<FromGitter> <Blacksmoke16> Nice one!
postmodern has quit [Quit: Leaving]
<FromGitter> <mixflame> thanks
<FromGitter> <mixflame> snapcraft can't find the crystal plugin on linux
<FromGitter> <Blacksmoke16> Not sure, been a while since I messed with it
<FromGitter> <Blacksmoke16> Make sure the version of snapcraft you're using has it
<FromGitter> <Blacksmoke16> I.e. up to date