ocaml / ocaml/dune

Please honor CFLAGS

Open
#8,291 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

  • #8464 by @glondu — closed without merging
build c-bindings
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Desired Behavior

Dune should take into account the CFLAGS environment variable when compiling C code (similarly with CXXFLAGS and C++).

Rationale

Using these environment variables is standard in build systems (e.g. make).

In Debian, we use these variables to have some options used by many (if not all) packages at once.

In particular, one of the options set by Debian is the file prefix map: -ffile-prefix-map=/tmp/foo=., which is important for reproducibility.

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 tracing Dune's C and C++ compilation flag handling and review the context of linked pull request #8464. Reproduce a build with CFLAGS and CXXFLAGS, then verify that options such as -ffile-prefix-map are honored when compiling C and C++ code.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.