SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.75k stars 3.18k forks source link

Ports: Make them build, 2022 edition. #13070

Closed timschumi closed 1 year ago

timschumi commented 2 years ago

The current list of failing ports (i686 GNU, with #13063 already applied and when building in a clean ports tree) seems to be the following:

archanox commented 2 years ago

angband

checking for FT2... checking for i686-pc-serenity-freetype-config... no
checking for freetype-config... no
checking for FreeType -- version >= 7.0.1... no
configure: WARNING:

  The freetype-config script installed by FreeType 2 could not be found.
  If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
  your path, or set the FT2_CONFIG environment variable to the
  full path to freetype-config.

configure: error: *** Unable to find FreeType2 library (http://www.freetype.org/)

ERROR: Build of dropbear was not successful!

Downloading URL: https://mirror.dropbear.nl/mirror/releases/dropbear-2019.78.tar.bz2
/usr/bin/curl
+ curl https://mirror.dropbear.nl/mirror/releases/dropbear-2019.78.tar.bz2 -L -o dropbear-2019.78.tar.bz2 (nocd)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2645k  100 2645k    0     0   647k      0  0:00:04  0:00:04 --:--:--  647k
Downloading URL: https://mirror.dropbear.nl/mirror/releases/dropbear-2019.78.tar.bz2.asc
/usr/bin/curl
+ curl https://mirror.dropbear.nl/mirror/releases/dropbear-2019.78.tar.bz2.asc -L -o dropbear-2019.78.tar.bz2.asc (nocd)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   833  100   833    0     0    548      0  0:00:01  0:00:01 --:--:--   548
Downloading URL: https://mirror.dropbear.nl/mirror/releases/dropbear-key-2015.asc
/usr/bin/curl
+ curl https://mirror.dropbear.nl/mirror/releases/dropbear-key-2015.asc -L -o dropbear-key-2015.asc (nocd)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2464  100  2464    0     0   1532      0  0:00:01  0:00:01 --:--:--  1533
gpg: assuming signed data in 'dropbear-2019.78.tar.bz2'
gpg: Signature made Thu 28 Mar 2019 01:17:55 AEDT
gpg:                using RSA key F7347EF2EE2E07A267628CA944931494F29C6773
gpg: [don't know]: invalid packet (ctb=2d)
gpg: keydb_search failed: Invalid packet
gpg: [don't know]: invalid packet (ctb=2d)
gpg: keydb_search failed: Invalid packet
gpg: Can't check signature: No public key
- Signature check NOT OK
  Signature mismatching, removed erronous download.
Please run script again.

ERROR: Build of glib was not successful!

Configuring glib...
+ meson _build --cross-file ../cross_file-i686.txt
../.port_include.sh: line 109: meson: command not found

sudo apt install meson

meson.build:860:2: ERROR: C shared or static library 'dl' not found

ERROR: Build of gnupg was not successful!

configure:
***
*** You need libgcrypt to build this program.
**  This library is for example available at
***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
*** (at least version 1.8.0 (API 1) is required.)
***
configure:
***
*** You need libksba to build this program.
*** This library is for example available at
***   ftp://ftp.gnupg.org/gcrypt/libksba/
*** (at least version 1.2.0 using API 1 is required).
***

sudo apt install libgcrypt-dev libksba-dev

/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: /home/pierce/serenity/Build/i686/Root/usr/local/lib/libnpth.so: undefined reference to symbol 'pthread_create'
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: /home/pierce/serenity/Toolchain/../Build/i686/Root/usr/lib/libpthread.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:753: keyboxd] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/libkeybox509_a-kbx-client-util.Tpo .deps/libkeybox509_a-kbx-client-util.Po
make[2]: Leaving directory '/home/pierce/serenity/Ports/gnupg/gnupg-2.3.0/kbx'
make[1]: *** [Makefile:631: all-recursive] Error 1
make[1]: Leaving directory '/home/pierce/serenity/Ports/gnupg/gnupg-2.3.0'
make: *** [Makefile:551: all] Error 2

ERROR: Build of gnuplot was not successful!

collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:834: gnuplot] Error 1
make[4]: Leaving directory '/home/pierce/serenity/Ports/gnuplot/gnuplot-5.2.8/src'
make[3]: *** [Makefile:1021: all-recursive] Error 1
make[3]: Leaving directory '/home/pierce/serenity/Ports/gnuplot/gnuplot-5.2.8/src'
make[2]: *** [Makefile:690: all] Error 2
make[2]: Leaving directory '/home/pierce/serenity/Ports/gnuplot/gnuplot-5.2.8/src'
make[1]: *** [Makefile:433: all-recursive] Error 1
make[1]: Leaving directory '/home/pierce/serenity/Ports/gnuplot/gnuplot-5.2.8'
make: *** [Makefile:372: all] Error 2

ERROR: Build of halflife was not successful! fontconfig isn't installed correctly. Make sure you installed proper development package for target architecture ERROR: Build of imagemagick was not successful!

MagickCore/magick.c:101:12: fatal error: libxml/parser.h: No such file or directory
101 | #  include <libxml/parser.h>
|            ^~~~~~~~~~~~~~~~~

ERROR: Build of imgcat was not successful!

checking for term.h... /tmp/conftest.1996983.c:1:12: fatal error: term.h: No such file or directory
1 |   #include <term.h>
|            ^~~~~~~~

ERROR: Build of libopenal was not successful!

/home/pierce/serenity/Ports/libopenal/openal-soft-1.21.1/examples/alffplay.cpp:1716:40: error: invalid conversion from 'const AVCodec*' to 'AVCodec*' [-fpermissive]
 1716 |     AVCodec *codec{avcodec_find_decoder(avctx->codec_id)};
      |                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                        |
      |                                        const AVCodec*

links

Building links...
+ make -j8
i686-pc-serenity-gcc  -g -O2  -o links  af_unix.o auth.o beos.o bfu.o block.o bookmark.o cache.o charsets.o compress.o connect.o cookies.o data.o default.o dip.o directfb.o dither.o dns.o dos.o drivers.o error.o file.o finger.o fn_impl.o fontconf.o font_inc.o framebuf.o freetype.o ftp.o gif.o grx.o hpux.o html.o html_gr.o html_r.o html_tbl.o http.o https.o img.o imgcache.o jpeg.o jsint.o kbd.o language.o listedit.o lru.o mailto.o main.o memory.o menu.o objreq.o os_dep.o pmshell.o png.o sched.o select.o session.o smb.o string.o suffix.o svg.o svgalib.o terminal.o tiff.o types.o url.o view.o view_gr.o vms.o x.o xbm.o  -llzma -lbz2 -lzstd -lz -lssl -lcrypto
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: warning: libcrypto.so.1.1, needed by /home/pierce/serenity/Toolchain/../Build/i686/Root/usr/local/lib/libssl.so, may conflict with libcrypto.so.serenity
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: menu.o: undefined reference to symbol 'OpenSSL_version'
/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: /home/pierce/serenity/Toolchain/../Build/i686/Root/usr/local/lib/libcrypto.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:225: links] Error 1

ERROR: Build of mc was not successful! meson.build:860:2: ERROR: C shared or static library 'dl' not found

ERROR: Build of nethack was not successful!

/usr/include/x86_64-linux-gnu/sys/cdefs.h:345:73: error: macro "__has_attribute" requires an identifier
  345 | #if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
      |                                                                         ^

ERROR: Build of openttd was not successful!

/home/pierce/serenity/Toolchain/Local/i686/lib/gcc/i686-pc-serenity/11.2.0/../../../../i686-pc-serenity/bin/ld: /home/pierce/serenity/Build/superbuild-i686/../i686/Root/usr/local/lib/libfontconfig.a(fccfg.o): in function `IA__FcConfigFileInfoIterGet':
fccfg.c:(.text+0x612c): undefined reference to `libintl_dgettext'

ERROR: Build of opfor was not successful! ERROR: Build of qt6-qtbase was not successful! You need to have Qt 6.2.2 installed on the host (path /usr/lib64/cmake/Qt6HostInfo/ is missing) ERROR: Build of qt6-serenity was not successful! You need to have Qt 6.2.2 installed on the host (path /usr/lib64/cmake/Qt6HostInfo/ is missing) ERROR: Build of radare2 was not successful! ERROR: Build of ruby was not successful! Toolchain/BuildRuby.sh

gc.c:5602:38: error: expected identifier or '(' before 'static'
 5602 | ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(static void mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n));
      |                                      ^~~~~~

ERROR: Build of vlang was not successful!

EWouters commented 2 years ago

x86_64 build on M1 Mac

Errors:

Notes:

Edit: zlib fixed in SerenityOS/serenity/pull/13336 Edit2: More ports built Edit3: libmad fixed in SerenityOS/serenity/pull/13932 Edit4: dropbear, freeciv and glib working Edit5: bdwgc, halflife, imgcat, libsodium, openttd, opfor, radare2 are now working, jot, mandoc, stress-ng, tr and vitetris are now failing

BertalanD commented 2 years ago

The zlib build error is caused by an upstream bug. The fix is in this commit: https://github.com/madler/zlib/commit/05796d3d8d5546cf1b4dfe2cd72ab746afae505d

I can backport that in a sec.

EWouters commented 2 years ago

This PR (https://github.com/SerenityPorts/SerenityDOOM/pull/11) makes doom build on x86_64 as well.

archanox commented 2 years ago

On Debian/Ubuntu I've found that I needed to install the following packages

sudo apt install libsdl2-dev automake autoconf lzip gperf nasm yasm meson gettext help2man libgpg-error-dev autopoint bison lua5.3 python2 rake python-is-python3 imagemagick

timschumi commented 2 years ago

On Debian/Ubuntu I've found that I needed to install the following packages

sudo apt install libsdl2-dev automake autoconf lzip gperf nasm yasm meson gettext help2man libgpg-error-dev autopoint bison lua5.3 python2 rake python-is-python3 imagemagick

How many of those are actually needed (i.e. it's intended that they are present on the host, not on the target)? I know that lzip is required by some downloads, sadly we don't have any alternative options there. meson, bison and rake also make sense, since they are build tools. yasm/nasm is required by ffmpeg, as it needs an assembler. But where does the rest come from? Because it rather looks like that we are leaking host headers or libraries in half of those cases.

spahan commented 2 years ago

the nethack issue sounds like this one: https://github.com/NetHack/NetHack/commit/1cb5dc04605daa45f1c6a647c17442ed7ff2fe4e

RonjaPonja commented 2 years ago

dropbear update and fix: https://github.com/SerenityOS/serenity/pull/13827

gouchi commented 2 years ago

p7zip compiles fine for i686

Compilation ``` [100%] Linking CXX shared module 7z.so [100%] Built target 7z Installing p7zip... + cp -r bin/Codecs /stockage/serenity/Build/i686/Root/usr/local/bin + cp bin/7z_ /stockage/serenity/Build/i686/Root/usr/local/bin + cp bin/7z.so /stockage/serenity/Build/i686/Root/usr/local/bin + cp bin/7za /stockage/serenity/Build/i686/Root/usr/local/bin + cp bin/7zCon.sfx /stockage/serenity/Build/i686/Root/usr/local/bin + cp bin/7zr /stockage/serenity/Build/i686/Root/usr/local/bin Adding p7zip 17.04 to database of installed ports... Successfully installed p7zip 17.04. ```
gouchi commented 2 years ago

For radare2, it seems there is some issue on enum from <AK/platform.h> ?

EWouters commented 2 years ago

Libmad compiles for me if I set use_fresh_config_sub to false. Can someone on Linux test if it compiles like that on Linux as well? And possibly on Windows?

gouchi commented 2 years ago

Libmad compiles for me if I set use_fresh_config_sub to false. Can someone on Linux test if it compiles like that on Linux as well?

On Linux, I got this issue if I set use_fresh_config_sub to false.

Compilation ``` Installing dependencies of libmad... Fetching libmad... Downloading URL: https://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz /usr/bin/curl + curl https://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz -L -o libmad-0.15.1b.tar.gz (nocd) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 376 100 376 0 0 576 0 --:--:-- --:--:-- --:--:-- 576 100 347 100 347 0 0 130 0 0:00:02 0:00:02 --:--:-- 348 100 490k 100 490k 0 0 171k 0 0:00:02 0:00:02 --:--:-- 2347k Expecting sha256sum: bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 sha256sum(libmad-0.15.1b.tar.gz) = 'bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690' + tar -xzf libmad-0.15.1b.tar.gz (nocd) + touch .libmad-0.15.1b.tar.gz_extracted Patching libmad... + patch -p1 patching file configure + touch .0001-Remove-fforce-mem-GCC-argument.patch_applied Configuring libmad... + ./configure --host=i686-pc-serenity --disable-static configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used. checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for i686-pc-serenity-strip... i686-pc-serenity-strip checking build system type... x86_64-unknown-linux-gnu checking host system type... Invalid configuration `i686-pc-serenity': system `serenity' not recognized configure: error: /bin/sh ./config.sub i686-pc-serenity failed ```
EWouters commented 2 years ago

Thank you for testing! I found a better solution: https://github.com/SerenityOS/serenity/pull/13932. Maybe you can check if that compiles :)

gouchi commented 2 years ago

Thank you for testing! I found a better solution: #13932. Maybe you can check if that compiles :)

It is compiling on Linux.

ADKaster commented 2 years ago

After the conversion to use libtool, some ports (e.g. freetype) are missing the --with-sysroot=${SERENITY_INSTALL_ROOT} configopts for telling libtool where to look for shlibs.

circl-lastname commented 2 years ago

powdertoy seems to fail based on the version of Meson used (glib also uses host headers but it doesn't cause an error), I'd have to bisect it when it stops working. luajit looks like assembler incompatibilities? The way it does cross-compilation is pretty funky

Update: Meson only works correctly on Ubuntu? Seems like sys_root is only used for pkg-config, and not for headers on Arch distributions.

Update: This is actually caused my Arch shipping pkgconf, and Ubuntu shipping pkg-config, thus the inconsistency. Setting sys_root in the cross-file sets the PKG_CONFIG_SYSROOT_DIR, this has different behavior on pkgconf and doesn't change the include path to the one in Serenity. See pkgconf/pkgconf#251

jrnewton commented 2 years ago

On Debian/Ubuntu I've found that I needed to install the following packages

sudo apt install libsdl2-dev automake autoconf lzip gperf nasm yasm meson gettext help2man libgpg-error-dev autopoint bison lua5.3 python2 rake python-is-python3 imagemagick

I'm working my way through each package individually and collecting the list of missing deps (see gist)

What's the best way to address the problem - a PR against BuildInstructions.md or some other readme file?

ADKaster commented 2 years ago

@jrnewton That's a good question. We don't currently have any such list for host dependencies. Perhaps a new .md file in Ports would be a good place for them? HostDependencies.md or so?

EWouters commented 2 years ago

The host dependencies are hard to specify, as they depend on the host, and are subject to changes.

jrnewton commented 2 years ago

It might be hard but the experience of building ports on a fresh host system was really bad. Very whack-a-mole with lots of time spent building, reviewing failure output, googling for a package name, installing the package and then building again, hoping that it works.

When you look at something like the SuperMario port, it seems pretty reasonable to tell the user that SDL is needed (libsdl2-dev, libsdl2-image-dev and libsdl2-mixer-dev).

timschumi commented 2 years ago

When you look at something like the SuperMario port, it seems pretty reasonable to tell the user that SDL is needed (libsdl2-dev, libsdl2-image-dev and libsdl2-mixer-dev).

In no way should that be required. Headers are already installed by installing the SDL2 ports as well as its addons.

The only host dependencies that should be required are additional build tools (e.g. meson) or compilers/assemblers (e.g. nasm).

jrnewton commented 2 years ago

I'm going to do a reset and try installing super mario again. I'm pretty sure that the SDL2 port did not ensure the host libraries were present, and thus errors like this occurred:

-- Checking for one of the modules 'sdl2' CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:707 (message): None of the required 'sdl2' found Call Stack (most recent call first): CMakeLists.txt:23 (PKG_SEARCH_MODULE)

I will be very happy to be wrong on this :)

timschumi commented 2 years ago

There is no question that it doesn't currently work unless SDL2 is installed on the host. But the solution to that should be to make the port use the SDL2 headers that are installed as a part of the port, not to just note down that the host should install SDL2.

gouchi commented 1 year ago

mgba (Tries to use Qt)

mgba compiles fine adding

diff --git a/Ports/mgba/package.sh b/Ports/mgba/package.sh
index 94a62c569c..40e9ca920c 100755
--- a/Ports/mgba/package.sh
+++ b/Ports/mgba/package.sh
@@ -3,7 +3,7 @@ port=mgba
 version=0.9.3
 files="https://github.com/mgba-emu/mgba/archive/refs/tags/${version}.tar.gz mgba-${version}.tar.gz 692ff0ac50e18380df0ff3ee83071f9926715200d0dceedd9d16a028a59537a0"
 auth_type=sha256
-configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
+configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"  "-DBUILD_QT=OFF")
 useconfigure=true
 depends=("SDL2" "zlib" "sqlite" "libpng" "libzip")
timschumi commented 1 year ago

Superseded by #18238.