Skip to content

forge: pkg uninstall does not remove dylib unless steel_toml is installed #685

Description

@ongyx

Hi, I've been tinkering with Steel recently for the Helix plugin system, and there's a bug where dylibs aren't removed when cogs containing them are uninstalled, resulting in the error "Unable to discover dylib name. It is possible that it is not deleted".

The error originates from uninstall-package calling find-dylib-name, which delegates to try-parse-toml to parse the cog's Cargo.toml, and attempts to load the dylib for steel_toml:

(define dylib-name (find-dylib-name cargo-toml-path))

(define toml-contents (try-parse-toml contents))

(define (try-parse-toml str)
;; Include the dylib if relevant
(eval '(#%require-dylib "libsteel_toml" (only-in toml->value string->toml)))
(eval `(toml->value (string->toml ,str))))

This error was reproduced on both Windows 11 and Debian sid. The easiest solution is to install the steel_toml dylib using cd libs/steel_toml && cargo steel-lib as a postinstall step right now, but you can also consider:

  1. Adding a cog.scm to steel_toml and making forge itself a cog to allow declaring steel_toml as a dependency
  2. Vendoring steel_toml within the forge binary

(1) would entail adding a bootstrap to install forge itself and then steel_toml, but this shouldn't be a problem if the install code doesn't touch any dylib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions