atdml: provide option to write output files in the same folder as the source
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
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
atdmlthat 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ahrefs/atd
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Proposal: Introduce `atd` dispatcher CLI and prepare unified Cmdliner interface (ATD 4.x → 5.0)Opendesign and planning
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
code quality internal quality assurance target:cpp target:d target:java target:ocaml target:python target:scala target:typescript
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
enhancement packaging
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
feature request target:cpp
Difficulty 5/5 Over a week Newbie friendliness 15/100
Similar issues
-
Expo 57 example: pnpm install fails with ERR_PNPM_TRUST_DOWNGRADEPossibly taken @github-actions claimed this today. Openbug react-native team/client-libraries
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PostHog/posthog-js#5442 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib#2831 ·
Maintainers usually reply within 1 day
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mastra-ai/mastra#28491 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jupyterlab/jupyter-builder#196 ·
-
bug priority:critical
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Arbiter-xyz/arbiter-app#371 ·
Maintainers usually reply within 2 days