Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

atdml: provide option to write output files in the same folder as the source

Open
#511 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating atdml's command-line option handling and output-file generation, then reproduce the issue with the shown dune rule and a nested types.atd source. Done means an option causes generated files to be written beside the source while diagnostics still use project-root paths and dune finds the declared targets.

Written by the indexing model from the issue text.

Description

enhancement target:ocaml

Problem: the following dune file works but produces error messages referencing ./types.atd rather than the path from the workspace root or project root:

(rule
  (targets types.ml types.mli)
  (deps types.atd)
  (action
    (run atdml %{deps})
  )
)

A solution is to change directory using (chdir ...) which takes care of adjusting the %{deps} paths:

(rule
  (targets types.ml types.mli)
  (deps types.atd)

  ; Run this preprocessing command from the project root so as to get
  ; usable paths to the source file in error messages.
  (action
    (chdir %{workspace_root} (run atdml %{deps}))
  )
)

but now the problem is that the targets are created at the workspace root (<root>/types.ml) instead of at <root>/path/to/types.ml which is not where dune expects them.

Proposed solution:

  • Add an option to atdml that makes it write the output files in the same folder as the atd source file (I like this better than making it a default, even if backward compatibility wasn't an issue)
Dominant language
OCaml
Stars
354
Forks
63
Avg merge
9h 19m
Merged PRs (30d)
1

Getting set up

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.

More from ahrefs/atd

All issues in ahrefs/atd

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.