Tilde expansion requirement breaks XDG compliance

26 views
Skip to first unread message

pastel raschke

unread,
Jun 25, 2021, 6:44:54 PM6/25/21
to Racket Users
Racket seems to insist on using ~/.racket as its special place, despite the apparent fix that added XDG compliance. This happens even when I have racket folders neatly set up in all my xdg dirs, and clear ~/.racket* every time.

Stepping through in a debugger, I found the problem was at line 2038 of rktio_fs.c, where rktio_system_path calls rktio_expand_user_tilde on prefer_home_str. When prefer_home_str is set from an appropriate XDG environment variable, it is specifically checked to be an absolute path by starting with a slash, where the default prefer_home_str starts with a tilde.

This wouldn't be a problem if rktio_expand_user_tilde did not respond to an absolute path by setting RKTIO_ERROR_NO_TILDE and returning null, or if the error were caught in rktio_system_path and prefer_home were set properly, or if prefer_home_str were not tilde expanded after being set to an absolute path at line 2008 in the first place. The current behavior results in the non-compliant ~/.racket being used, to my great frustration.

Thank you for your work.

Matthew Flatt

unread,
Jun 25, 2021, 7:37:36 PM6/25/21
to pastel raschke, Racket Users
Thanks! I've pushed a change based on your explanation. I was able to
confirm that it made the `XDG_CONFIG_HOME` environment take effect when
it previously did not, at least.
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to racket-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/e055e79d-9025-421c-ac17-4d44c5076
> e6bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages