<!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">OK, then I believe that defining the method for <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">OPERATE</code> will give you what you want. You can put that definition in <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">my-system.asd</code> below the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">defsystem</code> for "my-system". There's only one problem with that -- if you <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">load-system</code> on "my-system" before <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">my-system.asd</code> has been loaded (e.g., by <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">find-system</code>), then you will lose, because the around method will not have been defined before the first call to <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">operate</code>.</p>
<p dir="auto">On 9 Mar 2018, at 16:37, Mark H. David 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="EEFDFDEF-8CF8-4054-9645-F80D45D148B4">
<div style="font-family:Arial;">No, it's what we want for our system. We want everyone who builds our system to get this behavior reliably.</div>
<div><br></div>
<div><br></div>
<div>----- Original message -----<br></div>
<div>From: Robert Goldman <<a href="mailto:rpgoldman@sift.info">rpgoldman@sift.info</a>><br></div>
<div>To: "Mark H. David" <<a href="mailto:mhd@yv.org">mhd@yv.org</a>><br></div>
<div>Cc: "ASDF-devel" <<a href="mailto:asdf-devel@common-lisp.net">asdf-devel@common-lisp.net</a>><br></div>
<div>Subject: Re: Best Practice for an ASDF Variable Like <b>*compile-file-failure-behaviour*</b><br></div>
<div>Date: Fri, 09 Mar 2018 16:34:48 -0600<br></div>
<div><br></div>
<div style="font-family:sans-serif;"><div style="white-space:normal;"><p>Are you just using this for yourself? If so, a simple<br></p><pre style="background-color:rgb(247, 247, 247);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;margin-left:15px;margin-right:15px;max-width:90vw;overflow-x:auto;padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;" bgcolor="#F7F7F7"><code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;" bgcolor="#F7F7F7">(let ((asdf:*compile-file-failure-behaviour* :warn))
(asdf:load-system "my system"))
</code><br></pre><p>will suffice.<br></p><p>Alternatively, you could put something like this in the <code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0.4em;padding-bottom:0px;padding-left:0.4em;" bgcolor="#F7F7F7">.asd</code> file:<br></p><pre style="background-color:rgb(247, 247, 247);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;margin-left:15px;margin-right:15px;max-width:90vw;overflow-x:auto;padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;" bgcolor="#F7F7F7"><code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;" bgcolor="#F7F7F7">(defmethod operate :around ((operation load-op) (system (asdf:find-system "my-system")))
(let ((asdf:*compile-file-failure-behaviour* :warn))
(call-next-method)))
</code><br></pre><p>The above most emphatically <i>has not been tested</i>, so it might be wrong.<br></p><p>I <i>think</i> if the top-level operation you use is <code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0.4em;padding-bottom:0px;padding-left:0.4em;" bgcolor="#F7F7F7">load-op</code>, this should work. Alternatively, you might want to replace <code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0.4em;padding-bottom:0px;padding-left:0.4em;" bgcolor="#F7F7F7">(operation load-op)</code> with just <code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0.4em;padding-bottom:0px;padding-left:0.4em;" bgcolor="#F7F7F7">(operation operation)</code> (and add a <code style="background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0.4em;padding-bottom:0px;padding-left:0.4em;" bgcolor="#F7F7F7">(declare (ignorable operation))</code>)<br></p><p></p><div style="font-family:Arial;">Cheers,<br></div>
<div style="font-family:Arial;"> r<br></div>
<p>On 9 Mar 2018, at 16:12, Mark H. David wrote:<br></p></div>
<div style="white-space:normal;"><blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(119, 119, 119);color:rgb(119, 119, 119);margin-top:0px;margin-right:0px;margin-bottom:5px;margin-left:0px;padding-left:5px;"><p></p><div style="font-family:Arial;">As has been discussed here over the years, asdf:*compile-file-failure-behaviour* is :warn on most platforms, but it is notoriously :error on #+sbcl. So what would you do if you wanted to change asdf:*compile-file-failure-behaviour* to be :warn on #+SBCL? How would you recommend to change it. Where?<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> I don't want to really have to impose an init file on everyone. Also, I don't really want to necessarily make this global across every use of ASDF, but let's say I just want it to apply to one main system and all subsystems loaded as part of this.<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> I cannot think of anything better than a top-level setq in the .asd file of the system, something like this?<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> #+sbcl<br></div>
<div style="font-family:Arial;"> (setq asdf:*compile-file-failure-behaviour* :warn)<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> What else can one do that's any better?<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> Maybe there's a less crude way, like something like an around method that wraps around the compile/load. I'm really just barely a novice user, so I'm sorry this if this is such a naive question. If there's a simple example one could provide or point me to that does this, I'd appreciate it.<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> Thanks,<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> Mark<br></div>
</blockquote></div>
<div style="white-space:normal;"><br></div>
</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>