ROOT fallback #11

Open
opened 2026-05-22 04:01:10 +00:00 by jaynuine · 1 comment
Owner

if undefined, potentially because the makefile is being run in isolation, the ROOT variable will not be defined, and therefore resolving the template location will not be possible
in such cases, one should manually define the relative path from each unit to the root as a fallback, perhaps simply as

ROOT ?= ../../

it would be in poor taste to rely on a function to resolve the root by working one's way up through file structure until some marker were found since this would need to be duplicated to each node, when the entire point is to minimise redundancy

perhaps git has a command for this ? to locate the first .git directory

if undefined, potentially because the makefile is being run in isolation, the ROOT variable will not be defined, and therefore resolving the template location will not be possible in such cases, one should manually define the relative path from each unit to the root as a fallback, perhaps simply as ```make ROOT ?= ../../ ``` it would be in poor taste to rely on a function to resolve the root by working one's way up through file structure until some marker were found since this would need to be duplicated to each node, when the entire point is to minimise redundancy perhaps git has a command for this ? to locate the first .git directory
Author
Owner
git rev-parse --show-toplevel

may be exactly what we need

this would be an acceptable level of moisture in having to duplicate this short and concise a command to every unit

```sh git rev-parse --show-toplevel ``` may be exactly what we need this would be an acceptable level of moisture in having to duplicate this short and concise a command to every unit
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaynuine/weegie#11
No description provided.