popa.bogdanp
2018-11-10 12:23:38

What is the usual process for working on a package that’s installed in my global (is that the right terminology?) collects?

Say I want to work on web-server-lib and I have previously installed it using raco pkg install web-server, but the version I want to work on lives in ~/sandbox/web-server/web-server-lib and I have another project that lives at ~/sandbox/foo that depends on web-server. I would like to temporarily point to the version of web-server used by foo to the code in ~/sandbox. What’s the best way to do that?

In Python I might do this by messing with the PYTHONPATH env variable or installing the package in editable mode. Are there similar things in Racket that I can use?


githree
2018-11-10 12:25:40

@popa.bogdanp not exactly what you are asking but this might be helpful: https://alex-hhh.github.io/2018/01/changing-built-in-racket-packages.html


popa.bogdanp
2018-11-10 12:28:15

@githree thanks! That seems like it’d do it.


soegaard2
2018-11-10 14:41:33

@jerome.martin.dev Hi. I went ahead and added new-expressions to Urlang.


soegaard2
2018-11-10 14:42:10

The syntax in Urlang is: (new constructor argument …)


philip.mcgrath
2018-11-10 17:37:24

@githree @popa.bogdanp Alex’s post sets up the package as a directory link, which severs the connection to the upstream. It is better to tell the package system that the package is a git clone, as described in detail at http://docs.racket-lang.org/pkg/git-workflow.html#%28part._clone-link%29 For web-server-lib, this is described in https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html#how-to-contribute-to-a-main-distribution-package


jerome.martin.dev
2018-11-10 17:37:26

@soegaard2 Yeah, you rock! Thank you :smile:


jerome.martin.dev
2018-11-10 17:38:19

I’ll check the commits so that I can understand how to do it myself next time!


philip.mcgrath
2018-11-10 17:48:26

One detail: the tutorial’s method sets up the git repository with the upstream repository as its origin remote. I prefer to have my fork as the origin and upstream as upstream. I suggest: 1. git clone &lt;fork&gt; 2. cd &lt;dir&gt; ; git remote add upstream &lt;upstream&gt; ; cd .. 3. raco pkg update --lookup --catalog <https://pkgs.racket-lang.org> --clone &lt;dir&gt; &lt;pkg-name&gt;


philip.mcgrath
2018-11-10 17:49:27

With those steps, raco pkg update will still use the upstream source for updates.


popa.bogdanp
2018-11-10 19:09:22

Thank you!


lexi.lambda
2018-11-10 20:43:07

@mflatt I noticed today that if you bind the same identifier (in the sense of bound-identifier=?) into a first-class definition context multiple times, no error is raised. I was originally going to file a bug, but I noticed this behavior is consistent with older versions of Racket. Is the behavior intentional? If so, what is the intended semantics?


mflatt
2018-11-10 23:39:58

I don’t remember specifically deciding that rebinding should be allowed. It’s possible that I originally decided to allow rebinding absent any reason to disallow it. Or it may be that it never occurred to me to check.


macocio
2018-11-11 02:34:29

I’ve been hacking around cmdline.rkt and it seems very archaic and bloated. Many procedural macros. Would it be desirable to make it a syntax-parser instead?


macocio
2018-11-11 02:35:21

iirc a comment in the file states we want as few dependencies as possible but as of now it’s hard to maintain