Agent skill

Fastly Compute Native Test Linker Failure

by divinevideo in divinevideo/divine-mobile

Fix Fastly Compute Rust crate cargo test failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like versionset, bodynew, reqsend on native host builds.

MPL-2.0Auto-check passedTesting & QA

Install Fastly Compute Native Test Linker Failure

skills CLI
$ npx skills add divinevideo/divine-mobile --skill fastly-compute-native-test-linker-failure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install divinevideo/divine-mobile fastly-compute-native-test-linker-failure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/fastly-compute-native-test-linker-failure .claude/skills/fastly-compute-native-test-linker-failure && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fastly-compute-native-test-linker-failure
GitHub stars
266
Token cost
~2.3k tokens
SKILL.md length
964 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Fix Fastly Compute Rust crate cargo test failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like versionset, bodynew, reqsend on native host builds.

  • Works in 5 steps: Create src/lib.rs if it doesn't exist → Put any module you want to unit-test… → In src/main.rs, also declare the module… → …
  • You added a [cfg(test)] module to a file in a Fastly Compute binary crate and the tests never seem to run
  • SKILL.md covers Problem, Context / Trigger Conditions, Root cause and Solution, plus 4 more sections
  • Calls cargo

What it does

Fastly Compute Native Test Linker Failure is an agent skill from divinevideo/divine-mobile. Fix Fastly Compute Rust crate cargo test failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like versionset, bodynew, reqsend on native host builds. Use when: (1) cargo test on a Fastly Compute crate fails at link time with errors mentioning libfastly and symbols with names like fastly::http::response::handle::..., (2) You added a [cfg(test)] module to a file in a Fastly Compute binary crate and the tests never seem to run or fail to link, (3) Existing [cfg(test)] modules in src/main.rs or its…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Failing and flaky tests. It works with Rust. The licence is MPL-2.0.

When your agent uses it

  • You added a [cfg(test)] module to a file in a Fastly Compute binary crate and the tests never seem to run
  • Existing [cfg(test)] modules in src/main.rs
  • Its sibling modules appear dead despite being present in the source tree
  • Cargo test --lib works but cargo test fails

Example prompts

  • “ld: symbol(s) not found”
  • “/fastly-compute-native-test-linker-failure”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Create src/lib.rs if it doesn't exist
  2. Put any module you want to unit-test **in a separate file that does NOT import Fastly
  3. In src/main.rs, also declare the module so the binary can use it
  4. The handler in an admin.rs (or wherever) that DOES use Fastly SDK types extracts
  5. Run tests with

What it can do on your machine

Read from SKILL.md and the folder at commit c3d6f7e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.rs

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fastly Compute Native Test Linker Failure loads about 2.3k tokens when it runs. Until then it costs about 177 tokens; SKILL.md has 964 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~177
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from divinevideo/divine-mobile at commit c3d6f7e, republished under its MPL-2.0 licence (© divinevideo). 964 words, ~2,335 tokens.

Download SKILL.mdSave it as .claude/skills/fastly-compute-native-test-linker-failure/SKILL.md (or your agent's skills folder).
name
fastly-compute-native-test-linker-failure
description
Fix Fastly Compute Rust crate `cargo test` failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like `_version_set`, `_body_new`, `_req_send` on native host builds. Use when: (1) `cargo test` on a Fastly Compute crate fails at link time with errors mentioning libfastly and symbols with names like `fastly::http::response::handle::...`, (2) You added a `#[cfg(test)]` module to a file in a Fastly Compute binary crate and the tests never seem to run or fail to link, (3) Existing `#[cfg(test)]` modules in src/main.rs or its sibling modules appear dead despite being present in the source tree, (4) `cargo test --lib` works but `cargo test` fails.
author
Claude Code
version
1.0.0
date
2026-04-05

Fastly Compute native test linker failure

Problem

Fastly Compute Rust binaries link against libfastly, which provides FFI symbols that only exist when targeting wasm32-wasip1. On a native host (macOS, Linux x86_64, Linux arm64), the FFI symbols are absent, so linking a test binary for the Fastly Compute crate fails with errors like:

"_version_set", referenced from:
    fastly::http::response::handle::ResponseHandle::set_version::h234bdb33f8878476 in libfastly-XXXX.rlib
"_body_new", referenced from:
    fastly::http::body::Body::new::hYYYY in libfastly-XXXX.rlib
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1
error: could not compile `fastly-blossom` (bin "fastly-blossom" test)

The error appears during cargo test even if none of your tests actually call Fastly SDK code — cargo still tries to compile and link the entire binary as a test target.

This has a nasty consequence: any #[cfg(test)] mod tests { ... } block inside a file compiled into the binary crate is effectively dead code. It never runs via cargo test because cargo can't link the test binary. Developers add tests, the compiler accepts them, they're visible in the source tree — but they never execute. Tests that were meant to regression-guard behavior silently become documentation that rots.

Context / Trigger Conditions

  • Fastly Compute Rust project with fastly = "0.11.x" (or similar) as a dependency
  • The crate has both src/main.rs and src/lib.rs OR only src/main.rs
  • cargo test fails at link time with _version_set / _body_new / _req_send undefined
  • cargo check --target wasm32-wasip1 succeeds
  • cargo check (native) succeeds (library code compiles, just can't link the binary)
  • You added tests in src/admin.rs, src/blossom.rs, src/metadata.rs, or any file that's mod-included from src/main.rs but NOT from src/lib.rs

Root cause

Fastly's Rust SDK (fastly crate) is designed exclusively for wasm32-wasip1. Its public API calls unsafe FFI functions (_version_set, _req_send, _body_new, etc.) that the Fastly Compute runtime provides at execution time inside the POP. On a native host, the rustc compiler still compiles the library crate, but the linker can't resolve those FFI symbols because libfastly-native doesn't exist.

cargo test for a mixed lib+bin crate links two artifacts: the library test binary AND the binary test binary (the main executable with tests enabled). The library test binary can avoid the SDK symbols if lib.rs doesn't import them transitively. The binary test binary can't, because main.rs wires the whole Fastly Compute runtime.

Solution

Structure your crate as lib + bin, and put all testable logic in lib
  1. Create src/lib.rs if it doesn't exist:
rust
// src/lib.rs — library target, testable natively
pub mod admin_sweep;   // pure logic, no Fastly SDK
pub mod classifiers;   // pure logic, no Fastly SDK
pub mod parsers;       // pure logic, no Fastly SDK
  1. Put any module you want to unit-test in a separate file that does NOT import Fastly SDK types, and expose it via pub mod in lib.rs:
rust
// src/admin_sweep.rs — pure logic, testable natively
pub enum StuckAction { SkipNotStuck, SkipTooRecent, MarkComplete, ResetPending }

pub fn classify_stuck_record(
    is_processing: bool,
    uploaded_iso: &str,
    threshold_iso: &str,
    hls_present: bool,
) -> StuckAction { /* ... */ }

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn skip_not_stuck_when_status_is_not_processing() { /* ... */ }
}
  1. In src/main.rs, also declare the module so the binary can use it:
rust
mod admin_sweep;  // same file, compiled twice — once for lib, once for bin
  1. The handler in an admin.rs (or wherever) that DOES use Fastly SDK types extracts primitives from SDK types and calls the pure classifier:
rust
// src/admin.rs (part of the bin, uses Fastly SDK types like Request/Response)
pub fn handle_sweep(req: Request) -> Result<Response> {
    let is_processing = meta.transcode_status == Some(TranscodeStatus::Processing);
    let action = crate::admin_sweep::classify_stuck_record(
        is_processing, &meta.uploaded, &threshold_iso, hls_present,
    );
    // ... match on action, make SDK-level calls ...
}
  1. Run tests with:
bash
cargo test --lib

Not cargo test (which tries to link the bin). --lib only builds and runs the library test binary, which can link because none of its code touches Fastly SDK symbols.

Do NOT depend on crate internals from the lib module

Your lib-exposed module must NOT transitively import anything that touches the Fastly SDK. Common traps:

  • use crate::blossom::BlobMetadata; — if blossom.rs is in the binary crate and uses fastly::Request, importing BlobMetadata drags SDK symbols into the lib build. Solution: pass raw primitives (Option<TranscodeStatus>, &str, etc.) across the boundary, not full SDK-aware structs.
  • use crate::storage::current_timestamp; — if storage.rs calls fastly::kv_store::*, same problem. Duplicate the helper in admin_sweep.rs or extract it to a third SDK-free module in lib.rs.

Treat lib.rs as a clean-room: only pure Rust, no SDK types, no platform-specific I/O.

Verify
bash
cargo check --target wasm32-wasip1  # must still succeed (bin compiles for deploy)
cargo test --lib                     # must run and pass (tests exercise pure logic)

You can also add to CI:

yaml
- run: cargo test --lib
- run: cargo check --target wasm32-wasip1

cargo test (no flags) will still fail on this project; that's expected and unavoidable. Document it in README or CONTRIBUTING so contributors don't waste time on it.

Show full SKILL.md (384 more words)Show less

Verification

After applying this pattern:

  • cargo test --lib runs your new tests and they execute (pass or fail, but they RUN)
  • cargo check --target wasm32-wasip1 still produces a deployable WASM
  • Existing #[cfg(test)] mod tests blocks in binary-only files (admin.rs, etc.) are still dead; consider migrating them into lib-exposed modules or deleting them if the behavior they test can be moved

Example

In the Divine Blossom repo, the Fastly Compute crate (src/main.rs) had #[cfg(test)] modules in src/delete_policy.rs, src/error.rs, src/auth.rs, src/blossom.rs, and src/metadata.rs. None of these ran via cargo test — lib.rs only exposed resumable_complete. Attempting to add tests to src/admin.rs failed at link time.

The fix was to create src/admin_sweep.rs with zero dependencies on the rest of the crate (no use crate::blossom, no use crate::storage), add pub mod admin_sweep; to lib.rs, and have the tests live there. The handler in src/admin.rs (binary-only) extracts four primitives from BlobMetadata before calling the pure classifier.

Result: cargo test --lib now runs 11 tests (7 new + 4 pre-existing from resumable_complete). The wasm32-wasip1 build still produces a valid Fastly Compute binary. The binary-only #[cfg(test)] modules are still dead, but the logic that matters is now covered.

Notes

  • This is a structural constraint imposed by the Fastly SDK's FFI design, not something Fastly will "fix" — the SDK crate has to provide those symbols somehow, and the runtime is wasm.
  • Fastly's own examples tend to avoid tests entirely, which is why this trap is widespread.
  • The same pattern applies to any Rust crate that targets a specific platform via FFI symbols provided by a host runtime: Cloudflare Workers (worker-rs), Vercel Edge (@vercel/edge), some embedded HAL crates, etc. The "put pure logic in lib, keep SDK calls in bin" pattern generalizes.
  • If you're starting fresh, consider making your Fastly Compute crate a library-only crate with a tiny src/main.rs that just calls lib::run(). Then everything is in the lib by default and there's no bin/lib split to worry about. This is the cleanest structure.
  • rust-analyzer and IDE tooling will still happily analyze and type-check the #[cfg(test)] modules in binary-only files, so they look live. Only cargo test reveals the truth.

References

  • Fastly Compute Rust SDK crate — note the target restriction in the documentation
  • Related skill: fastly-compute-rust-edition2024-fix — different failure mode (build-time dependency incompatibility) but shares the "Fastly Compute crate has unusual constraints around native tooling" theme

© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/fastly-compute-native-test-linker-failure of divinevideo/divine-mobile.

Open the folder on GitHubat commit c3d6f7e

Compare with similar skills

Fastly Compute Native Test Linker Failure next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fastly Compute Native Test Linker Failure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fastly Compute Native Test Linker Failure this skilldivinevideo/divine-mobile266—~2.3kAutomated safety check: PassMPL-2.0
Apple Container Test RunnerRustPython/RustPython22k—~467Automated safety check: PassMIT
GreptimeDB Fuzz CI Failure InvestigationGreptimeTeam/greptimedb6.7k—~4.4kAutomated safety check: PassApache-2.0
OpenLogi Change VerificationAprilNEA/OpenLogi23k—~1.4kAutomated safety check: PassApache-2.0
CI Failure Analysisvortex-data/vortex3.3k—~810Automated safety check: PassApache-2.0
RustPython Test Failure InvestigationRustPython/RustPython22k—~467Automated safety check: PassMIT

Similar skills

  • Apple Container Test Runner

    RustPython/RustPython

    Runs RustPython tests inside a Linux container built with Apple's container CLI, so macOS users can compare Linux results with their local ones.

    22k GitHub stars~467 tokensUpdated today
    Testing & QAAuto-check passed
  • Diagnoses a failed GreptimeDB fuzz CI job by pulling its GitHub Actions logs and fuzz artifacts, then matching the evidence to the local source code.

    6.7k GitHub stars~4.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Plans the smallest check that could disprove a code change in the OpenLogi project, then escalates through reproduction, focused tests and a final gate before a push.

    23k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • CI Failure Analysis

    vortex-data/vortex

    Analyze Vortex GitHub Actions CI failures. An agent skill from vortex-data/vortex.

    3.3k GitHub stars~810 tokensUpdated today
    Testing & QAAuto-check passed
  • Investigates a failing RustPython test by comparing it with CPython, then either fixes it or gathers the details for an incompatibility report.

    22k GitHub stars~467 tokensUpdated today
    Testing & QAAuto-check passed
  • Review

    webern/cargo-readme

    Reviews a GitHub pull request for correctness, architecture, security, backward compatibility, and test coverage.

    385 GitHub stars~2k tokensUpdated yesterday
    Testing & QAAuto-check: notes

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    266 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    266 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    266 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    266 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    266 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    266 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Fastly Compute Native Test Linker Failure

What does Fastly Compute Native Test Linker Failure do?

Fix Fastly Compute Rust crate cargo test failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like versionset, bodynew, reqsend on native host builds. Fastly Compute Native Test Linker Failure is an agent skill from divinevideo/divine-mobile. Fix Fastly Compute Rust crate cargo test failures with "ld: symbol(s) not found" errors for Fastly SDK symbols like versionset, bodynew, reqsend on native host builds.

When should I use Fastly Compute Native Test Linker Failure?

Fastly Compute Native Test Linker Failure fits situations like: you added a [cfg(test)] module to a file in a Fastly Compute binary crate and the tests never seem to run; existing [cfg(test)] modules in src/main.rs; its sibling modules appear dead despite being present in the source tree; cargo test --lib works but cargo test fails.

How do I install Fastly Compute Native Test Linker Failure in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill fastly-compute-native-test-linker-failure -a claude-code`. Or copy the skill folder (.agents/skills/fastly-compute-native-test-linker-failure in divinevideo/divine-mobile) into .claude/skills/fastly-compute-native-test-linker-failure in your project. Claude Code loads it when a task matches its description.

How do I install Fastly Compute Native Test Linker Failure in Codex?

Run `npx skills add divinevideo/divine-mobile --skill fastly-compute-native-test-linker-failure -a codex`. Or copy the skill folder (.agents/skills/fastly-compute-native-test-linker-failure in divinevideo/divine-mobile) into .agents/skills/fastly-compute-native-test-linker-failure in your project. Codex loads it when a task matches its description.

Can I use Fastly Compute Native Test Linker Failure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill fastly-compute-native-test-linker-failure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fastly-compute-native-test-linker-failure, .gemini/skills/fastly-compute-native-test-linker-failure, .github/skills/fastly-compute-native-test-linker-failure and .opencode/skills/fastly-compute-native-test-linker-failure in your project.

What does Fastly Compute Native Test Linker Failure need to run?

Going by SKILL.md and its folder, Fastly Compute Native Test Linker Failure needs the command-line tools its instructions call (cargo).

Does Fastly Compute Native Test Linker Failure access the network?

SKILL.md names 1 domain. As links in the text: docs.rs. This is read from the text; nothing was executed.

Is Fastly Compute Native Test Linker Failure safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fastly Compute Native Test Linker Failure use?

Fastly Compute Native Test Linker Failure is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fastly Compute Native Test Linker Failure use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fastly Compute Native Test Linker Failure?

Skills that share tags, products or a category with Fastly Compute Native Test Linker Failure: Apple Container Test Runner (RustPython/RustPython, 22k stars), GreptimeDB Fuzz CI Failure Investigation (GreptimeTeam/greptimedb, 6.7k stars), OpenLogi Change Verification (AprilNEA/OpenLogi, 23k stars) and CI Failure Analysis (vortex-data/vortex, 3.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fastly Compute Native Test Linker Failure?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 266 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 10, 2026.

Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.