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

Safe string #99

Merged
merged 6 commits into from
Jul 8, 2024
Merged

Safe string #99

merged 6 commits into from
Jul 8, 2024

Conversation

ygrek
Copy link
Owner

@ygrek ygrek commented Jun 16, 2024

including some changes from #98

@ygrek ygrek mentioned this pull request Jun 16, 2024
@hazofaifo
Copy link

Just to give some feedback, everything looks fine for the moment

Building on debian:stable-slim docker image

./configure --disable-gui --disable-multinet
make mlnet

Thanks a lot for the work

@ygrek ygrek merged commit 1169b92 into master Jul 8, 2024
16 of 27 checks passed
@ygrek
Copy link
Owner Author

ygrek commented Jul 8, 2024

thanks for testing!

@bestlem
Copy link

bestlem commented Jul 8, 2024

@YGek given the large change is it worth doing a new release?

@lulol
Copy link

lulol commented Jul 31, 2024

@ygrek I think that this is relevant here:

Building on ubuntu 22.04 docker image.

$ git clone https://github.com/ygrek/mldonkey.git
Cloning into 'mldonkey'...
remote: Enumerating objects: 32852, done.
remote: Counting objects: 100% (733/733), done.
remote: Compressing objects: 100% (429/429), done.
remote: Total 32852 (delta 326), reused 590 (delta 289), pack-reused 32119
Receiving objects: 100% (32852/32852), 15.33 MiB | 20.15 MiB/s, done.
Resolving deltas: 100% (27091/27091), done.
$ cd mldonkey
$ git branch
* master
$ ./configure --enable-batch --disable-directconnect --disable-fasttrack --disable-gnutella --disable-gnutella2 --enable-gui=newgui2
$ make
...
./svg_converter.byte icons/rsvg/menu_friends.ml_icons
make: ./svg_converter.byte: No such file or directory
make: *** [Makefile:5441: icons/rsvg/menu_friends.ml_icons] Error 127
$ make utils
...
/usr/bin/ocamlopt.opt -inline 10 -w +a-3-4-6-27-29-32-35-37-41-44-45-48-60    -I src/utils/extlib  -I src/utils/cdk  -I src/utils/bitstring  -I src/utils/lib  -I src/utils/ocamlrss  -I src/utils/xml-light  -I src/utils/net  -I tools  -I src/daemon/common  -I src/daemon/driver  -I src/utils/mp3tagui  -I src/config/unix  -I src/gtk2/gui  -I src/gtk2/gui/x11  -I src/gtk2/gui/win32  -I icons/rsvg  -I +lablgtk2  -I src/networks/fileTP  -I src/networks/bittorrent  -I src/networks/donkey -I +camlp4  -c tools/svg_converter.ml
File "tools/svg_converter.ml", line 31, characters 35-38:
31 |   let bufz = Zlib2.compress_string buf in
                                        ^^^
Error: This expression has type bytes but an expression was expected of type
         string
make[1]: *** [Makefile:5444: tools/svg_converter.cmx] Error 2
make[1]: Leaving directory '/data/mldonkey'
make: *** [Makefile:5203: utils] Error 2

Edit: added git clone output.

@ygrek
Copy link
Owner Author

ygrek commented Aug 1, 2024

this is not on git master right?
because it was fixed quite a while ago ae2c650
i see you are using make utils, which utils do you use?

@FabioLolix
Copy link

Hey I get the same error building from git master on Arch

File "src/networks/bittorrent/bTRate.ml", line 1:
Warning 70 [missing-mli]: Cannot find interface file.
File "src/utils/net/anyEndian.ml", line 1:
Warning 70 [missing-mli]: Cannot find interface file.
/usr/bin/ocamlc.opt -w +a-3-4-6-27-29-32-35-37-41-44-45-48-60  -verbose -ccopt "-I /byterun -o src/utils/cdk/gdstubs.o" -ccopt "-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -flto=auto   -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/sysprof-6 " -ccopt "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto " -cclib "-lz  " -cclib -lbz2 -c src/utils/cdk/gdstubs.c
/usr/bin/ocamlopt.opt -inline 10 -w +a-3-4-6-27-29-32-35-37-41-44-45-48-60    -I src/utils/extlib  -I src/utils/cdk  -I src/utils/bitstring  -I src/utils/lib  -I src/utils/ocamlrss  -I src/utils/xml-light  -I src/utils/net  -I tools  -I src/daemon/common  -I src/daemon/driver  -I src/utils/mp3tagui  -I src/config/unix  -I src/gtk2/gui  -I src/gtk2/gui/x11  -I src/gtk2/gui/win32  -I icons/rsvg  -I +lablgtk2  -I src/networks/direct_connect  -I src/networks/fasttrack  -I src/networks/fileTP  -I src/networks/bittorrent  -I src/networks/donkey -I +camlp4 -I +num -c src/utils/cdk/gd.ml
cp icons/rsvg/splash_screen.svg icons/rsvg/splash_screen.ml_icons
./svg_converter.byte icons/rsvg/splash_screen.ml_icons
make: ./svg_converter.byte: No such file or directory
make: *** [Makefile:5441: icons/rsvg/splash_screen.ml_icons] Error 127
make: *** Waiting for unfinished jobs....

And trying make utils manually I got

/bittorrent  -I src/networks/donkey -I +camlp4 -I +num -c tools/svg_converter.ml
File "tools/svg_converter.ml", line 31, characters 35-38:
31 |   let bufz = Zlib2.compress_string buf in
                                        ^^^
Error: This expression has type bytes but an expression was expected of type
         string
make[1]: *** [Makefile:5444: tools/svg_converter.cmx] Error 2
make[1]: uscita dalla directory «/home/fabio/Dev/Github/PKGBUILD-AUR_fix/m/mldonkey-git/src/mldonkey»
make: *** [Makefile:5203: utils] Error 2

@lulol
Copy link

lulol commented Aug 1, 2024

this is not on git master right? because it was fixed quite a while ago ae2c650

Yes. Just created a new docker builder container and cloned the repository. Edited the report post above accordingly to make it explicit.

i see you are using make utils, which utils do you use?

None personally.

The main make fails trying to call svg_converter.byte that is built with the utils and there it shows the relevant error.

@ygrek
Copy link
Owner Author

ygrek commented Aug 2, 2024

I cannot reproduce this, and CI cannot either. Please show full configure and build log from scratch.

@ygrek
Copy link
Owner Author

ygrek commented Aug 2, 2024

also afaict --enable-batch with --enable-gui (ie downloading and building lablgtk for the mlgui) doesn't work now, need to ugprade required lablgtk version, but i will wait to fix this until figure what happens here (meanwhile fixed unrelated other build failures in make utils)

@ygrek
Copy link
Owner Author

ygrek commented Aug 2, 2024

ok, i figured something out, and yes it was broken, but i didn't notice, please check latest master
(but i am still curious how do you manage to build gui with batch so please show full logs :) )

@FabioLolix
Copy link

Ok now I get

File "src/gtk2/gui/guiArt.ml", line 447, characters 13-18:
447 |         then avail.[i] <- (char_of_int !!O.gtk_misc_availability_max)
                   ^^^^^
Error: This expression has type string but an expression was expected of type
         bytes
make: *** [Makefile:5444: src/gtk2/gui/guiArt.cmx] Error 2
make: *** Waiting for unfinished jobs....

@lulol
Copy link

lulol commented Aug 2, 2024

Ubuntu 20.04-22.04 has liblablgtk2 packaged.
https://github.com/lulol/mldonkey/blob/172398fef5b29e15adc668d7890901686358f7d9/.github/workflows/appimage.yml#L17

$ dpkg -l *lablgtk*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version      Architecture Description
+++-=================================-============-============-=======================================================
ii  liblablgtk2-gl-ocaml              2.18.12-1    amd64        runtime libraries for OCaml bindings to GtkGL
un  liblablgtk2-gl-ocaml-0lp67        <none>       <none>       (no description available)
ii  liblablgtk2-gl-ocaml-dev          2.18.12-1    amd64        OCaml bindings to GtkGL
un  liblablgtk2-gl-ocaml-dev-0lp67    <none>       <none>       (no description available)
ii  liblablgtk2-gnome-ocaml           2.18.12-1    amd64        runtime libraries for OCaml bindings to GNOME
un  liblablgtk2-gnome-ocaml-4csf4     <none>       <none>       (no description available)
ii  liblablgtk2-gnome-ocaml-dev       2.18.12-1    amd64        OCaml bindings to GNOME
un  liblablgtk2-gnome-ocaml-dev-4csf4 <none>       <none>       (no description available)
ii  liblablgtk2-ocaml                 2.18.12-1    amd64        runtime libraries for OCaml bindings for GTK+ version 2
ii  liblablgtk2-ocaml-dev             2.18.12-1    amd64        OCaml bindings to Gtk+ version 2
un  liblablgtk2-ocaml-dev-ewvj8       <none>       <none>       (no description available)
un  liblablgtk2-ocaml-doc             <none>       <none>       (no description available)
un  liblablgtk2-ocaml-ewvj8           <none>       <none>       (no description available)

Also the code downloading and building lablgtk is prone to fail silently because frequently downloads are incomplete (or zero size) and leave a broken file which is not checked nor re-downloaded. #79 (comment)


@FabioLolix you may need #103

Or not... I see that @ygrek made conflicting changes after that PR. But still these are not enough to fix all the issues.

@ygrek
Copy link
Owner Author

ygrek commented Aug 7, 2024

gtk2 should build with safe-string now b9a1237

@ygrek
Copy link
Owner Author

ygrek commented Aug 7, 2024

if there are anymore related problems - please create new issue

@ygrek
Copy link
Owner Author

ygrek commented Aug 18, 2024

Released in 3.2.0
Thanks everybody who helped to make it happen

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

Successfully merging this pull request may close these issues.

6 participants