<srirang>
Hi all, I am getting an error while building 2.7.6 on macOS 13.
<srirang>
The error is this : ./vm_insnhelper.c:5045:43: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
<srirang>
I tried a bunch of recommendations that people have posted on the internet (delete and reinstall command line tools, install llvm, update brew etc). But nothing seems to help.
seisatsu has quit [Ping timeout: 255 seconds]
<srirang>
The system was indeed recently updated to macOS 13 (Ventura). I already have various Ruby versions installed and running on the same machine (the latest being 2.7.1 installed before the system update).
<srirang>
Does anyone know of anything extra that is needed to build 2.7.6 on macOS 13?
fandre1986 has joined #ruby
ur5us has joined #ruby
seisatsu has joined #ruby
srirang has quit [Ping timeout: 260 seconds]
grokify has quit [Remote host closed the connection]
seisatsu has quit [Ping timeout: 252 seconds]
fandre1986 has quit [Ping timeout: 252 seconds]
grokify has joined #ruby
infinityfye has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
kerunaru has quit [Remote host closed the connection]
kerunaru has joined #ruby
grokify has quit [Remote host closed the connection]
<leftylink>
but I don't see why there needs to be someone active to ask a question. you're not supposed to ask to ask, you're supposed to just ask
<Guest54>
Great! Apologies, I didnt mean anything about it. I heard something about IRC channels moving from freenode so was unsure if this is the official place
<Guest54>
It looks simple enough, it creates a listener socket and then reads data from the socket and passes that data to the "Parser" class. If you look on line "def compressed_payload(&block)" it tries to uncompres the data. In this def I want to add a logic to say that if the inflate has an error then catch that error and raise an error with the sending
<Guest54>
client's IP address
<Guest54>
Here is what I have so far:
<Guest54>
def compressed_payload(&block)
<Guest54>
begin
<Guest54>
original = Zlib::Inflate.inflate(get)
<Guest54>
rescue
<Guest54>
raise "The IP address of the client sending incorrect data was: #{}"
<Guest54>
end
TomyWork has joined #ruby
srirang has quit [Remote host closed the connection]
srirang has joined #ruby
<srirang>
@Guest54 Code pasted here largely looks fine. Are you facing any issues?
<leftylink>
no question was asked so I assumed that they were still in the process of typing up the question, so I didn't want to interrupt
catphish has joined #ruby
<srirang>
Ok.. :-)
<Guest54>
The question is, how do I get the IP address of the client when this fails. original = Zlib::Inflate.inflate(get)
aeris has quit [Remote host closed the connection]
Aminda has quit [Remote host closed the connection]
wand has joined #ruby
Aminda has joined #ruby
aeris has joined #ruby
Sankalp has quit [Ping timeout: 252 seconds]
<Guest54>
leftylink I didnt understand what you mean
Guest54 has quit [Quit: Client closed]
Guest54 has joined #ruby
cartdrige has joined #ruby
<leftylink>
then perhaps looking at existing examples will make it clear. the Lumberjack::Beats::Connection already has code that shows the client's IP, so there's no need to reinvent the wheel
crax23 has joined #ruby
Y05hito__ has quit [Ping timeout: 260 seconds]
willfish has quit [Quit: WeeChat 3.7.1]
willfish has joined #ruby
cartdrige has quit [Ping timeout: 255 seconds]
_aeris_ has joined #ruby
Aminda has quit [Read error: Connection reset by peer]
Aminda has joined #ruby
aeris has quit [Remote host closed the connection]
_aeris_ is now known as aeris
<Guest54>
The problem is that the code in Connection is separate to the code in Parser class right? The parser class is the one that inflates the data, when the method in the parser class is called, only the data gets passed, not the connection information
<Guest54>
How do I get the connection information passed into the parser class?
<leftylink>
that would ordinarily be a sign that the parser should remain ignorant of the connection information, not an indication that it should be passed in
<leftylink>
if it is to be passed in, then it can be passed in as an argument to either `initialize` or `feed`
<leftylink>
but it shouldn't be
<Guest54>
I get that. The parser class is to take data only and parse it. However what i want to do is to raise an exception whenever a bit of data is not able to be parsed
crax23 has quit [Ping timeout: 255 seconds]
<leftylink>
Connection#run already re-raises any exceptions that happen
<Guest54>
I tried to pass the IP address (by execution of the "peer" method in the connection class) into the feed method of parser. However then there is a "transition" method which calls the rest of the methods. What does this mean: `transition(:header, 2)`
<Guest54>
Yes Connection#run does but i would also like the ip address with the exception
<leftylink>
the definition of `transition` is already shown in Parser
cartdrige has joined #ruby
<Guest54>
Many thanks for trying to help. Maybe someone else will know what I can do.
<Guest54>
What does `transition(:header, 2)` mean. As in what is : what is 2
crax23 has joined #ruby
<Guest54>
Is header, in this calling the header method?
<leftylink>
no, :header is a symbol. symbols are values of type Symbol
<Guest54>
Will this work, change `@parser.feed(@fd.sysread(READ_SIZE)) do |event, *args|` line to `@parser.feed(@fd.sysread(READ_SIZE), "#{@fd.peeraddr[3]}:#{@fd.peeraddr[1]}" "abc") do |event, *args|`
<Guest54>
Then in `def feed(data, &block)` change to `def feed(data, peerip, &block)`
<Guest54>
Is this ok so far?
Guest88 has joined #ruby
Guest88 has quit [Client Quit]
htjfgttjhtfgrj has joined #ruby
htjfgttjhtfgrj has quit [Client Quit]
<Guest54>
Correction:
<Guest54>
Will this work, change `@parser.feed(@fd.sysread(READ_SIZE)) do |event, *args|` line to `@parser.feed(@fd.sysread(READ_SIZE), "#{@fd.peeraddr[3]}:#{@fd.peeraddr[1]}") do |event, *args|`
supay has joined #ruby
<leftylink>
regardless of whether it will work, then all those functions in Parser will need to take an argument they never use. even disregarding the design question, it's too much work. the question was that when Zlib::Inflate.inflate fails, it should result in an exception with the IP. well, https://ruby-doc.org/stdlib-3.1.0/libdoc/zlib/rdoc/Zlib/Error.html is, in their words, "The superclass for all exceptions
<leftylink>
raised by Ruby/zlib."
<leftylink>
so that implies rescuing that exception
srirang has quit [Remote host closed the connection]
D_A_N has joined #ruby
Guest54 has quit [Quit: Client closed]
hightower2 has quit [Ping timeout: 260 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
hightower2 has joined #ruby
catphish has left #ruby [Leaving]
Ziyan has joined #ruby
<Ziyan>
Any of you guys used dry-struct to create a form object for file upload? I am wondering what to use for the type for the file field. 🤔
kerunaru has quit [Remote host closed the connection]
grawity has joined #ruby
<grawity>
now that OpenSSL::Engine is gone in openssl3 in favor of providers, how do I actually load a provider via ruby?
Ziyan has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
<adam12>
Ziyan: You're going through dry-validation or dry-schema first, right?
grokify has quit [Remote host closed the connection]
<adam12>
Ziyan: If you are, and then serializing to struct, maybe Types.Nominal(File)? I think it's a File/Tempfile you receive from Rack.
grokify has joined #ruby
cartdrige has joined #ruby
hightower2 has quit [Ping timeout: 260 seconds]
grokify has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 252 seconds]
stirl has joined #ruby
<gr33n7007h>
grawity: pretty sure you have to define them in the openssl config file
<grawity>
global config or can I load a specific config via API?
<gr33n7007h>
grawity: either, i think.
<gr33n7007h>
for global: OpenSSL::Config.load OpenSSL::Config::DEFAULT_CONFIG_FILE
<grawity>
hmm I thought that just parses the file, doesn't apply it
<grawity>
will try anyway
<grawity>
I'm hoping to get hardware keys working again via pkcs11-provider
repo has quit [Ping timeout: 246 seconds]
idkwtf has joined #ruby
<gr33n7007h>
grawity: i've not looked through it properly yet tbh. stick around though, someone maybe more helpful at the moment.
<gr33n7007h>
i'll take a proper look when i get back.
dionysus69 has joined #ruby
repo has joined #ruby
nik has quit [Quit: Leaving]
<idkwtf>
just for closure, libressl is supersweet
grokify has joined #ruby
caleb has quit [Remote host closed the connection]
caleb has joined #ruby
shokohsc has quit [Read error: Connection reset by peer]
shokohsc has joined #ruby
grokify has quit [Remote host closed the connection]
cartdrige has quit [Ping timeout: 260 seconds]
grokify has joined #ruby
cartdrige has joined #ruby
grokify has quit [Remote host closed the connection]