On this page:
package
empty-package
package->exact-package-query
install
build-user-package
load-user-package-definition
current-package-definition-editor
current-package-editor
sxs
5.1 Package Settings
DENXI_  ALLOW_  UNSUPPORTED_  RACKET
DENXI_  INSTALL_  SOURCES
DENXI_  INPUT_  OVERRIDES
DENXI_  INSTALL_  ABBREVIATED_  SOURCES
DENXI_  INSTALL_  DEFAULT_  SOURCES
5.2 Package Messages
$package
$package:  log
$package:  output
$package:  output:  built
$package:  output:  reused
$package:  output:  undefined
$package:  unsupported-racket-version
$package:  unsupported-os
$package:  unavailable-output
8.12

5 Packages🔗ℹ

 (require denxi/package) package: denxi

struct

(struct package (description
    tags
    url
    provider
    name
    edition
    revision-number
    revision-names
    os-support
    racket-versions
    metadata
    inputs
    outputs))
  description : string?
  tags : (listof non-empty-string?)
  url : url-string?
  provider : non-empty-string?
  name : non-empty-string?
  edition : non-empty-string?
  revision-number : revision-number?
  revision-names : (listof non-empty-string?)
  os-support : (listof symbol?)
  racket-versions : (listof (list/c non-empty-string?))
  metadata : (hash/c symbol? string?)
  inputs : (listof package-input?)
  outputs : (listof package-output?)
A package is an instance of package.

description is a human-readable summary of the package’s purpose.

tags is a list of human-readable topics used for discovery.

url is the primary, or canonical URL used to guide a user towards more information (as opposed to secondary URLs that may appear in metadata).

provider is the name of the allegedly responsible distributor.

name is the name of the package.

edition, revision-number, and revision-names are the package’s edition, revision number, and revision names.

os-support is a list of possible values from (system-type 'os). If (system-type 'os) is not an element of os-support, then Denxi will not install the package.

racket-versions is a list of Racket version ranges that should be interpreted as a set of supported Racket versions. If (version) is not an element of any version interval, then assume that the software created with build will not function with the running version of Racket.

metadata is a hash table of user-defined metadata. In the event entries of this table appear redundant with other structure fields, prefer the values in the structure fields.

inputs is a list of package inputs.

outputs is a list of defined package outputs.

A function that maps output names to subprograms in outputs is surjective, but might not be injective. Denxi does not distinguish the two, meaning that non-injective lookups will create redundant data on disk (Denxi assumes that different output names imply different file distributions). When non-surjective, then an output’s subprogram might be inaccessible. This can happen if a package instance is manually created with faulty data. Bijective lookups do not have these problems, and they are easy to make using denxi/pkgdef.

The package with no inputs, no outputs, and all default values. The empty package claims to support all operating systems and versions of Racket.

procedure

(package->exact-package-query pkg)  exact-package-query?

  pkg : package?
Returns an exact package query built from the information available in the package.

procedure

(install link-path    
  output-name    
  package-definition-variant)  subprogram?
  link-path : (or/c #f path-string?)
  output-name : (or/c #f string?)
  package-definition-variant : any/c
Returns a subprogram called for its effect. The effect being that a symbolic link gets created at link-path, pointing to a directory. That directory contains the files corresponding to the output-name defined in package-definition-variant).

If link-path is #f, then the name of the symbolic link will match the name of the package.

If output-name is #f, then install will use DEFAULT_STRING.

The subprogram is not atomic, so failure may result in a broken intermediate state on disk. This procedure should be used in the context of a transaction to avoid this problem.

All install messages are instances of $package.

procedure

(build-user-package pkgdef)  (subprogram/c package?)

  pkgdef : package-definition-datum?
Returns a subprogram that builds a new package instance by dynamically instantiating pkgdef, then passing the result to current-package-editor.

procedure

(load-user-package-definition src)

  (subprogram/c package-definition-datum?)
  src : source-variant?
Returns a subprogram that builds a new package definition from the bytes read from src, then computes the final result using current-package-definition-editor.

value

current-package-definition-editor

 : 
(parameter/c (-> bare-racket-module?
                 (or/c bare-racket-module?
                       (subprogram/c bare-racket-module?))))
A parameter for a procedure that replaces any bare package definition with another before using that definition.

This procedure defaults to the identity function, so no code is replaced. The procedure may instead return a subprogram if it intends to add to a subprogram log.

This procedure is useful for standardizing definitions, or for analyzing builds. Define with care. This procedure may override all package definitions, which can render a Denxi process inoperable or unsafe.

Take for example a function that returns the same static package definition, which has one dependency.

(current-package-definition-editor (lambda (original)
  (struct-copy bare-racket-module original
               [code
                 '((input "pkgdef" (sources "https://example.com/other.rkt"))
                   (output "default"
                           pkgdef-input := (input-ref "pkgdef")
                           pkgdef-path := (resolve-input "pkgdef")
                           (install #f #f pkgdef-path)))])))

This creates builds that will not terminate. Even if Denxi downloads a new package definition from "https://example.com/other.rkt", it will only be replaced by another instance of the same data returned from (current-package-definition-editor).

Like current-package-definition-editor, but for parsed packages that are suitable for installation.

This procedure defaults to the identity function, so the package is used as-is.

This parameter would likely be easier to use in a launcher, since struct bindings are available to operate on the actual package.

procedure

(sxs pkg)  (subprogram/c package?)

  pkg : package?
Returns a subprogram that functionally updates (package-provider pkg) with a cryptographically random name, and adds a $show-string message to the subprogram log that displays as sxs: <old name> ~> <new name>.

When used as the current-package-editor, Denxi is forced into an extreme interpretation of side-by-side (SxS) installations.

In this mode, package conflicts become vanishingly improbable. The cost is that Denxi’s cycle detection and caching mechanisms are defeated because they will never encounter the same package enough times for them to matter. Installations using sxs consume more resources, and are vulnerable to non-termination. Stop using sxs the moment you don’t need it.

sxs is useful for handling unwanted package conflicts. Re-running a single installation using sxs will force installation of conflicting packages without disturbing other installed packages.

Note that the package inputs are still subject to caching. Only the output directories that would hold links to inputs are not cached.

5.1 Package Settings🔗ℹ

CLI Flags: -G/--assume-support/--DENXI_ALLOW_UNSUPPORTED_RACKET
When true, continue installing when a package definition declares that it does not support the running Racket version.

CLI Flags: +s/++install-source/--DENXI_INSTALL_SOURCES
Defines installations in a transaction.

Each list in DENXI_INSTALL_SOURCES consists of three strings:

  1. The path to a symbolic link to create with respect to (current-directory).

  2. The name of a desired output from a package definition.

  3. A URL, file path, or launcher-specific string used to find the package definition.

CLI Flags: +o/++input-override/--DENXI_INPUT_OVERRIDES
A list of strings used to define package input overrides.

Each element is in the form (cons pattern input-expr). The input of name input-name is replaced with the (evaluated) input-expr for all package queries matching pattern.

If pattern is a string, then it is used as an argument to pregexp before matching. If pattern is a symbol, then it is first coerced to a string and then used as an argument to pregexp.

CLI Flags: +a/++install-abbreviated/--DENXI_INSTALL_ABBREVIATED_SOURCES
Like DENXI_INSTALL_SOURCES, except each item in the list only needs to be a URL, file path, or launcher-specific string used to find the package definition. The symbolic link name is assumed to be the string bound to package in the definition, and the output is assumed to be "default".

CLI Flags: +d/++install-default/--DENXI_INSTALL_DEFAULT_SOURCES
Like DENXI_INSTALL_SOURCES, except each list only needs two strings:

  1. The path of a symbolic link to create with respect to (current-directory).

  2. A URL, file path, or launcher-specific string used to find the package definition.

The output is assumed to be "default".

5.2 Package Messages🔗ℹ

struct

(struct $package $message ()
    #:prefab)
A message from a package’s runtime.

struct

(struct $package:log $package (query output-name messages)
    #:prefab)
  query : package-query?
  output-name : string?
  messages : subprogram-log/c
A message containing other messages relevant to building a particular package output.

struct

(struct $package:output $package ()
    #:prefab)
A message pertaining to a package output.

struct

(struct $package:output:built $package:output ()
    #:prefab)
Denxi successfully built a package output.

struct

(struct $package:output:reused $package:output ()
    #:prefab)
Denxi reused a previously-built package output.

struct

(struct $package:output:undefined $package:output ()
    #:prefab)
A requested output is not defined in a corresponding package definition.

struct

(struct $package:unsupported-racket-version $package (versions)
    #:prefab)
  versions : racket-version-ranges/c
A package claims that the software it builds does not support the running version of Racket.

struct

(struct $package:unsupported-os $package (supported)
    #:prefab)
  supported : (listof symbol?)
A package claims that it, or the software it builds, does not support the current operating system. Supported systems in supported are possible values from (system-type 'os).

struct

(struct $package:unavailable-output $package (available)
    #:prefab)
  available : (listof string?)
The requested output for a package is not among the available outputs.