
> The problem is that raco pkg
requires a .git
suffix on a URL that is to be interpreted as a Git repository. So this means the .git
suffix isn’t just a hint for raco
so that it indicates a Git repo? So raco
would also try the URL without the .git
suffix. In other words, the URL has to actually contain the .git
suffix?

I just checked that both Github and Gitlab include the .git
suffix in the git clone
instructions, so this explains why it would work there (apart from special handling by raco
for Github).

… and cloning from Sourcehut only works without the .git
suffix, as I just checked.

Although I still don’t like fallbacks, we could have raco pkg
try a fetch without .git
if a fetch using .git
fails. That would be less worrisome than trying to fall back to the Git protocol on a non-.git
URL — so, maybe our second-to-last resort. (It still means that someone would need a newer client to access the package.)

Ok, this seems to have worked, thanks!
My “only” remaining problem is how to provide a binary. I have a command-line program todoreport.rkt
, which can be used with racket todoreport.rkt
plus command-line arguments. Now I want to install this program as todoreport
, so that it can be used by a user without modifying the PATH
environment variable. (I suppose this would imply that todoreport
is installed in the same directory where racket
, raco
etc. are installed, but I may be wrong.)
I checked https://docs.racket-lang.org/pkg/index.html and https://docs.racket-lang.org/raco/info_rkt.html , but didn’t find anything relevant. Does anybody know a package that installs a binary, so I could use the package (repository tree) as a template?

You want racket-launcher-names
in a collection’s “info.rkt”: https://docs.racket-lang.org/raco/setup-info.html
The executable will go to the same place as racket
and raco
only if the package is installed in “installation” scope. In “user” scope (the default for most racket installations), the executable will be in (find-user-console-bin-dir)
.

Also, if the user has racket installed, and todoreport is installed as the collection file/todoreport, without doing anything else you can call it with racket -l- file/todoreport <args> ...

One thing I’m confused about — if the URL starts with git://
does it always use the git protocol? or does SourceHut not support that protocol? Or something else?

SourceHut does not support the Git protocol, as far as I can tell.

Also, it looks like “git over https” doesn’t mean the URLs have to have “.git” suffixes. It seems to be more of a convention.

Right, that’s a convention which we have taken advantage of but is not at all a requirement of the git protocol

> SourceHut does not support the Git protocol, as far as I can tell. https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols contains information about the protocols. According to this page, using Git over https seems to be very common, so I suppose raco
should support it. I think https is the most common for anonymous read-only access.
I haven’t found anything under https://man.sr.ht/git.sr.ht/ about the Git protocol specifically, but as Git cloning over https is so common, it shouldn’t really matter whether Sourcehut supports the Git protocol (the one over a special daemon, usually on port 9418).

In case you missed RacketFest: https://www.youtube.com/playlist?list=PLi6VoEKYdlE39FKNE-oz0Z6LYqdmymTss

The book also suggests that the git:
protocol is ideal for read-only, public access — such as by a package manger like raco pkg
:
> The Git protocol is often the fastest network transfer protocol available. If you’re serving a lot of traffic for a public project or serving a very large project that doesn’t require user authentication for read access, it’s likely that you’ll want to set up a Git daemon to serve your project. It uses the same data-transfer mechanism as the SSH protocol but without the encryption and authentication overhead. So it sounds like git:
might be good for Sourcehut to support, if it wants to host repos that are also packages?

If it’s about what’s common, you could argue that git:
is as common as https:
, because it’s supported by GitHub and GitLab and Bitbucket etc., and because a supermajority of repos are hosted on those. :slightly_smiling_face:

@greg I understand it the other way around: Since the Git protocol by default isn’t encrypted, it’s rarely used. This is also in line with the observation that Github and Gitlab only mention the https and ssh URLs as clone URLs.
As for the git://
support for Github etc., I’d be interested in which clone URL you’d use. :slightly_smiling_face: The Github documentation at https://docs.github.com/en/github/getting-started-with-github/about-remote-repositories doesn’t mention the Git protocol either. Maybe you’re confusing the git@...
clone “URL” (SSH protocol) and the Git protocol?

My suspicion is that raco pkg
doesn’t use the Git protocol either, also for Github and Gitlab.

It definitely uses the git protocol

It has its own implementation, in fact, in Racket

Any sentence beginning with “Maybe you’re confusing”, directed at me, has an excellent chance of being true. :slightly_smiling_face:

@samth Is that actually the Git (server) protocol to a daemon on port 9418? Of course there’s some form of protocol so that Git can fetch the repository data, but that’s a different layer from the “protocol” I’m talking about.

raco pkg
is a client, so it doesn’t implement the server protocol, but it uses the same protocol that git
uses when given a git://
url.

That’s why you saw the error about port 9418 from tcp-connect
.

I guess the tiny valid remnant of my original point is that there are many langs/ecosystems using git repos as package sources these days, and fewer hosts, with a few very large hosts. And so if there is some option/detail in git:
and/or ssh that Sourcehut could add, it would probably help multiple ways.

> raco pkg
is a client, so it doesn’t implement the server protocol No doubt about that. :slightly_smiling_face: I used the terms in the same way as you’d say a web browser uses/supports the http protocol (both client and server use the same protocol, in client and server role, respectively).

@samth I can confirm that git clone <git://github.com/racket/plot>
indeed works. But since the Github documentation at https://docs.github.com/en/github/getting-started-with-github/about-remote-repositories doesn’t mention this form as access, it amounts to be an undocumented feature (maybe for backward compatibility). That said, I don’t know for absolute certain whether the git://
access is mentioned somewhere in the Github docs.

Sourcehut is much younger than Github or Gitlab, so this would be a possible reason why it doesn’t support the Git protocol, since it’s probably for backward compatibility on Github and Gitlab.

> That’s why you saw the error about port 9418 from tcp-connect
. 9418 is the server side port, so a client would connect to that port.

Yes, that’s my point.

I think we agree now that Github (haven’t tried Gitlab) supports git://
URLs (Git protocol) and Sourcehut doesn’t.

Right, and that raco pkg
uses the Git protocol.

> Right, and that raco pkg
uses the Git protocol. Also agreed. :slightly_smiling_face: My point was that raco pkg
should also support Git clones over https since they’re the recommended way to anonymously clone a repo.

It does support that; it just requires a way to distinguish that from an http-served collection of files, and uses .git
at the end to do that.

As Matthew said, we could change Racket to support some other signal but that wouldn’t help you right now.

> It does support that; it just requires a way to distinguish that from an http-served collection of files, and uses .git
at the end to do that. Yes, that’s the problem. :slightly_smiling_face: …

> As Matthew said, we could change Racket to support some other signal but that wouldn’t help you right now. I see that https://pkgd.racket-lang.org/pkgn/create explicitly allows to choose “Git repository” as source. Would this allow the package server to make the distinction between a plain http directory and a git directory? So when going over the Racket package server, the behavior of raco pkg
might not matter. That said, I don’t know how the Racket package server works.

The Racket pkg server is just serving a set of URLs — you can even see what URL it’s creating in that form.

But it does seem like that might suggest the wrong thing for hosts that don’t support the same things github/gitlab do.

> The Racket pkg server is just serving a set of URLs — you can even see what URL it’s creating in that form. Yes, I see the URL, but didn’t know whether that’s an URL by which the package server requests the repo and raco
gets the package from the server or whether it’s an URL that is transmitted to raco pkg
and raco pkg
uses it as if the user gave the URL directly on the command line.

The package server doesn’t store anything other than the URL (and some metadata)

Ok, that clarifies it. :+1:

So my summarized understanding is that we need one (or more) of the following: • Give raco pkg
a feature so that it can use the https protocol, regardless of a .git
suffix is in the URL. • Convince Sourcehut to run a Git daemon to support the Git protocol, so that raco pkg
can use that for cloning. Earlier I thought that Sourcehut could just offer the current https clone URL with a .git
suffix as an alternative. But as I understand now, this wouldn’t help because the .git
suffix signals to raco pkg
that it should use the Git protocol?

No, the third option also works

So a .git
suffix would allow raco pkg
to get the repo via https?

Yes

@samth Thank you!

Hence an updated summary, including another point for completeness: • Give raco pkg
a feature so that it can use the https protocol, regardless of a .git
suffix is in the URL. • Convince Sourcehut to run a Git daemon to support the Git protocol, so that raco pkg
can use that for cloning. • Convince Sourcehut to allow a .git
suffix on the https clone URL, so raco pkg
would fetch the repo via https. • Use another hosting service that supports a .git
suffix in a clone URL or supports a Git (protocol) deamon.

Thank you so much for posting this. I had wanted to tune in and participate, but Fri-Sat I was volunteering at the FEMA Level 1 Vaccination Site in Philadelphia, helping to process 800 people per hour or 6000–7500 people per day in 12 hour shifts, and all I could do at the end of the day was crawl into bed in my hotel room and go to sleep. On top of that all hell was breaking loose in another area of my life, but I can’t comment on that at the moment. I’m just glad to see the happy Racket community continuing to do its thing and making the world of computing a better place.

New state at https://git.sr.ht/~sschwarzer/todo-txt . I got the launcher to work, but only after moving todoreport.rkt
from file/todoreport.rkt
to file/todoreport/todoreport.rkt
. Before I got a “module not found” error mentioning file/todoreport/todoreport
. I then tried ../todoreport.rkt
instead of todoreport.rkt
as the value for the racket-launcher-libraries
path, but that gave me another error. With the current state the launcher seems to work, but racket -l- file/todoreport
doesn’t (but racket -l- file/todoreport/todoreport
works although that’s not ideal). Ideally I’d like to put todoreport.rkt
directly under file
in the repository, but I couldn’t figure out how to make this work. Do you have any advice?

I would just put the info.rkt file one directory up

and put todoreport.rkt in the file
directory as well

> I would just put the info.rkt file one directory up The info.rkt
for todoreport
, then directly under file
?

An info.rkt
file which specifies the launcher named todoreport
.

So yet another info.rkt
in addition to the one under the todoreport
directory?

You might not need one in the todoreport directory

I’ll give it a try …

I moved todoreport.rkt
up and split todoreport/info.rkt
in two. One file in the same place, but without the launcher definition. (This is now more “symmetrical” with the todo-txt
collection.) One info.rkt
one level up as you suggested, but with only the launcher definition. This seems to work fine now, as far as I can tell. Thanks again! :slightly_smiling_face:


I’ll ask the Sourcehut team if they want to support the .git
-suffixed alias for repo URLs.

Done: https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C1795b4ed-0cdb-d8ba-0909-5f3b301f9239%40sschwarzer.net%3E Let’s continue the discussion in the Racket ticket.

Anyone know why scribble
is trying to find path/to/scribbling/setup
or path/to/scribbling/pkg
while installing a documentation package? When I build, I get raco setup: error: during building docs for <pkgs>/scribble-minted-doc/minted/minted.scrbl
raco setup: open-input-file: cannot open module file
raco setup: module path: workspace/scribble-minted/scribble-minted-doc/minted/setup
raco setup: path: workspace/scribble-minted/scribble-minted-doc/minted/setup
raco setup: system error: no such file or directory; rkt_err=3
where ../minted/setup
is not referenced anywhere, and it sometimes displays ../minted/pkg
instead. (seems to depend on if I’m running raco pkg install
or raco setup --only --pkgs scribble-minted-doc
)
I must have misconfigured my package but I.. can’t figure out how. https://github.com/wilbowma/scribble-minted/tree/split-package

Looks like I forgot to add (define collections 'multi)
to the info.rkt

.. or maybe that wasn’t it.. I’m getting the error again.

Beginning to suspect this is the fault of my package, which is using require/expose to try to hack scribble itself