GithubHelp home page GithubHelp logo

40ants / quicklisp-client-fix Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 2 KB

A fix to make ql:quickload work with package inferred ASDF systems better

Common Lisp 100.00%
common-lisp fix quicklisp

quicklisp-client-fix's Introduction

This patch fixes two problems:

  • Is that quicklisp is unable to load primary system's dependencies, which are subsystems of other primary system not mentioned in the quicklisp distribution's metadata. Issue quicklisp/quicklisp-client#139
  • When asdf system is known to ASDF, quicklisp client ignores it's dependencies and again, if the system depends on a subsystem of other primary system, ASDF can't load it and quicklisp client too.

How to reproduce the problem

For example, I have reblocks-ui-docs ASDF system. One of it's subsystems depends on reblocks/doc/example subsystem of other package-inferred system available from Quicklisp.

Checkout this repository somewhere:

git clone https://github.com/40ants/reblocks-ui /tmp/reblocks-ui

Then start lisp and add this path to asdf:*central-registry*:

CL-USER> (push "/tmp/reblocks-ui/" asdf:*central-registry*)

Try to quickload the system:

CL-USER> (ql:quickload "reblocks-ui-docs")

During quickload reblocks-ui-docs ASDF tries to load reblocks/doc/example and fails. QL client handles the condition, but can't find it in the metadata:

System "reblocks/doc/example" not found
   [Condition of type QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]

Restarts:
 0: [CONTINUE] Try again
 1: [ABORT] Give up on "reblocks/doc/example"
 2: [ABORT] Give up on "reblocks-ui-docs"
 3: [REGISTER-LOCAL-PROJECTS] Register local projects and try again.
 4: [RETRY] Retry SLY mREPL evaluation request.
 5: [*ABORT] Return to SLY's top level.
 --more--

Backtrace:
 0: ((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "reblocks/doc/example")
 1: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) {1004074BFB}>)
 2: (QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY "reblocks/doc/example")
 3: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "reblocks/doc/example" :PROMPT NIL)
 4: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "reblocks-ui-docs" :PROMPT NIL)
 5: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)) #<unused argument> #<FUNCTION (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:$
 6: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION :AROUND (QL-IMPL:SBCL T)) #<QL-IMPL:SBCL {10051FD7F3}> #<FUNCTION (FLET QUICKLISP-CLI$
 7: ((:METHOD QUICKLISP-CLIENT:QUICKLOAD (T)) "reblocks-ui-docs" :PROMPT NIL :SILENT NIL :VERBOSE NIL) [fast-method]
 8: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT:QUICKLOAD) {100135CCDB}>)
 9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QUICKLISP-CLIENT:QUICKLOAD "reblocks-ui-docs") #<NULL-LEXENV>)
10: (EVAL (QUICKLISP-CLIENT:QUICKLOAD "reblocks-ui-docs"))
11: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))

If we look at load strategy for reblocks/doc/example, then we'll see that quicklisp client have no idea how to load it:

CL-USER> (time (ignore-errors (quicklisp-client::compute-load-strategy "reblocks/doc/example")))
Evaluation took:
  0.028 seconds of real time
  0.026195 seconds of total run time (0.026195 user, 0.000000 system)
  92.86% CPU
  12 forms interpreted
  52,479,390 processor cycles
  7,386,224 bytes consed

NIL
#<QUICKLISP-CLIENT:SYSTEM-NOT-FOUND {1004978233}>

With my fix

But with my fix quicklisp client will attempt to find a primary system reblocks in the dist metadata and load strategy for reblocks/doc/example will look like this:

CL-USER> (time (ignore-errors (quicklisp-client::compute-load-strategy "reblocks/doc/example")))
Evaluation took:
  0.024 seconds of real time
  0.023418 seconds of total run time (0.016144 user, 0.007274 system)
  95.83% CPU
  642 forms interpreted
  47,100,320 processor cycles
  3,574,560 bytes consed

#<QUICKLISP-CLIENT::LOAD-STRATEGY "reblocks/doc/example" (2 asdf, 103 quicklisp)>
CL-USER> (describe *)
#<QUICKLISP-CLIENT::LOAD-STRATEGY "reblocks/doc/example" (2 asdf, 103 ..
  [standard-object]

Slots with :INSTANCE allocation:
  NAME                           = "reblocks/doc/example"
  ASDF-SYSTEMS                   = (#<ASDF/SYSTEM:SYSTEM "uiop"> #<ASDF/SYSTEM:SYSTEM "asdf">)
  QUICKLISP-SYSTEMS              = (#<QL-DIST:SYSTEM yason / yason-20230214-git / #1=quicklisp #2=2023-10..

This way the reblocks-ui-docs and be quickloaded just fine as well as reblocks/doc/example!

quicklisp-client-fix's People

Contributors

svetlyak40wt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.