! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
FTBFS on hurd because of PATH_MAX
Status:
RESOLVED: FIXED
Product:
Xfce4-settings
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2011-04-21 09:31:41 CEST
Hey,

it seems that xfce4-settings relies on the PATH_MAX value to be defined, which is not the case on hurd, so it fails to build.

There's a build log available at https://buildd.debian.org/status/fetch.php?pkg=xfce4-settings&arch=hurd-i386&ver=4.8.1-3&stamp=1303349756

The usual way to fix this is to use realpath(), so I'll try to provide a patch for that.
Comment 1 Yves-Alexis Perez editbugs 2011-04-21 10:04:54 CEST
Created attachment 3625 
fix PATH_MAX beeing undefined on HURD

Ok, realpath() doesn't look like the correct way to fix that, so I just used g_strdup_printf() to allocate the memory. I guess g_vasnprintf() would do the job too but I'm not so sure which one should be preferred.
Comment 2 Nick Schermer editbugs 2011-04-21 10:12:47 CEST
Can't we use

#ifndef MAX_PATH
#define MAX_PATH 4096
#endif
Comment 3 Yves-Alexis Perez editbugs 2011-04-21 10:23:51 CEST
Sure we can, but isn't using a dynamically allocated string better? I mean, in most cases we won't overflow 4096, but it's still a hard limit which isn't really needed.
Comment 4 Nick Schermer editbugs 2011-04-21 11:28:11 CEST
Doesn't hurt the performance or memory usage, if you don't use this a lot.
Comment 5 Yves-Alexis Perez editbugs 2011-04-21 11:34:59 CEST
I'm not too sure I correctly parse your last comment but, basically, I don't think hardcoding 4096 and having a statically allocated 4k-long buffer is really a problem by itself.

It's just that it means enforcing random limits on system which don't have them (and on purpose, because they are arbitrary). So yes it's a quick and easy fix but it might not be the best one :)
Comment 6 Nick Schermer editbugs 2011-04-21 11:41:14 CEST
Mm sorry, I didn't look at the patch, yeah that is better.

However, you want to use: file = g_build_path (dirs[i], file, NULL);
Comment 7 Yves-Alexis Perez editbugs 2011-04-21 12:30:46 CEST
Created attachment 3628 
fix PATH_MAX beeing undefined on HURD

I didn't know about g_build_path() (though I guess you meant g_build_filename()) so here's an updated patch.
Comment 8 Nick Schermer editbugs 2011-04-21 16:48:14 CEST
Fixed in 57ade33.

Bug #7521

Reported by:
Yves-Alexis Perez
Reported on: 2011-04-21
Last modified on: 2011-04-21

People

Assignee:
Stephan Arts
CC List:
3 users

Version

Attachments

fix PATH_MAX beeing undefined on HURD (1.22 KB, patch)
2011-04-21 10:04 CEST , Yves-Alexis Perez
no flags
fix PATH_MAX beeing undefined on HURD (1.21 KB, patch)
2011-04-21 12:30 CEST , Yves-Alexis Perez
no flags

Additional information