ocaml / ocaml/dune

configurator: allow c_test wihout linking

Open
#4,544 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build c-bindings
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

The c_test function in the configurator API currently compiles and links the test C program. However, for some purposes compiling is enough (eg to check if a given symbol is defined).

There can be a big performance difference between compiling and linking compared with just compiling. For example, the configuration script of ocurl checks the existence of ~270 symbols. Under Unix, compiling and linking each C test program, takes ~60s to complete. Just compiling takes ~11s. By comparison, autoconf takes ~19s to do the same test.

Perhaps the API should be extended to offer the possibility of compiling, but not linking, the C test program?

See ygrek/ocurl#38 for some context.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the configurator API implementation of c_test and any existing tests for C test compilation. Check how the current API invokes compilation and linking, then define the separate compile-only behavior requested. Done means callers can check C symbols without linking while the existing linked-test behavior remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ocaml
Domain
build-system, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.