Retroarch: After commit b201d6 Retroarch removes trailing slash in paths that include home

Created on 29 Dec 2018  路  11Comments  路  Source: libretro/RetroArch

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

After commit b201d6 if you run Retroarch as a service (like Lakka does), retroarch removes trailing slash in paths that include home (as in env home $HOME) eg /home/roms becomes /homeroms
even if the HOME environment includes a trailing slash.

Expected behavior

to leave the path as selected e.g. /home/roms

Actual behavior

When you exit Retroarch/restart or just save the configuration the trailing slash for home is removed eg /home/roms becomes /homeroms

Steps to reproduce the bug

  1. Run Retroarch as a service, like Lakka does
  2. quit/restart or save the configuration
  3. next time the path will not have a trailing slash

Bisect Results

After commit b201d6 maybe in this file

https://github.com/libretro/RetroArch/commit/b201d669b5ea1470bb239036aa944342a0591a95#diff-76d1d784ae262973e053efd363068d25 as I see there is a few changes that involve $HOME

  • RetroArch: anything after b201d6

Environment information

  • OS: LibreELEC
bisected major

Most helpful comment

it's working now, i had to reset the config after the fix

All 11 comments

I tried to reproduce this but it worked fine in every configuration I could think of. What are your exact values of HOME and path in config?

I'm experiencing this issue
[parker@e55 ~]$ retroarch Failed to open /home/parker.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory Failed to open /home/parker.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory Failed to open /home/parker.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory Failed to open /home/parker.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory mkdir(/home/parker.config/) error: Permission denied. Failed to create directory: "/home/parker.config/". Failed to create directory: "/home/parker.config/". Failed to create directory: "/home/parker.config/retroarch/".

Bone stock retroarch compile from git
[parker@e55 ~]$ echo $HOME $PATH /home/parker /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

This is just running normally as my user

confirmed bad commit https://github.com/libretro/RetroArch/commit/b201d669b5ea1470bb239036aa944342a0591a95#diff-76d1d784ae262973e053efd363068d25
linux/arch
missing "/" after getting the $HOME folder

[INFO] Loading history file: [/home/retrowertz.config/retroarch/content_history.lpl].
[INFO] Loading history file: [/home/retrowertz.config/retroarch/content_favorites.lpl].
[INFO] Loading history file: [/home/retrowertz.config/retroarch/content_music_history.lpl].
[INFO] Loading history file: [/home/retrowertz.config/retroarch/content_video_history.lpl].
[INFO] Loading history file: [/home/retrowertz.config/retroarch/content_image_history.lpl].

Can confirm, having the same issue.

Finally managed to reproduce it

assets_directory = "~\assets"
HOME = /any/path/without/final/slash

I added a fix for this bug to #7837

@krzys-h It's not entirely fixed

[INFO] Loading history file: [/home/alfrix/~/.config/retroarch/content_history.lpl].

Failed to open /home/alfrix/~/.config/retroarch/assets/xmb/monochrome/font.ttf: No such file or directory

ubuntu bionic (checked out your PR)

@krzys-h Somewhat off topic, but should paths be const or am I just not understanding?

https://github.com/libretro/RetroArch/blob/ad782e6eb45a6c07c0c07554aef60e1316f12a52/libretro-common/file/file_path.c#L1016

@alfrix @orbea the code is now basically reverted to what it was before I touched it. The only change is that the home dir is filled using a function like the application dir already was.

@alfrix , @retro-wertz , @shantigilbert and @parkerlreed Can you confirm is this is resolved or not? It didn't seem to affect my config either.

@krzys-h Also thank you for your quick attention, I really appreciate it!

it's working now, i had to reset the config after the fix

@alfrix , @retro-wertz , @shantigilbert and @parkerlreed Can you confirm is this is resolved or not? It didn't seem to affect my config either.

@krzys-h Also thank you for your quick attention, I really appreciate it!

Yes, it is now fixed and working properly. Thanks!

Was this page helpful?
0 / 5 - 0 ratings