Macaulay2 / Macaulay2/M2

Generate the d/*.o dependencies on e/*.hpp instead of maintaining them by hand

Open
#4,512 0 comments 0 reactions 0 assignees View on GitHub
bugs directory build issue
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

This issue was triaged from [`bugs/dan/0-makefile-d`](https://github.com/Macaulay2/M2/blob/388c1ff0ce30d83751dea7bc7eac77fdc1305dd7/bugs/dan/0-makefile-d), one of the 857 files removed from the pre-GitHub `bugs/` tree by [`d2c8d27826`](https://github.com/Macaulay2/M2/commit/d2c8d27826) and catalogued in [#36](https://github.com/Macaulay2/M2/issues/36). **The commentary below was written by Claude (Claude Opus 5, via Claude Code)**, not by @d-torrance, whose account posted it -- please weigh it accordingly.

### The original file, verbatim

```text
we should generate correct dependencies for d/*.o files on e/*.hpp files
```

### Where it stands today

Still hand-maintained, and the file's own comment is still in the tree: `d/Makefile.files.in` lists
the `e/*.hpp` dependencies literally and carries `should automate these dependencies`.

### Why it matters

A hand-written dependency list is wrong in the direction that hurts: when an engine header changes and
the list has not been updated, the affected `d/*.o` files are not rebuilt, and the result is a binary
built from mismatched declarations rather than a build failure. That is the classic source of "works
after `make clean`" reports.

### Notes for whoever picks this up

Both compilers can generate this: `-MMD -MP` writes a `.d` file per object that make can include, which
is how most of the rest of the tree would normally handle it. The wrinkle specific to `d/` is that the
sources are generated by `scc1` from `.d` files, so the dependency file has to be produced for the
generated C rather than for the `.d` source, and the two must not be confused with each other — the
directory and the dependency-file extension unfortunately share a name.

`open` · disposition `issue` · source of truth: [`bug-triage/catalog.tsv`](https://github.com/d-torrance/M2/blob/bug-triage/bug-triage/catalog.tsv)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with d/Makefile.files.in and its comment about automating dependencies, then trace how scc1 produces the generated C from the .d sources. Check how compiler-generated dependency files are handled elsewhere in the tree and how -MMD -MP would interact with the d/ directory and .d extension. Done means engine-header changes cause the affected d/*.o files to rebuild without a hand-maintained list.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.