Opened 15 years ago

Closed 13 years ago

#4369 closed bug (invalid)

[patch] Fix configure case-sensitive FS detection (OSX/Darwin)

Reported by: VinDuv Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/pre-alpha1
Keywords: Cc: planche2k@…
Blocked By: Blocking:
Platform: All

Description

The current configure script tries to detect if the current directory is on a case sensitive volume by calling "diskutil info .", which is supposed to return something like this:

[...]
File System:              [FS properties, like "Case-sensitive"] [FS name, like "HFS+"]
[...]

Unfortunately this does not work correctly when the current directory is in a mounted ZFS pool: in this case diskutil just print its "usage" message and quits.

I modified the script so it checks wether diskutil returns something useful, and if it isn't the case, it does a manual check:

# check for case-sensitive filesystem if on darwin
if [ $buildPlatform = "darwin" ]; then
	fsCaseSensitive=0
	
	diskutil info . | grep -i "file system" > /dev/null
	
	if [ $? = 0 ]; then
		diskutil info . | grep -i "case-sensitive" > /dev/null
		
		if [ $? = 0 ]; then
			fsCaseSensitive=1
		fi;
	else
		# Diskutil does not know if the FS is case sensitive
		# Do it manually
		mkdir case_sensitive_test && rmdir CASE_SENSITIVE_TEST 2> /dev/null
		
		if [ $? != 0 ]; then # Error: case sensitive
			rmdir case_sensitive_test
			fsCaseSensitive=1
		fi
	fi
	
	if [ $fsCaseSensitive = 0 ]; then
		echo "You need a case-sensitive file-system to build Haiku."
		echo "Please see the following guide on how to set one up:"
		echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x"
		exit 1
	fi
fi

Attachments (1)

configure.diff (1019 bytes ) - added by VinDuv 15 years ago.
OS-neutral patch

Download all attachments as: .zip

Change History (12)

comment:1 by mmlr, 15 years ago

Indeed since the diskutil invocation is pretty slow, always doing the manual check would probably be more sensible. Also this way it could be used on other platforms as well.

comment:2 by VinDuv, 15 years ago

Something like this then ?

# check for case-sensitive filesystem
mkdir case_sensitive_test && rmdir CASE_SENSITIVE_TEST 2> /dev/null

if [ $? = 0 ]; then
	echo "You need a case-sensitive file-system to build Haiku."
	if [ $buildPlatform = "darwin" ]; then
		echo "Please see the following guide on how to set one up:"
		echo "http://haiku-os.org/documents/dev/how_to_build_haiku_on_mac_os_x"
	fi
	exit 1
fi

rmdir case_sensitive_test

Maybe the mention of the guide should be removed since it will probably merge with other guides ?

in reply to:  2 comment:3 by mmlr, 15 years ago

Replying to VinDuv:

Something like this then ?

Yes like that.

Maybe the mention of the guide should be removed since it will probably merge with other guides ?

I'd remove that specific link and just link to the homepage in general.

comment:4 by bonefish, 15 years ago

To be honest I wouldn't have added the case-sensitivity check in the first place. If we're going to check for all oddities of all potential build platforms, we'll end up having quite a huge configure script. It can't be too much to ask from people to read the mini ReadMe.

comment:5 by andreasf, 15 years ago

Cc: planche2k@… added

comment:6 by axeld, 15 years ago

There aren't so many oddities, and putting the sources on the wrong file system is worth a check IMO. In any case, the generic check is preferred over the specific one.

by VinDuv, 15 years ago

Attachment: configure.diff added

OS-neutral patch

in reply to:  6 comment:7 by bonefish, 15 years ago

Replying to axeld:

There aren't so many oddities, and putting the sources on the wrong file system is worth a check IMO.

Sounds no more worth to me than checking whether the FS supports symlinks. Or checking whether xattrs are really supported (and don't have a too small size limit), when --use-xattr is given. Or whether make is GNU make and readlink is GNU readlink. Or whether cdrecord is really cdrecord. Or whether all the tools used by the build system have an acceptable version (we do that for yasm already). With all those OSs out there that can potentially serve as build platforms I'm sure there are a lot of oddities we could check for.

And while I agree that things that silently cause a broken Haiku to be created (like using the wrong cross-compiler) definitely make sense to be checked, anything mentioned in the ReadMe that just breaks building is nothing that really needs to be checked IMHO.

comment:8 by axeld, 15 years ago

Good point, you managed to convince me, at least :-)

But a check whether the xattr support is sufficient or not still sounds like a good idea, since that's something you won't notice during build, or do you?

in reply to:  8 comment:9 by bonefish, 15 years ago

Replying to axeld:

But a check whether the xattr support is sufficient or not still sounds like a good idea, since that's something you won't notice during build, or do you?

You do indeed. The build fails at the point where an attribute is written that doesn't fit anymore. The failing command is mimeset, I believe, and the error is something like "Disk/device full". So it's relatively obvious what the problem is.

comment:10 by nielx, 14 years ago

patch: 1

comment:11 by mmadia, 13 years ago

Resolution: invalid
Status: newclosed

Given the points presented in the comments, marking this as invalid.

Note: See TracTickets for help on using tickets.