RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

#include "../../deps/mbedtls/cacert.h" even when using --disable-builtinmbedtls

Open apteryks opened this issue 1 year ago • 2 comments

Description

Attempting to build with a minimal set of deps/ (i.e. deleting all the sub-directories there which are ought not be used), the build fails attempting to include the bundled mbedtls/cacert.h header.

Expected behavior

It should use the header from the system-provided provided mbedtls.

Actual behavior

It uses a bundled source header that it shouldn't. The error at build time is:

libretro-common/net/net_socket_ssl_mbed.c:49:10: fatal error: ../../deps/mbedtls/cacert.h: No such file or directory
   49 | #include "../../deps/mbedtls/cacert.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:207: obj-unix/release/./libretro-common/net/net_socket_ssl_mbed.o] Error 1

Steps to reproduce the bug

  1. Clone source
  2. Delete deps/mbedtls directory
  3. Configure with --disable-builtinmbedtls
  4. Run 'make'

Version/Commit

You can find this information under Information/System Information

  • RetroArch: 1.19.1

Environment information

  • OS: Guix System (GNU/Linux)
  • Compiler: GCC 11

apteryks avatar Sep 27 '24 11:09 apteryks

Hm, that cacert.h file is not actually from mbedtls, it seems to have originated from somewhere else, as a comment at the top of the file says.

apteryks avatar Sep 27 '24 12:09 apteryks

Seems it's a dated root certificate from 2017 produced by Mozilla; is this really needed?

apteryks avatar Sep 27 '24 12:09 apteryks

I checked it a bit, it is a basic trust store, but I suspect in some circumstances it still gets used. It may still be valid, I randomly checked some website and the root certificate is from 2015. Before digging into more details, is there anything specific you want to achieve, where this file is a bottleneck?

zoltanvb avatar Oct 23 '24 18:10 zoltanvb

I refreshed the retroarch packaging in GNU Guix, and typically we clean up the source by removing the bundled libraries such as deps/mbedtls, and was surprised to see some sources still referring to it.

Ideally if I build with --disable-builtinmbedtls nothing under deps/mbedtls should be used.

apteryks avatar Oct 24 '24 02:10 apteryks

I guess it could be moved to libretro_common/net, as nothing else seems to use it.

zoltanvb avatar Oct 24 '24 20:10 zoltanvb