Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
90b58a2
Add read-only NFSv3 client support via bundled libnfs.
theromis Jul 27, 2026
25dcce8
Makefile.webos: enable builtin NFSv3 client for IPK builds
theromis Jul 27, 2026
9fb6b52
Makefile.webos: prefer libnfs slist.h when building bundled NFS
theromis Jul 27, 2026
b07240f
nfs: harden mount path for webOS and surface mount errors
theromis Jul 27, 2026
aace6ef
nfs: stage network content locally before core load
theromis Jul 27, 2026
1520467
Fix CI: C89 path_resolve_realpath and macOS-only NFS flags.
theromis Jul 27, 2026
5ac510c
libnfs: drop unused rpcgen buf locals and guard _GNU_SOURCE.
theromis Jul 27, 2026
db0d26b
nfs/smb: stage archive file before #entry when caching VFS URLs.
theromis Jul 27, 2026
ced1bee
Fix Apple BaseConfig.xcconfig comment syntax for Xcode.
theromis Jul 27, 2026
b008800
nfs: allow VFS write/create/truncate on NFSv3 mounts.
theromis Jul 27, 2026
36d426c
Merge upstream master into feature/nfs-client-readonly-v3.
theromis Jul 27, 2026
a93d676
apple: enable bundled NFS client for iOS and tvOS.
theromis Jul 27, 2026
7c555c0
android: enable builtin NFSv3 client in phoenix NDK build.
theromis Jul 27, 2026
32163c1
linux: enable bundled NFS client by default.
theromis Jul 27, 2026
75c467a
windows: enable NFS client for MSVC, UWP and MinGW.
theromis Jul 27, 2026
64ed7dc
android: define HAVE_SYS_SYSMACROS_H for bundled libnfs.
theromis Jul 27, 2026
e729c38
nfs: guard settings_show_nfs_client behind HAVE_MENU.
theromis Jul 27, 2026
effb086
windows: add libnfs win32_errnowrapper.h for MSVC builds.
theromis Jul 27, 2026
f69a55f
nfs: fix CI builds for C89, --disable-networking, and MinGW.
theromis Jul 27, 2026
21400c4
windows: compile bundled libnfs as C under MSVC.
theromis Jul 27, 2026
753b4fd
nfs: match C89 flag override to ./libretro-common object path.
theromis Jul 27, 2026
59ff513
console: enable bundled NFS client on networked platforms.
theromis Jul 27, 2026
4d7dd2e
content: stage nfs/smb only when VFS or #entry requires it.
theromis Jul 27, 2026
6918c23
console: disable NFS until libnfs has platform ports.
theromis Jul 27, 2026
6539daa
content: unify VFS URL staging for local, nfs, and smb paths.
theromis Jul 27, 2026
46acc77
Merge remote-tracking branch 'upstream/master' into feature/nfs-clien…
theromis Jul 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,26 @@ CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS) -D__STDC_CONSTANT_MACROS
OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS

# libsmb2 and libnfs both ship include/slist.h with different macros
# (SMB2_LIST_* vs LIBNFS_LIST_*). Prepend libnfs include dirs for its
# own objects so "#include \"slist.h\"" resolves correctly when both
# clients are enabled.
#
# Vendored libnfs is not C89-clean (trailing commas, // comments). Strip
# C89_BUILD pedantic flags for libnfs TUs and the RetroArch NFS VFS shim
# that includes <nfsc/libnfs.h>.
ifneq (,$(filter 1,$(HAVE_NFSCLIENT) $(HAVE_BUILTINNFSCLIENT)))
LIBNFS_CFLAGS_FILTER := -std=c89 -ansi -pedantic -Werror=pedantic -Werror=declaration-after-statement
$(OBJDIR)/deps/libnfs/%.o: CFLAGS := \
-I$(DEPS_DIR)/libnfs/include -I$(DEPS_DIR)/libnfs/win32 -I$(DEPS_DIR)/libnfs \
$(filter-out $(LIBNFS_CFLAGS_FILTER),$(CFLAGS)) \
-std=gnu99 -Wno-pedantic
# LIBRETRO_COMM_DIR is "./libretro-common", so the object path keeps "./".
$(OBJDIR)/$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_nfs.o: CFLAGS := \
$(filter-out $(LIBNFS_CFLAGS_FILTER),$(CFLAGS)) \
-std=gnu99 -Wno-pedantic
endif

ifeq ($(HAVE_CXX), 1)
ifeq ($(CXX_BUILD), 1)
LINK = $(CXX)
Expand Down
89 changes: 89 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,95 @@ endif
OBJ += $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_smb.o
endif

ifneq (,$(filter 1,$(HAVE_NFSCLIENT) $(HAVE_BUILTINNFSCLIENT)))
DEFINES += -DHAVE_NFSCLIENT

ifeq ($(HAVE_NFSCLIENT),1)
ifeq ($(shell pkg-config --exists libnfs && echo yes),yes)
CFLAGS += $(shell pkg-config --cflags libnfs)
LIBS += $(shell pkg-config --libs libnfs)
else
LIBS += -lnfs
endif
else ifeq ($(HAVE_BUILTINNFSCLIENT),1)
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/include
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/include/nfsc
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/mount
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/nfs
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/nfs4
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/nlm
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/nsm
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/portmap
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/rquota
ifneq ($(findstring Win32,$(OS)),)
# MinGW / MXE: use libnfs win32 shims (do not force Unix feature macros).
INCLUDE_DIRS += -I$(DEPS_DIR)/libnfs/win32
CFLAGS += '-D_U_=/**/' -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_STRING_H
CFLAGS += -DSTDC_HEADERS -DHAVE_SOCKADDR_STORAGE -DHAVE_UTIME_H
OBJ += deps/libnfs/win32/win32_compat.o
else
CFLAGS += "-D_U_=__attribute__((unused))"
# Avoid -DHAVE_CONFIG_H: RetroArch's own config.h would be picked
# up by libnfs "#include \"config.h\"". Pass feature macros instead.
CFLAGS += -DHAVE_ARPA_INET_H -DHAVE_DLFCN_H -DHAVE_INTTYPES_H
CFLAGS += -DHAVE_MEMORY_H -DHAVE_NETDB_H -DHAVE_NETINET_IN_H
CFLAGS += -DHAVE_NETINET_TCP_H -DHAVE_NET_IF_H -DHAVE_POLL_H
CFLAGS += -DHAVE_PWD_H -DHAVE_SOCKADDR_STORAGE -DHAVE_STDINT_H
CFLAGS += -DHAVE_STDLIB_H -DHAVE_STDATOMIC_H -DHAVE_STRINGS_H
CFLAGS += -DHAVE_STRING_H -DHAVE_SYS_IOCTL_H -DHAVE_SYS_STATVFS_H
CFLAGS += -DHAVE_SYS_STAT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H
CFLAGS += -DHAVE_SYS_UIO_H -DHAVE_UNISTD_H -DHAVE_UTIME_H
CFLAGS += -DHAVE_SIGNAL_H -DHAVE_SYS_UTSNAME_H -DSTDC_HEADERS
ifeq ($(findstring Darwin,$(OS)),)
CFLAGS += -DHAVE_CLOCK_GETTIME -DHAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
endif
ifneq ($(findstring Darwin,$(OS)),)
CFLAGS += -DHAVE_SOCKADDR_LEN -DHAVE_SYS_FILIO_H
endif
ifneq ($(findstring Linux,$(OS)),)
CFLAGS += -DHAVE_CLOCK_GETTIME -DHAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
CFLAGS += -DHAVE_SYS_VFS_H -DHAVE_SYS_SYSMACROS_H -DHAVE_SO_BINDTODEVICE
endif
ifeq ($(findstring Linux,$(OS)),)
ifeq ($(findstring Darwin,$(OS)),)
# Consoles / other non-glibc targets: mknod helpers need major()/minor().
CFLAGS += '-Dmajor(d)=((int)(((unsigned)(d)>>8)&0xff))'
CFLAGS += '-Dminor(d)=((int)((unsigned)(d)&0xff))'
endif
endif
endif
OBJ += \
deps/libnfs/lib/init.o \
deps/libnfs/lib/krb5-wrapper.o \
deps/libnfs/lib/libnfs.o \
deps/libnfs/lib/libnfs-sync.o \
deps/libnfs/lib/libnfs-zdr.o \
deps/libnfs/lib/multithreading.o \
deps/libnfs/lib/nfs_v3.o \
deps/libnfs/lib/nfs_v4.o \
deps/libnfs/lib/pdu.o \
deps/libnfs/lib/socket.o \
deps/libnfs/mount/mount.o \
deps/libnfs/mount/libnfs-raw-mount.o \
deps/libnfs/nfs/nfs.o \
deps/libnfs/nfs/nfsacl.o \
deps/libnfs/nfs/libnfs-raw-nfs.o \
deps/libnfs/nfs4/nfs4.o \
deps/libnfs/nfs4/libnfs-raw-nfs4.o \
deps/libnfs/nlm/nlm.o \
deps/libnfs/nlm/libnfs-raw-nlm.o \
deps/libnfs/nsm/nsm.o \
deps/libnfs/nsm/libnfs-raw-nsm.o \
deps/libnfs/portmap/portmap.o \
deps/libnfs/portmap/libnfs-raw-portmap.o \
deps/libnfs/rquota/rquota.o \
deps/libnfs/rquota/libnfs-raw-rquota.o
endif

OBJ += $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_nfs.o
endif

#####################################
### Android Play Feature Delivery ###
### (Play Store build core ###
Expand Down
9 changes: 9 additions & 0 deletions Makefile.webos
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINSMBCLIENT := 1
HAVE_BUILTINNFSCLIENT := 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
Expand Down Expand Up @@ -336,6 +337,14 @@ endif

-include $(RARCH_OBJ:.o=.d)

# libsmb2 and libnfs both ship include/slist.h with different macros
# (SMB2_LIST_* vs LIBNFS_LIST_*). Prepend libnfs include dirs for its
# own objects so "#include \"slist.h\"" resolves correctly when both
# clients are enabled. Same pattern as top-level Makefile.
ifneq (,$(filter 1,$(HAVE_NFSCLIENT) $(HAVE_BUILTINNFSCLIENT)))
$(OBJDIR)/deps/libnfs/%.o: CFLAGS := -I$(DEPS_DIR)/libnfs/include -I$(DEPS_DIR)/libnfs $(CFLAGS)
endif

SYMBOL_MAP := -Wl,-Map=output.map

prebuild:
Expand Down
8 changes: 8 additions & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@
#define DEFAULT_SETTINGS_SHOW_DIRECTORY true
#define DEFAULT_SETTINGS_SHOW_STEAM true
#define DEFAULT_SETTINGS_SHOW_SMB_CLIENT true
#define DEFAULT_SETTINGS_SHOW_NFS_CLIENT true

#define DEFAULT_QUICK_MENU_SHOW_RESUME_CONTENT true
#define DEFAULT_QUICK_MENU_SHOW_RESTART_CONTENT true
Expand Down Expand Up @@ -2020,3 +2021,10 @@
#define DEFAULT_SMB_CLIENT_TIMEOUT 5
#define DEFAULT_SMB_CLIENT_MAX_TIMEOUT 20
#endif

#ifdef HAVE_NFSCLIENT
#define DEFAULT_NFS_CLIENT_NUM_CONTEXTS 4
#define DEFAULT_NFS_CLIENT_MAX_CONTEXTS 20
#define DEFAULT_NFS_CLIENT_TIMEOUT 5
#define DEFAULT_NFS_CLIENT_MAX_TIMEOUT 20
#endif
61 changes: 61 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,12 @@ static struct config_array_setting *populate_settings_array(
SETTING_ARRAY("smb_client_workgroup", settings->arrays.smb_client_workgroup, false, NULL, true);
#endif

#ifdef HAVE_NFSCLIENT
SETTING_ARRAY("nfs_client_server_address", settings->arrays.nfs_client_server_address, false, NULL, true);
SETTING_ARRAY("nfs_client_export", settings->arrays.nfs_client_export, false, NULL, true);
SETTING_ARRAY("nfs_client_subdir", settings->arrays.nfs_client_subdir, false, NULL, true);
#endif

#ifdef HAVE_LAKKA
SETTING_ARRAY("cpu_main_gov", settings->arrays.cpu_main_gov, false, NULL, true);
SETTING_ARRAY("cpu_menu_gov", settings->arrays.cpu_menu_gov, false, NULL, true);
Expand Down Expand Up @@ -2117,6 +2123,9 @@ static struct config_bool_setting *populate_settings_bool(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client_auth.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client_opts.h"
#endif
#include "settings/settings_def_midi_volume.h"
#ifdef HAVE_NETWORKING
#include "settings/settings_def_netplay_ports.h"
Expand Down Expand Up @@ -2190,6 +2199,9 @@ static struct config_bool_setting *populate_settings_bool(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client.h"
#endif
#ifdef HAVE_NETWORKING
#ifdef HAVE_NETWORKGAMEPAD
#include "settings/settings_def_netplay_stateless.h"
Expand Down Expand Up @@ -2263,6 +2275,11 @@ static struct config_bool_setting *populate_settings_bool(
#include "settings/settings_def_settings_show_smb.h"
#endif
#ifdef HAVE_MENU
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_settings_show_nfs.h"
#endif
#endif
#ifdef HAVE_MENU
#ifdef HAVE_MIST
#include "settings/settings_def_settings_show_steam.h"
#endif
Expand Down Expand Up @@ -2827,6 +2844,9 @@ static struct config_float_setting *populate_settings_float(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client_auth.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client_opts.h"
#endif
#include "settings/settings_def_midi_volume.h"
#ifdef HAVE_NETWORKING
#include "settings/settings_def_netplay_ports.h"
Expand Down Expand Up @@ -2900,6 +2920,9 @@ static struct config_float_setting *populate_settings_float(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client.h"
#endif
#ifdef HAVE_NETWORKING
#ifdef HAVE_NETWORKGAMEPAD
#include "settings/settings_def_netplay_stateless.h"
Expand Down Expand Up @@ -2973,6 +2996,11 @@ static struct config_float_setting *populate_settings_float(
#include "settings/settings_def_settings_show_smb.h"
#endif
#ifdef HAVE_MENU
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_settings_show_nfs.h"
#endif
#endif
#ifdef HAVE_MENU
#ifdef HAVE_MIST
#include "settings/settings_def_settings_show_steam.h"
#endif
Expand Down Expand Up @@ -3495,6 +3523,9 @@ static struct config_uint_setting *populate_settings_uint(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client_auth.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client_opts.h"
#endif
#include "settings/settings_def_midi_volume.h"
#ifdef HAVE_NETWORKING
#include "settings/settings_def_netplay_ports.h"
Expand Down Expand Up @@ -3568,6 +3599,9 @@ static struct config_uint_setting *populate_settings_uint(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client.h"
#endif
#ifdef HAVE_NETWORKING
#ifdef HAVE_NETWORKGAMEPAD
#include "settings/settings_def_netplay_stateless.h"
Expand Down Expand Up @@ -3641,6 +3675,11 @@ static struct config_uint_setting *populate_settings_uint(
#include "settings/settings_def_settings_show_smb.h"
#endif
#ifdef HAVE_MENU
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_settings_show_nfs.h"
#endif
#endif
#ifdef HAVE_MENU
#ifdef HAVE_MIST
#include "settings/settings_def_settings_show_steam.h"
#endif
Expand Down Expand Up @@ -4200,6 +4239,9 @@ static struct config_int_setting *populate_settings_int(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client_auth.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client_opts.h"
#endif
#include "settings/settings_def_midi_volume.h"
#ifdef HAVE_NETWORKING
#include "settings/settings_def_netplay_ports.h"
Expand Down Expand Up @@ -4273,6 +4315,9 @@ static struct config_int_setting *populate_settings_int(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client.h"
#endif
#ifdef HAVE_NETWORKING
#ifdef HAVE_NETWORKGAMEPAD
#include "settings/settings_def_netplay_stateless.h"
Expand Down Expand Up @@ -4346,6 +4391,11 @@ static struct config_int_setting *populate_settings_int(
#include "settings/settings_def_settings_show_smb.h"
#endif
#ifdef HAVE_MENU
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_settings_show_nfs.h"
#endif
#endif
#ifdef HAVE_MENU
#ifdef HAVE_MIST
#include "settings/settings_def_settings_show_steam.h"
#endif
Expand Down Expand Up @@ -4792,6 +4842,9 @@ static struct config_int_setting *populate_settings_int(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client_auth.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client_opts.h"
#endif
#include "settings/settings_def_midi_volume.h"
#ifdef HAVE_NETWORKING
#include "settings/settings_def_netplay_ports.h"
Expand Down Expand Up @@ -4865,6 +4918,9 @@ static struct config_int_setting *populate_settings_int(
#ifdef HAVE_SMBCLIENT
#include "settings/settings_def_smb_client.h"
#endif
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_nfs_client.h"
#endif
#ifdef HAVE_NETWORKING
#ifdef HAVE_NETWORKGAMEPAD
#include "settings/settings_def_netplay_stateless.h"
Expand Down Expand Up @@ -4938,6 +4994,11 @@ static struct config_int_setting *populate_settings_int(
#include "settings/settings_def_settings_show_smb.h"
#endif
#ifdef HAVE_MENU
#ifdef HAVE_NFSCLIENT
#include "settings/settings_def_settings_show_nfs.h"
#endif
#endif
#ifdef HAVE_MENU
#ifdef HAVE_MIST
#include "settings/settings_def_settings_show_steam.h"
#endif
Expand Down
15 changes: 15 additions & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ typedef struct settings
unsigned smb_client_auth_mode;
unsigned smb_client_num_contexts;
unsigned smb_client_timeout;
#endif
#ifdef HAVE_NFSCLIENT
unsigned nfs_client_num_contexts;
unsigned nfs_client_timeout;
#endif
unsigned input_sensor_orientation;
} uints;
Expand Down Expand Up @@ -808,6 +812,9 @@ typedef struct settings
#endif
#ifdef HAVE_SMBCLIENT
bool settings_show_smb_client;
#endif
#if defined(HAVE_MENU) && defined(HAVE_NFSCLIENT)
bool settings_show_nfs_client;
#endif
bool quick_menu_show_resume_content;
bool quick_menu_show_restart_content;
Expand Down Expand Up @@ -1072,6 +1079,9 @@ typedef struct settings

#ifdef HAVE_SMBCLIENT
bool smb_client_enable;
#endif
#ifdef HAVE_NFSCLIENT
bool nfs_client_enable;
#endif
} bools;

Expand Down Expand Up @@ -1158,6 +1168,11 @@ typedef struct settings
char smb_client_password[128];
char smb_client_workgroup[64];
#endif
#ifdef HAVE_NFSCLIENT
char nfs_client_server_address[256];
char nfs_client_export[PATH_MAX_LENGTH];
char nfs_client_subdir[PATH_MAX_LENGTH];
#endif
} arrays;

struct
Expand Down
Loading
Loading