Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace every subprocess created #155

Open
rolfbjarne opened this issue Sep 12, 2024 · 1 comment
Open

Trace every subprocess created #155

rolfbjarne opened this issue Sep 12, 2024 · 1 comment

Comments

@rolfbjarne
Copy link

I have a project with fairly large makefiles, and they tend to grow slower over time (even when nothing needs to be done).

Most of this slowdown is because there are many variables instantiated by executing subprocess:

ANSWER=$(shell echo 1 + 41 | bc)

The fix is typically easy (find another way to do it, or at least assign using :=), but the problem is finding all these (and measuring the impact of each, since 100 echos can be much faster than a single bc)

Unfortunately neither make nor remake seem to provide a way to trace this.

$ cat Makefile
ANSWER=$(shell echo 1 + 41 | bc)
all:
	@echo ANSWER=$(ANSWER)%

$ make --debug=all | grep bc
[no output]

$ remake --trace=full | grep bc
[no output]

So it would be nice if remake provided a way to trace every subprocess created by make (and maybe even how long it took to execute).

@rocky
Copy link
Collaborator

rocky commented Sep 12, 2024

Both GNU make and remake are open source. Feel free to address and put in a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants