<div dir="ltr">Hi Sam,<div><br><div>I was replacing net/url, but with a copy of the system library which I was modifying in a way that would not alter the existing public interface. I was relying on some external packages like racket-couchdb that I'd rather keep working as-is in terms of the net/url interface. At least at that time I thought then that this was an important consideration.</div>
<div><br></div><div>However, I've found that there are a few changes I should make to net/*l that will indeed break dependencies. And once you start down that road, the fun never stops. Then it took just a couple of minutes to rename my copy of the "net" directory and all references in dependencies.</div>
<div><br></div><div>Still, I do think this is a useful case to support (i.e. shadowing a system collection), and works well enough with DrRacket.</div><div><br></div><div>Erik.</div></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Oct 22, 2013 at 6:19 PM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@cs.indiana.edu" target="_blank">samth@cs.indiana.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Oct 22, 2013 at 8:54 PM, Erik Pearson <<a href="mailto:erik@adaptations.com">erik@adaptations.com</a>> wrote:<br>
> Thanks.<br>
><br>
> raco link -d <collections-dir> is working, that is, my collections are<br>
> found, although I still have one little problem. The precedence of my linked<br>
> collection directory seems to be lower than for the built-in collections.<br>
> With the explicit collections directory setting in drracket I'm able to set<br>
> the github directory higher, which allows me to shadow built-in collections.<br>
> Now my code is loading the built in collection, rather than the replacement<br>
> I'm using.<br>
><br>
> A workaround could be to rename the replacement collection (net), which is<br>
> not a big deal, but inconvenient.<br>
><br>
> Please let me know if I'm wrong about this. Otherwise, is there a<br>
> recommended way to shadow a system collection?<br>
<br>
One question: are you replacing actual system libraries, or just<br>
adding new things to, for example, the `net` collection?<br>
<br>
If you're just adding `net/quic` or something like that, then the<br>
precedence shouldn't matter.<br>
<br>
If you're actually _replacing_ something like `net/url`, then that's<br>
more worrying, because it will potentially cause parts of Racket to<br>
break.<br>
<br>
Sam<br>
<br>
><br>
> Thanks, Erik.<br>
><br>
><br>
> On Tue, Oct 22, 2013 at 4:42 PM, Sam Tobin-Hochstadt <<a href="mailto:samth@cs.indiana.edu">samth@cs.indiana.edu</a>><br>
> wrote:<br>
>><br>
>> On Tue, Oct 22, 2013 at 7:36 PM, Greg Hendershott<br>
>> <<a href="mailto:greghendershott@gmail.com">greghendershott@gmail.com</a>> wrote:<br>
>> > I think the equivalent to DrRacket's Collection Paths setting might be<br>
>> > to use the PLTCOLLECTS environment variable? See:<br>
>> ><br>
>> > <a href="http://docs.racket-lang.org/reference/collects.html" target="_blank">http://docs.racket-lang.org/reference/collects.html</a><br>
>> ><br>
>> > Also there are a number of command-line flags; I'm not sure which<br>
>> > corresponds to exactly what you need:<br>
>> ><br>
>> > $ racket -h<br>
>> > ...<br>
>> > -X <dir>, --collects <dir> : Main collects at <dir> (or "" disables<br>
>> > all)<br>
>> > -S <dir>, --search <dir> : More collects at <dir> (after main<br>
>> > collects)<br>
>> > -A <dir>, --addon <dir> : Addon directory at <dir><br>
>> > -R <paths>, --compiled <paths> : Set compiled-file search roots to<br>
>> > <paths><br>
>> > -C <file>, --links <file> : User-specific collection links at <file><br>
>> > ...<br>
>><br>
>> `-S` is the one that's like `PLTCOLLECTS`.<br>
>><br>
>> But more generally, I would strongly encourage Erik (and others) not<br>
>> to use PLTCOLLECTS or its analogues, but instead to use the package<br>
>> system (or `raco link`).<br>
>><br>
>> `raco link` is probably the simplest thing to do here, like so:<br>
>><br>
>> raco link -d /home/epearson/work/racket/github<br>
>><br>
>> That should set up all the collections you have.<br>
>><br>
>> Better still would be to set up a package, even one locally that you<br>
>> don't distribute.<br>
>><br>
>> Sam<br>
>><br>
>><br>
>> ><br>
>> > On Tue, Oct 22, 2013 at 4:39 PM, Erik Pearson <<a href="mailto:erik@adaptations.com">erik@adaptations.com</a>><br>
>> > wrote:<br>
>> >> Hi,<br>
>> >> I've just switched over to the Racket github master from 5.3.6. It is<br>
>> >> set up<br>
>> >> well enough that development proceeds normally. I have setup a<br>
>> >> collection<br>
>> >> directory which contains libraries that I'm developing and upon which<br>
>> >> my<br>
>> >> main projects depend. For DrRacket work I have used Language -> Choose<br>
>> >> Language ... -> Collection Paths to set this up, putting my collection<br>
>> >> path<br>
>> >> at the top so that it can override the system path if it needs to.<br>
>> >> Works<br>
>> >> great.<br>
>> >><br>
>> >> But this Collection Paths setting does not seem to be honored by Racket<br>
>> >> -><br>
>> >> Create Executable. Similarly from the command line raco exe does not<br>
>> >> seem to<br>
>> >> be using these preferences, nor can I figure out how to tell raco to<br>
>> >> use my<br>
>> >> collection directory.<br>
>> >><br>
>> >> The specific error message I am getting is:<br>
>> >><br>
>> >> /home/epearson/work/racket/coco/scgi-server.rkt:4:8: collection not<br>
>> >> found<br>
>> >> for module path: (lib "racqueb/scgi2")<br>
>> >> collection: "racqueb"<br>
>> >> in collection directories:<br>
>> >> /home/epearson/.racket/development/collects<br>
>> >> /home/epearson/work/racket/plt/plt/racket/collects<br>
>> >> context...:<br>
>> >> show-collection-err<br>
>> >> standard-module-name-resolver<br>
>> >> standard-module-name-resolver<br>
>> >><br>
>> >><br>
>> >> /home/epearson/work/racket/plt/plt/racket/collects/compiler/embed.rkt:394:0:<br>
>> >> get-code<br>
>> >><br>
>> >><br>
>> >> /home/epearson/work/racket/plt/plt/racket/collects/compiler/embed.rkt:993:0:<br>
>> >> do-write-module-bundle<br>
>> >><br>
>> >><br>
>> >> /home/epearson/work/racket/plt/plt/racket/collects/compiler/embed.rkt:1517:51<br>
>> >><br>
>> >><br>
>> >> /home/epearson/work/racket/plt/plt/racket/collects/compiler/private/elf.rkt:190:6:<br>
>> >> temp19<br>
>> >><br>
>> >> As you can see, is using the default collection paths, and not the one<br>
>> >> that<br>
>> >> I've added via DrRacket preferences, which would be<br>
>> >> /home/epearson/work/racket/github.<br>
>> >><br>
>> >> So, the question is -- first, I guess this might be considered a bug in<br>
>> >> DrRacket -- since Create Executable is not using the same collection<br>
>> >> paths<br>
>> >> as the IDE? Second, is there a way to supply raco exe and distribute<br>
>> >> with a<br>
>> >> new collection path? Ideally I would just supply a new one which is<br>
>> >> added to<br>
>> >> the top of the path list, but I could also just reconstruct the<br>
>> >> collection<br>
>> >> path list from scratch if need be. (The docs for<br>
>> >> create-embedding-executable<br>
>> >> imply this.)<br>
>> >><br>
>> >> (BTW I'm not implying that anything has changed in this regard from<br>
>> >> 5.3.6.<br>
>> >> In 5.3.6 I had used links to the individual libraries, but in github<br>
>> >> master<br>
>> >> I had switched to using the collection paths, which is less maintenance<br>
>> >> and<br>
>> >> allows seamless shadowing of system libraries with custom<br>
>> >> replacements.)<br>
>> >><br>
>> >> Thanks,<br>
>> >> Erik.<br>
>> >><br>
>> >><br>
>> >> ____________________<br>
>> >> Racket Users list:<br>
>> >> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>> >><br>
>> > ____________________<br>
>> > Racket Users list:<br>
>> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> Erik Pearson<br>
> Adaptations<br>
> ;; web form and function<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Erik Pearson<br>Adaptations<br>;; web form and function
</div>