Liking cljdoc? Tell your friends :D

clj-zig.cache

Content-address generated artifacts. The hash of the normalized spec, body, dependencies, options, Zig version, and target becomes the artifact path, so an unchanged form reuses its library and a changed form gets a fresh one. The JVM never reloads a stale library.

.clj-zig/cache/macos-aarch64/app.core/add-83a1c0f9e1b2/
  source.zig
  libadd-83a1c0f9e1b2.dylib
  manifest.edn

cache-key and artifact-paths are pure; resolving the toolchain version and target, and reading and writing the filesystem, are the shell.

Content-address generated artifacts. The hash of the
normalized spec, body, dependencies, options, Zig version, and target
becomes the artifact path, so an unchanged form reuses its library and
a changed form gets a fresh one. The JVM never reloads a stale library.

    .clj-zig/cache/macos-aarch64/app.core/add-83a1c0f9e1b2/
      source.zig
      libadd-83a1c0f9e1b2.dylib
      manifest.edn

`cache-key` and `artifact-paths` are pure; resolving the toolchain
version and target, and reading and writing the filesystem, are the
shell.
raw docstring

artifact-pathsclj

(artifact-paths {:keys [root target ns name hash]})

The artifact directory and file paths for a build, under root (default .clj-zig/cache).

The artifact directory and file paths for a build, under `root`
(default `.clj-zig/cache`).
sourceraw docstring

bundled-resource-pathclj

(bundled-resource-path {:keys [target ns name hash]})

The classpath resource path for a baked library, mirroring the cache layout under the resource root. The library's content hash is in the path, so a resource matches a function's hash for a target or it does not.

The classpath resource path for a baked library, mirroring the cache
layout under the resource root. The library's content hash is in the
path, so a resource matches a function's hash for a target or it does
not.
sourceraw docstring

cache-keyclj

(cache-key {:keys [spec body source deps options zig-version target aux-files]})

The content hash for these build inputs. The generated source enters the hash directly, so a change to the source generator yields a new key even when the spec and body are unchanged; the spec, body, dependencies, options, Zig version, and target enter it as well. A body that imports other Zig files adds their contents under :aux, so editing an imported file recompiles; a body with no imports hashes exactly as before.

The content hash for these build inputs. The generated `source` enters
the hash directly, so a change to the source generator yields a new key
even when the spec and body are unchanged; the spec, body, dependencies,
options, Zig version, and target enter it as well. A body that imports
other Zig files adds their contents under `:aux`, so editing an imported
file recompiles; a body with no imports hashes exactly as before.
sourceraw docstring

clean!clj

(clean!)
(clean! root)

Remove the entire artifact cache under root (default .clj-zig/cache).

Remove the entire artifact cache under `root` (default `.clj-zig/cache`).
sourceraw docstring

ensure-library!clj

(ensure-library! {:keys [spec source root aux-files] :as inputs} compile!-fn)

Return the cached artifact paths for these inputs, resolving a library in three steps: a present filesystem artifact, then a baked library on the classpath, then a fresh compile through compile!-fn. A baked library is extracted into the cache and loaded without invoking Zig. Identical inputs reuse a resolved library; any change resolves a fresh path. inputs carries :spec, :body, :source, :deps, :options, :zig-version, :target, and an optional :root.

Return the cached artifact paths for these `inputs`, resolving a library
in three steps: a present filesystem artifact, then a baked library on
the classpath, then a fresh compile through `compile!-fn`. A baked
library is extracted into the cache and loaded without invoking Zig.
Identical inputs reuse a resolved library; any change resolves a fresh
path. `inputs` carries `:spec`, `:body`, `:source`, `:deps`, `:options`,
`:zig-version`, `:target`, and an optional `:root`.
sourceraw docstring

evict!clj

(evict! {:keys [spec root] :as inputs})

Remove the single cached artifact for these inputs, so the next build recompiles instead of reusing it. Inputs match ensure-library!.

Remove the single cached artifact for these `inputs`, so the next build
recompiles instead of reusing it. Inputs match `ensure-library!`.
sourceraw docstring

library-present?clj

(library-present? paths)

True when a usable library exists. A zero-byte file (left by a failed build) does not count, so a poisoned path recompiles instead of loading an invalid library.

True when a usable library exists. A zero-byte file (left by a failed
build) does not count, so a poisoned path recompiles instead of loading
an invalid library.
sourceraw docstring

read-manifestclj

(read-manifest paths)

Read the manifest for a built artifact, or nil when none exists.

Read the manifest for a built artifact, or nil when none exists.
sourceraw docstring

target-tripleclj

(target-triple)

The development target as <os>-<arch>, part of the cache key and the artifact path.

The development target as `<os>-<arch>`, part of the cache key and the
artifact path.
sourceraw docstring

write-manifest!clj

(write-manifest! paths
                 {:keys [spec deps options zig-version target]}
                 artifact-key)

Write the human-readable manifest describing a built artifact.

Write the human-readable manifest describing a built artifact.
sourceraw docstring

zig-versionclj

(zig-version)

The zig compiler version string, part of the cache key.

The `zig` compiler version string, part of the cache key.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close