<!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">On 28 Feb 2018, at 15:46, Eric Timmons wrote:</p>
</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">If a have a package-inferred-systems "a" and "a/b/c", the following<br>
code used to return "a":<br>
<br>
(primary-system-name (find-system "a/b/c"))<br>
<br>
But after commit 069cd2a6 it returns nil.<br>
<br>
Happy to patch it, but I wanted to check how to do it before starting.<br>
The root cause right now is that system-source-file returns nil for<br>
the inferred systems. The easiest fix would be to have it return the<br>
asd file for the primary system. That's probably not *technically*<br>
correct since the system isn't actually defined in that file, but it's<br>
probably correct in the principle of least surprise sense.<br>
<br>
Thoughts?</p>
</blockquote></div>
<div style="white-space:normal">
<p dir="auto">Looking over the change, I believe the issue is that, unfortunately, the "/" character is being used for two different purposes. In the "slashy" systems, it is used to identify subsystems, but the use in package-inferred systems is subtly different, because the location of their definitions as systems is different (indeed the package-inferred systems don't <em>have</em> explicit definitions). Also, I don't know that multiple slashes are ("a/b/c") are really supported in the case of systems that are defined in <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">a.asd</code>, but I haven't checked.</p>
<p dir="auto">I agree with you, though, that it's reasonable to treat a package-inferred system "a/b/c" as having "a" as its primary system name.</p>
<p dir="auto">I believe that this is the diff that caused the change in that commit:</p>
<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">- (component (primary-system-name (coerce-name (component-system system-designator))))))
+ (component (let* ((system (component-system system-designator))
+ (source-file (physicalize-pathname (system-source-file system))))
+ (and source-file
+ (equal (pathname-type source-file) "asd")
+ (pathname-name source-file))))))
</code></pre>
<p dir="auto">But I confess that I don't know the rationale for that change, so I don't know what collateral damage there will be to changing it.</p>
<p dir="auto">If you are going to patch this, will you please make a test case? I believe it could be easily added to package-inferred-system-test.script. I will be happy to help, if you would like.</p>
<p dir="auto">It looks like you could add a separate branch to the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">etypecase</code> with the logic special to <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">package-inferred-system</code>.</p>
<p dir="auto">If you have access to the cl.net gitlab, then a merge request would be a great way to supply a patch, but if that doesn't work for you, sending a git patch or just a regular old diff patch would also be fine.</p>
<p dir="auto">Thanks for spotting this,<br>
best,<br>
r</p>
</div>
</div>
</body>
</html>