fukamachi / qlot

A project-local library installer for Common Lisp
https://qlot.tech
MIT License
468 stars 40 forks source link

project-name in git syntax #262

Closed justjoheinz closed 3 months ago

justjoheinz commented 4 months ago

Describe the bug

the documentation says that the syntax for git qlfile entries is: git <project name> <repos url>

But what exactly is project name? Is it the name of the system defined in the project? If yes, there could be multiple systems.

And sometimes systems have strange names e.g. in https://github.com/sharplispers/yaclml one such system is yaclml/test.

Adding

git yaclml/test https://github.com/sharplispers/yaclml.git

to the qfile always results in an error on mac os x (sbcl 2.4.6):

Reading '/Users/foo/Projects/lisp/bar/qlfile'...
⨯ [x/y] yaclml/test  Failed to install

Unexpected error: Can't create directory /private/var/folders/vr/t70kp3dd5m14_99ngdw8gdv40000gn/T/qlot-ZESQNNSA/yaclml/test

Versions:

Qlot 1.5.8

fukamachi commented 3 months ago

The project name is an identifier for the external library in your project. It can be anything you want, but commonly it will be the main system's name. You can use the same library multiple times with different identifiers, but you can't use the same identifier more than twice.

As it is used as a dist name for Quicklisp, it will be a part of the file path, so it can't contain characters that are not allowed in the path in your OS.

justjoheinz commented 3 months ago

I am not sure I understand. The system yacml/test is in quicklisp:

 (ql:system-apropos "yaclml")
#<SYSTEM yaclml / yaclml-20180131-git / quicklisp 2023-10-21>
#<SYSTEM yaclml / sharplispers-yaclml-20190318183048 / ultralisp 20240719191501>
#<SYSTEM yaclml/test / yaclml-20180131-git / quicklisp 2023-10-21>
#<SYSTEM yaclml/test / sharplispers-yaclml-20190318183048 / ultralisp 20240719191501>

However trying to resolve it via git and qlot does not work. The "/" is allowed in the path. If I were to add it using qlot

git someRandomName https://github.com/sharplispers/yaclml.git

what would change in my project? Would I need to declare a dependency on someRandomName in my asd file? Or does it not affect the system name at all?

fukamachi commented 3 months ago

You are looking at "SYSTEMS", not "PROJECTS". You can get the project name of "yaclml/test" like this:

(ql-dist:project-name (ql-dist:release (ql-dist:find-system "yaclml/test")))
;=> "yaclml"

In Quicklisp, "dist", "project", "release", and "system" are clearly differentiated.

fukamachi commented 3 months ago

You can name the project anything you want as long as it doesn't contain / (on Linux). If I were you, I'd use yaclml for it.

justjoheinz commented 3 months ago

Oh, thank you! This makes sense now.