<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div style="font-family:Arial;">Actually, I see these lines in the file asdf.lisp in my sbcl distribution (SBCL 1.4):<br></div>
<div style="font-family:Arial;"><br></div>
<blockquote type="cite"><div style="font-family:Arial;"><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"> (defmethod operate :around (operation component &rest keys</span><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"><br></span></div>
<div style="font-family:Arial;"><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"> &key verbose</span><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"><br></span></div>
<div style="font-family:Arial;"><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"> (on-warnings *compile-file-warnings-behaviour*)</span><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"><br></span></div>
<div style="font-family:Arial;"><span class="font" style="font-family: menlo, consolas, monospace, sans-serif;"> (on-failure *compile-file-failure-behaviour*))</span><br></div>
</blockquote><div><br></div>
<div style="font-family:Arial;">Could someone please ELI5 how to hook into that for on-failure?<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</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><div style="font-family:Arial;">Cheers,<br></div>
<div style="font-family:Arial;"> r<br></div>
</p><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><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>
</p></blockquote></div>
<div style="white-space:normal;"><br></div>
</div>
<div style="font-family:Arial;"><br></div>
</body>
</html>