VitoVan / pango-cairo-wasm

PangoCairo on the Web
https://vitovan.com/pango-cairo-wasm/
Do What The F*ck You Want To Public License
9 stars 4 forks source link

Issues building Fribidi across multiple distros #3

Closed notsilverhoft closed 1 week ago

notsilverhoft commented 2 weeks ago

I have tried to build on Fedora with and without docker, on Debian with and without docker, and on Codespaces with and without docker. When building with an edited build.sh file on Codespaces and Debian, I was able to build Fribidi with no issues, but Pango would always fail, the problem seemed to be with the cpu section of the meson crossfile, from memory, I believe it said something to the effect of "host 'emscripten', and host cpu type 'wasm32' are not supported". I know for sure that's not exactly what it said, and I no longer have the edited file, I may have logs but I'm not sure. I became frustrated, as I had edited everything I could, and I still had no luck, so I took some time to think. I thought maybe the issue was just the fact that I had been using the wrong distribution. I used VirtualBox to try and build from Fedora, and with some editing I came across the exact same issue. So I finally went to docker. I was already in the Fedora virtual machine, and I attempted to build from Docker. I was not even able to reach Pango, because Fribidi had failed building:

8 778.1 Running c2man

8 778.1 ../missing: line 81: c2man: command not found

8 778.1 WARNING: 'c2man' is missing on your system.

8 778.1 You might have modified some files without having the proper

8 778.1 tools for further handling them. Check the 'README' file, it

8 778.1 often tells you about the needed prerequisites for installing

8 778.1 this package. You may also peek at any GNU archive site, in

8 778.1 case some other package contains this missing 'c2man' program.

8 778.1 make[3]: Entering directory '/magic/fribidi/doc'

8 778.1 make[3]: Entering directory '/magic/fribidi/doc'

8 778.1 make[3]: Entering directory '/magic/fribidi/doc'

8 778.1 make[3]: Entering directory '/magic/fribidi/doc'

8 778.1 Running c2man

8 778.1 ../missing: line 81: c2man: command not found

8 778.1 ln: failed to create symbolic link './fribidi-arabic.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-begindecls.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-common.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-char-sets.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-char-sets-list.h'ln: failed to create symbolic link './fribidi-arabic.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-begindecls.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-common.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-char-sets.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-char-sets-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-deprecated.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-enddecls.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-flags.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-mirroring.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-brackets.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-shape.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode-version.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi.h': File exists

8 778.1 : File exists

8 778.1 ln: cp: 'fribidi-arabic.h' and './fribidi-arabic.h' are the same file

8 778.1 cp: 'fribidi-begindecls.h' and './fribidi-begindecls.h' are the same file

8 778.1 cp: 'fribidi-bidi.h' and './fribidi-bidi.h' are the same file

8 778.1 cp: 'fribidi-bidi-types.h' and './fribidi-bidi-types.h' are the same file

8 778.1 cp: 'fribidi-bidi-types-list.h' and './fribidi-bidi-types-list.h' are the same file

8 778.1 cp: 'fribidi-common.h' and './fribidi-common.h' are the same file

8 778.1 cp: 'fribidi-char-sets.h' and './fribidi-char-sets.h' are the same file

8 778.1 cp: 'fribidi-char-sets-list.h' and './fribidi-char-sets-list.h' are the same file

8 778.1 cp: 'fribidi-deprecated.h' and './fribidi-deprecated.h' are the same file

8 778.1 cp: 'fribidi-enddecls.h' and './fribidi-enddecls.h' are the same file

8 778.1 cp: 'fribidi-flags.h' and './fribidi-flags.h' are the same file

8 778.1 cp: 'fribidi-joining.h' and './fribidi-joining.h' are the same file

8 778.1 cp: 'fribidi-joining-types.h' and './fribidi-joining-types.h' are the same file

8 778.1 cp: 'fribidi-joining-types-list.h' and './fribidi-joining-types-list.h' are the same file

8 778.1 cp: 'fribidi-mirroring.h' and './fribidi-mirroring.h' are the same file

8 778.1 cp: 'fribidi-brackets.h' and './fribidi-brackets.h' are the same file

8 778.1 cp: 'fribidi-shape.h' and './fribidi-shape.h' are the same file

8 778.1 cp: 'fribidi-types.h' and './fribidi-types.h' are the same file

8 778.1 cp: 'fribidi-unicode.h' and './fribidi-unicode.h' are the same file

8 778.1 cp: 'fribidi-unicode-version.h' and './fribidi-unicode-version.h' are the same file

8 778.1 cp: 'fribidi.h' and './fribidi.h' are the same file

8 778.1 failed to create symbolic link './fribidi-deprecated.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-enddecls.h'make[3]: *** [Makefile:599: c2man.stamp] Error 1

8 778.1 make[3]: Leaving directory '/magic/fribidi/doc'

8 778.1 : File exists

8 778.1 make[2]: *** [Makefile:607: fribidi_debug_status.3] Error 2

8 778.1 make[2]: *** Waiting for unfinished jobs....

8 778.1 ln: failed to create symbolic link './fribidi-flags.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-mirroring.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-brackets.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-shape.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode-version.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi.h': File exists

8 778.1 ln: cp: 'fribidi-arabic.h' and './fribidi-arabic.h' are the same file

8 778.1 cp: 'fribidi-begindecls.h' and './fribidi-begindecls.h' are the same file

8 778.1 cp: 'fribidi-bidi.h' and './fribidi-bidi.h' are the same filefailed to create symbolic link './fribidi-arabic.h'

8 778.1 : File exists

8 778.1 ln: cp: failed to create symbolic link './fribidi-begindecls.h''fribidi-bidi-types.h' and './fribidi-bidi-types.h' are the same file

8 778.1 : File exists

8 778.1 ln: cp: 'fribidi-bidi-types-list.h' and './fribidi-bidi-types-list.h' are the same file

8 778.1 cp: 'fribidi-common.h' and './fribidi-common.h' are the same file

8 778.1 cp: 'fribidi-char-sets.h' and './fribidi-char-sets.h' are the same file

8 778.1 cp: 'fribidi-char-sets-list.h' and './fribidi-char-sets-list.h' are the same file

8 778.1 cp: 'fribidi-deprecated.h' and './fribidi-deprecated.h' are the same file

8 778.1 cp: 'fribidi-enddecls.h' and './fribidi-enddecls.h' are the same filefailed to create symbolic link './fribidi-bidi.h'

8 778.1 : File existscp: 'fribidi-flags.h' and './fribidi-flags.h' are the same file

8 778.1 cp: 'fribidi-joining.h' and './fribidi-joining.h' are the same file

8 778.1

8 778.1 cp: 'fribidi-joining-types.h' and './fribidi-joining-types.h' are the same file

8 778.1 cp: 'fribidi-joining-types-list.h' and './fribidi-joining-types-list.h' are the same file

8 778.1 cp: 'fribidi-mirroring.h' and './fribidi-mirroring.h' are the same file

8 778.1 cp: 'fribidi-brackets.h' and './fribidi-brackets.h' are the same file

8 778.1 cp: 'fribidi-shape.h' and './fribidi-shape.h' are the same file

8 778.1 cp: 'fribidi-types.h' and './fribidi-types.h' are the same file

8 778.1 cp: 'fribidi-unicode.h' and './fribidi-unicode.h' are the same file

8 778.1 cp: 'fribidi-unicode-version.h' and './fribidi-unicode-version.h' are the same file

8 778.1 cp: 'fribidi.h' and './fribidi.h' are the same file

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-bidi-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-common.h': File exists

8 778.1 ln: make[3]: *** [Makefile:599: c2man.stamp] Error 1

8 778.1 make[3]: Leaving directory '/magic/fribidi/doc'

8 778.1 failed to create symbolic link './fribidi-char-sets.h'make[2]: *** [Makefile:607: fribidi_get_bidi_type.3] Error 2

8 778.1 : File exists

8 778.1 ln: failed to create symbolic link './fribidi-char-sets-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-deprecated.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-enddecls.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-flags.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types.h'WARNING: 'c2man' is missing on your system.

8 778.1 You might have modified some files without having the proper

8 778.1 tools for further handling them. Check the 'README' file, it

8 778.1 often tells you about the needed prerequisites for installing

8 778.1 this package. You may also peek at any GNU archive site, in

8 778.1 case some other package contains this missing 'c2man' program.

8 778.1 : File exists

8 778.1 ln: failed to create symbolic link './fribidi-joining-types-list.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-mirroring.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-brackets.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-shape.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-types.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi-unicode-version.h': File exists

8 778.1 ln: failed to create symbolic link './fribidi.h': File exists

8 778.1 cp: cannot stat 'fribidi-arabic.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-begindecls.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-bidi.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-bidi-types.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-bidi-types-list.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-common.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-char-sets.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-char-sets-list.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-deprecated.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-enddecls.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-flags.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-joining.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-joining-types.h': No such file or directory

8 778.1 cp: cannot stat 'fribidi-joining-types-list.h': No such file or directory

8 778.1 cp: 'fribidi-mirroring.h' and './fribidi-mirroring.h' are the same file

8 778.1 cp: 'fribidi-brackets.h' and './fribidi-brackets.h' are the same file

8 778.1 cp: 'fribidi-shape.h' and './fribidi-shape.h' are the same file

8 778.1 cp: 'fribidi-types.h' and './fribidi-types.h' are the same file

8 778.1 cp: 'fribidi-unicode.h' and './fribidi-unicode.h' are the same file

8 778.1 cp: 'fribidi-unicode-version.h' and './fribidi-unicode-version.h' are the same file

8 778.1 cp: 'fribidi.h' and './fribidi.h' are the same file

8 778.1 make[3]: *** [Makefile:599: c2man.stamp] Error 1

8 778.1 make[3]: Leaving directory '/magic/fribidi/doc'

8 778.1 make[2]: *** [Makefile:607: fribidi_get_bidi_type_name.3] Error 2

8 778.1 make[3]: Leaving directory '/magic/fribidi/doc'

8 778.1 make[2]: Leaving directory '/magic/fribidi/doc'

8 778.1 make[1]: *** [Makefile:506: all-recursive] Error 1

8 778.1 make[1]: Leaving directory '/magic/fribidi'

8 778.1 make: *** [Makefile:415: all] Error 2

8 778.1 emmake: error: 'make' failed (returned 2)

8 778.1 + check_result

8 778.1 + '[' 1 -eq 0 ']'

8 778.1 + echo 'SHIT HAPPENED.'

8 778.1 + exit 42

8 778.1 SHIT HAPPENED.

8 ERROR: process "/bin/sh -c bash build.sh" did not complete successfully: exit code: 42

------ > [4/5] RUN bash build.sh: 778.1 make[2]: Leaving directory '/magic/fribidi/doc' 778.1 make[1]: [Makefile:506: all-recursive] Error 1 778.1 make[1]: Leaving directory '/magic/fribidi' 778.1 make: [Makefile:415: all] Error 2 778.1 emmake: error: 'make' failed (returned 2) 778.1 + check_result 778.1 + '[' 1 -eq 0 ']' 778.1 + echo 'SHIT HAPPENED.' 778.1 + exit 42 778.1 SHIT HAPPENED. ------ Dockerfile:5 -------------------- 3 | WORKDIR /magic 4 | ENV magicdir=/magic 5 | >>> RUN bash build.sh 6 | RUN ["chmod", "+x", "/magic/entrypoint.sh"] 7 | ENTRYPOINT ["/magic/entrypoint.sh"] -------------------- ERROR: failed to solve: process "/bin/sh -c bash build.sh" did not complete successfully: exit code: 42

I noted that c2man was missing, so I searched the log for where the issue was, and there was an error in building c2man. So I tried to build it by itself, and it wasn't able to find the C compiler in Fedora. I tried making a fork of this repository, and updating the submodule, to see if it was a version issue, to no avail. So I am thinking the issue is with finding the C compilers on Fedora, I installed all of them just in case(Bison, Flex GCC, etc.), and tried to direct the install script to the exact path of the C compilers, including EMCC. I then tried it on my Linux Mint computer, and with some trial and error I was able to get c2man to install. So c2man installs on Debian distros, and has problems with Fedora, this would explain why I was able to get to Pango earlier. This made me wonder if it was just a question of file structure, and the locations of programs in Gedora, so I tried to build with docker in my Codespace, also based on Debian, and still received the same error. I then tried installing c2man individually and succeeded. It's possible it wont build because the docker image is Fedora, and the C compilers in Fedora just don't work, but I'm not sure. The only reason I came here was because I couldn't get Pango to build with WASM, and I have a project that requires both Pango and Cairo, to build with EMscripten. It does work with build.sh in Debian, but I still run into the Pango error, should I stick to docker, and solve this, or go back to native Debian, and open a new issue?

Thanks for reading.

VitoVan commented 2 weeks ago

To me, c2man is also a pain in the ass while building.

I will check this later, please stick to docker at this moment, since that is a reliable way to freeze the state of all those dependencies.

VitoVan commented 2 weeks ago

And the dev tools should be installed by these lines:

https://github.com/VitoVan/pango-cairo-wasm/blob/main/build.sh#L9-L29

notsilverhoft commented 2 weeks ago

To me, c2man is also a pain in the ass while building.

I will check this later, please stick to docker at this moment, since that is a reliable way to freeze the state of all those dependencies.

Ok, referencing the c2man issue, is it possible to rewrite Fribidi to ignore c2man, it seems kinda useless unless people really care about the Fribidi documentation I'm not sure why the actual build is so reliant on it.

VitoVan commented 2 weeks ago

is it possible to rewrite Fribidi to ignore c2man

It is possible, but I tried and gave up that idea, because it seems more clumsy than just build the damn c2man.

notsilverhoft commented 2 weeks ago

So, maybe you could find a way to build it once in Fedora, take the whole thing, and drop it in the project. The question is, why can't c2man see GCC on Fedora? And why isn't there any documentation on it? This thing was built to be a pain in the ass.

notsilverhoft commented 2 weeks ago

I'm curious if I just made a fork, I did build c2man, maybe I just put it in Fribidi, and removed the c2man build line in the build.sh, it would just go with it.

notsilverhoft commented 1 week ago

@VitoVan Issue was solved with #4 . This should work for Docker, I was also able to build Pango, I think Debian is just screwed.