{"id":335,"date":"2009-03-08T19:30:07","date_gmt":"2009-03-08T17:30:07","guid":{"rendered":"http:\/\/www.lucas-nussbaum.net\/blog\/?p=335"},"modified":"2009-03-08T19:30:07","modified_gmt":"2009-03-08T17:30:07","slug":"make-tmpfs-and-amctime-granularity","status":"publish","type":"post","link":"https:\/\/www.lucas-nussbaum.net\/blog\/?p=335","title":{"rendered":"Make, tmpfs, and [amc]time granularity"},"content":{"rendered":"<p>As you <a href=\"http:\/\/www.lucas-nussbaum.net\/blog\/?p=332\">might have guessed<\/a> (or not), I&#8217;ve been playing with the idea of improving my Debian rebuild setup by building on tmpfs: disk I\/O take a signifiant amount of time, that could easily be reduced by building (mostly) in memory.<\/p>\n<p>Most packages build fine on tmpfs: only 8 packages fail only on tmpfs. Apparently, most of the failures are caused by old versions of autoconf: this version used \/tmp to store temporary files ; for example, when generating Makefile, it would create it on \/tmp, then move it to the current directory. The problem arises when \/tmp is an ext3 filesystem, while the current directory is on tmpfs: when moving the file back to the current directory, the mtime of the file is truncated.<\/p>\n<p>This can lead make to think that a given target needs to be rebuilt. A nice example of that is the <code>smuxi<\/code> package, that just loops when building.<\/p>\n<p>Demo:<\/p>\n<pre># cat Makefile \r\nf2: f1\r\n        echo \"Need to rebuild f2!\"\r\n<\/pre>\n<p>First case: f1 and f2 are stored in the current directory. Make agrees that<br \/>\nf2 was created after f1:<\/p>\n<pre>\r\n# rm f1 f2 ; touch f1 ; touch f2 ; make\r\nmake: `f2' is up to date.\r\n<\/pre>\n<p>Second case: f2 is created on \/tmp, then moved to the current directory. Make thinks that f2 was created before f1 (and is right, according to <code>stat<\/code>).<\/p>\n<pre>\r\n# rm f1 f2 ; touch f1 ; touch \/tmp\/f2 ; mv \/tmp\/f2 f2 ; make\r\necho \"Need to rebuild f2!\"\r\nNeed to rebuild f2!\r\n# stat f1 f2     \r\n  File: `f1'\r\n[..]\r\nModify: 2009-03-08 18:21:08.900237000 +0100\r\n  File: `f2'\r\n[..]\r\nModify: 2009-03-08 18:21:08.000000000 +0100\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As you might have guessed (or not), I&#8217;ve been playing with the idea of improving my Debian rebuild setup by building on tmpfs: disk I\/O take a signifiant amount of time, that could easily be reduced by building (mostly) in memory. Most packages build fine on tmpfs: only 8 packages fail only on tmpfs. Apparently, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"0","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-planetdebian","category-planetubuntu"],"_links":{"self":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":0,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lucas-nussbaum.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}