The current upstream release of dev-lang/ruby-3.0.0 has a bug in the implementation of the socks functionality that when compiling dev-lang/ruby-3.0.0[socks5] gives an error: x86_64-pc-linux-gnu-gcc -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/socket -I../.. -I../../. -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -march=native -O2 -pipe -fno-strict-aliasing -fPIC -o sockssocket.o -c sockssocket.c sockssocket.c: In function ‘socks_init’: sockssocket.c:37:12: error: too few arguments to function ‘rsock_init_inetsock’ 37 | return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil); | ^~~~~~~~~~~~~~~~~~~ In file included from sockssocket.c:11: rubysocket.h:349:7: note: declared here 349 | VALUE rsock_init_inetsock(VALUE sock, VALUE remote_host, VALUE remote_serv, VALUE local_host, VALUE local_serv, int type, VALUE resolv_timeout, VALUE connect_timeout); | ^~~~~~~~~~~~~~~~~~~ make[2]: *** [Makefile:262: sockssocket.o] Error 1 make[2]: Leaving directory '/dev/shm/portage/dev-lang/ruby-3.0.0/work/ruby-3.0.0/ext/socket' make[1]: *** [exts.mk:285: ext/socket/all] Error 2 make[1]: Leaving directory '/dev/shm/portage/dev-lang/ruby-3.0.0/work/ruby-3.0.0' make: *** [uncommon.mk:300: build-ext] Error 2 Bug reported upstream: https://bugs.ruby-lang.org/issues/17187 I will also upload a quick fix here that can be used as a user patch while you fix it in portage :) ... Thanks Reproducible: Always
Created attachment 680077 [details, diff] ruby3-socksocket-fix.patch The patch adds the new extra argument to the return of the sock init function.
In the upstream bug you mention that this fixes compilation, but did you also test if the socks functionality works?
(In reply to Hans de Graaff from comment #2) > In the upstream bug you mention that this fixes compilation, but did you > also test if the socks functionality works? Nope I did not have that extra time :) Though I followed the changes that they did when implementing the resolve timeout feature changes ( https://github.com/ruby/ruby/commit/511fe23fa2bdf1f17faa91e0558be47b5bb62b2a ) and then the ones causing the above bug and they seem consistent now when the parameter is added :) Anyway upstream fixed this error an hour ago :) https://github.com/ruby/ruby/commit/1ffb267c5c782ea15d01beb90d031274ca88cd8e with the same change as in the patch, so I guess that is all for this bug... though as you say testing is a good practise :)...
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=628ac95758dbf75a9008e370c032890355eca716 commit 628ac95758dbf75a9008e370c032890355eca716 Author: Hans de Graaff <graaff@gentoo.org> AuthorDate: 2020-12-29 10:34:20 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2020-12-29 10:34:57 +0000 dev-lang/ruby: fix compilation with USE=socks5 Thanks to Phobos Kappa for providing the patch both to use and upstream. Closes: https://bugs.gentoo.org/762253 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Hans de Graaff <graaff@gentoo.org> dev-lang/ruby/files/3.0/001-socksocket-fix.patch | 15 ++ dev-lang/ruby/ruby-3.0.0-r1.ebuild | 262 +++++++++++++++++++++++ 2 files changed, 277 insertions(+)