<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Sorry for the late response.</p>
<p dir="auto">What you have seems like it will work, but couldn't you just as easily use the ASDF output translations configuration facility that is described here: <a href="https://common-lisp.net/project/asdf/asdf/Controlling-where-ASDF-saves-compiled-files.html#Controlling-where-ASDF-saves-compiled-files" style="color:#3983C4">https://common-lisp.net/project/asdf/asdf/Controlling-where-ASDF-saves-compiled-files.html#Controlling-where-ASDF-saves-compiled-files</a></p>
<p dir="auto">There's an example there that you could probably adapt by inserting <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">uid</code> and <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">pid</code>, as appropriate.</p>
<p dir="auto">Best,<br>
r</p>
<p dir="auto">On 23 Jan 2018, at 6:51, Jim Newton wrote:</p>
</div>
<div style="white-space:normal"></div>
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div id="E4893C6D-A9C4-4E95-B3EE-A947760BB365"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Apparently, this approach seems to work. I’m not sure if it is the best approach. </div><div class="">Here is what my code looks like. It creates a directory in /tmp/ and asdf:load-system</div><div class="">seems to compile the .fasl files into there.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(208, 60, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">require</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #34a2a1" class="">:asdf</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(52, 162, 161);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">require</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">:sb-posix</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ((home (directory-namestring (user-homedir-pathname)))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (uid (sb-posix:getuid))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (pid (sb-posix:getpid)))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (setf asdf::*user-cache* (ensure-directories-exist (format nil </span><span style="font-variant-ligatures: no-common-ligatures; color: #af3782" class="">"/tmp~A~D/~D/"</span><span style="font-variant-ligatures: no-common-ligatures" class=""> home uid pid))))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#-quicklisp</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ((quicklisp-init</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(175, 55, 130);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="font-variant-ligatures: no-common-ligatures" class="">"/lrde/home/jnewton/quicklisp/setup.lisp"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (probe-file quicklisp-init)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (load quicklisp-init)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: #ff3b1d" class=""><b class="">error</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #af3782" class="">"file not found ~S"</span><span style="font-variant-ligatures: no-common-ligatures" class=""> quicklisp-init)))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(asdf:load-system </span><span style="font-variant-ligatures: no-common-ligatures; color: #7c7ca6" class="">:lisp-types-test</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 23 Jan 2018, at 12:47, Pascal Bourguignon <<a href="mailto:pjb@informatimago.com" class="">pjb@informatimago.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 23 Jan 2018, at 12:00, Jim Newton <<a href="mailto:jnewton@lrde.epita.fr" class="">jnewton@lrde.epita.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);" class="">If I run several sbcl processes on different nodes in my compute cluster, it might happen that two different runs notice the same file needs to be recompiled (via asdf),</span><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class="">and they might try to compile it at the same time. What is the best way to prevent this?</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class=""><br class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class="">I see in the asdf documentation that there is an asdf:*user-cache* variable whose</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class="">value is the path name of the directory where asdf compiles into. Would it be advisable for my to arrange so that asdf:*user-cache* is a function of the pid and hostname and perhaps thread-id (if such a thing exists) to avoid such collisions?</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class=""><br class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;" class="">Or is there some better way to handle this which is build into asdf?</div></div></div></blockquote></div><br class=""><div class="">I had requested that ASDF includes the hostname (or machine-instance), in the built path for the cache.</div><div class="">Unfortunately, for some reason, the maintainers of ASDF thought it was a good read to remove it.</div><div class="">There you are!</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><br class=""><div class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-- <br class="">__Pascal J. Bourguignon__<br class=""><br class=""><br class=""></div></div>
</div>
<br class=""></div></div></blockquote></div><br class=""></div></div></blockquote>
<div style="white-space:normal">
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>