haskell / haskell/cabal

Write Build Summary to Local Build Directory

Open
#11,228 3 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the feature request**
I would like to configure Cabal in such a way that `cabal build` only writes to the project directory.

**Additional context**
I want to run `cabal build` as part of coding tools (openai codex, claude code, crush, etc.). For safety, these tools run all commands in a sandbox that prevents writes outside of the project directory. Currently, `cabal build` fails to run in this environment since it tries to write to `~/.cache/cabal/logs/build.log`, which is outside of the project directory.

The documentation mentions the `build-summary` configuration directive and says that it is [not implemented](https://cabal.readthedocs.io/en/stable/cabal-project-description-file.html#cfg-field-build-summary). This seems to be outdated, as the directive does have an effect. Unfortunately, it only adds another path where it tries to write the build summary to, but also still tries to write to the default location. I also tried using the `logs-dir` directive, but could not observe any effect.

I am running Cabal 3.14.2.0.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the build-summary and logs-dir configuration directives are handled in Cabal 3.14.2.0, then follow the code that selects the default build-log location. Confirm the behavior with a sandboxed cabal build. Done means a configured build writes its summary and logs only inside the project directory, and the documentation matches the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.