[m-rev.] for review: install mercury with umask 022

Mark Brown mark at csse.unimelb.edu.au
Mon Sep 18 21:11:59 AEST 2006


Hi all,

I've been looking into the problems `mmc --make' has when trying to
install libraries.  One problem I've been seeing is that sometimes the
libfoo.install target does nothing except run `ar' and `ln', even when
the .c files (or even the .m files) have not yet been built.  Running
`touch *.m' seems to work around the problem.

It looks like this is due to `--make' searching all library directories
for generated files (such as .module_dep files) when figuring out the
timestamps.  If someone has accidentally installed a library similar to
what you are trying to build, in the location where Mercury's standard
library is installed, then the wrong timestamps may be calculated.  The
result is that mmc thinks it has already built some files that it hasn't.

It appears to be very easy to accidentally install things over the existing
standard library, in part because we install things in such a way that they
are writeable by group mercury.  Is there any reason we need the installed
files to be group writeable?  If not, then I'll commit the following patch.

Cheers,
Mark.

tools/test_mercury:
	Use umask 022 instead of 002.

Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.300
diff -u -r1.300 test_mercury
--- tools/test_mercury	14 Sep 2006 04:01:41 -0000	1.300
+++ tools/test_mercury	18 Sep 2006 10:50:47 -0000
@@ -53,13 +53,10 @@
 TMPDIR=/tmp
 export TMPDIR
 
-# Make the files writable by group mercury.
-# But only do this for machines on the Mercury network.
-if [ -d /home/mercury/public/. ]; then
-	umask 002
-else
-	umask 022
-fi
+# Ensure that files are only writeable by user mercury, not group mercury.
+# This is in part to ensure that people don't unintentionally install
+# libraries over the installation we perform here.
+umask 022
 
 # Stop looping tests after 5 minutes of CPU time.
 # Also allow tests to use up to about 250 Mb of memory
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list