---
title: "Compile"
description: "Turn source code and binaries into a 10x symbol library: per-file .10x.json units plus a single linked .10x.tar the runtime uses to assign hidden classes to log events."
icon: material/cog-box
---

Turn source code and binaries into a [symbol library](../../../../compile/link/#symbol-library).

The compile family scans a mix of sources: a local folder, GitHub repos, docker/OCI images, Helm charts, and Artifactory artifacts. It writes a per-file `.10x.json` unit for each, then links them into one `.10x.tar`.

That library is what the 10x runtime reads later to assign hidden classes (TenXTemplates) to log events, so a pattern's identity tracks the line of code that emitted it.

Compiling is bounded-synchronous. [`log10x_compile`](compile.md) waits inline up to `max_wait_ms` (default 45s), then returns the finished library plus the full scan and link diagnostics in one call.

A small compile finishes inside that wait, and so does every re-run: the output folder is pinned per source set, so a repeat call reuses the earlier result.

A long first compile of a large tree overruns the wait and returns a running `job_id`. Poll it with [`log10x_compile_status`](compile-status.md), or call `log10x_compile` again later and collect the pinned result near-instantly.

To re-link an existing units tree into a library with no source scan, use [`log10x_compile_link`](compile-link.md).

!!! tenx-ask "You"

    compile a symbol library from github apache/commons-cli

!!! tenx-answer "Log10x"

    Compile job `a1f2c3` done, 31 units linked to symbols.10x.tar (412 KB). No scan failures.

!!! tenx-ask "You"

    how is the big compile coming along?

!!! tenx-answer "Log10x"

    Compile job `7d4e9b` running, 2m14s elapsed, 8,640 units so far, 12 files failed to scan (java 9, python 3). Poll again.

!!! tenx-ask "You"

    re-link the units I pruned

!!! tenx-answer "Log10x"

    Link job `c90a11` done, 27 units merged to symbols.10x.tar (388 KB). 4 units excluded by name filter.

| You ask | Example answer |
|---|---|
| [compile a library from a folder, repos, images, charts, or Artifactory](compile.md) | Compile job `a1f2c3` done, 31 units linked to symbols.10x.tar (412 KB). Or a running `job_id` for a long first compile. |
| [check on compile job `7d4e9b`](compile-status.md) | `job_status` plus units, the linked `.10x.tar`, per-language scan-failure counts, the link report, and a redacted log tail. |
| [re-link a folder of units into one library](compile-link.md) | Link job `c90a11` done, 27 units merged to symbols.10x.tar (388 KB). No source re-scan. |

## :material-check-decagram-outline: Prerequisites

The compile family runs the [Compiler app](../../../compiler/), which executes the [compile pipeline](../../../../compile/), docker-first. By default it pulls the cloud image `log10x/compiler-10x`.

That image bundles the following, so no host docker socket is needed:

- a daemonless podman for image pulls
- the GitHub and Artifactory REST clients
- the helm CLI

With `mode: "local"` it uses a local Compiler-flavor `tenx` instead. The Runtime flavor is refused.

This is the CLI tier, so it needs no Kubernetes, deployed app, or Log10x account.

GitHub pull requires a token even for public repos (`github_token`, or `GH_TOKEN` / `GITHUB_TOKEN`). Artifactory pull also requires a token (`artifactory_token` or `ARTIFACTORY_TOKEN`). Public docker images and public Helm charts need no credentials.

Two limits to know:

- `gomod` pull is deliberately not exposed, because it floods the library with transitive dependencies.
- `.jar` files are not scanned directly, so provide extracted `.class` files.
