28174, "e-kayrakli", "Generalizing Mason's prerequisite support", "2025-12-10T15:46:28Z"
Various mason fixes and improvements to prepare for a Parquet package by e-kayrakli · Pull Request #27857 · chapel-lang/chapel · GitHub added the "prerequisite" support to mason to enable building code in other languages to interoperate with the final Chapel module. In that PR, @jabraham17 noted that we should allow more ways than make to build such projects. I agree with that. My initial solution was a bit tailored for my specific use case.
Let's discuss ways in which we can support building code from other languages. Under that issue we discussed that:
- there should be a way to support prerequisites that "just works"
- Indeed, the PR does that -- it looks for a
prereqsdirectory, in which it expects to find all the prereq code bases that needs to be compiled individually. Then, it runsmakeon each of the directories, while also expecting aprintchplflagsmake target to help construct thechplcommand. I think that's a decent default, but I am not too attached to it.
- Indeed, the PR does that -- it looks for a
- there should be a way in which more specific build instructions can be provided to
mason. Here's what Jade had in mind for that:
[prereqs.myPrereq]
build = ...
printchplflags = ....
At a high level, this looks nice to me, though we need to figure out what ...s are supposed to be. An immediate thought is that they are shell commands that should be run at <project root>/prereqs/myPrereq, but we can consider other alternatives. In that scenario, the default that "just works" would be notionally:
[prereqs.myPrereq]
build = make
printchplflags = make printchplflags