question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Makefile Output & Debugging

See original GitHub issue

First, thanks a ton for the new 0.51.0 Makefile support! This is going to save a bunch of time on Rails & Lambda build times since we typically have to build CSS/JS assets using non-deployment gems. Hence having full control allows our CI/CD (GitHub Actions) to cache different dev/deploy gem vendor directories.

That said, I am new to Makefiles and found their adoption to be a little difficult. I found myself wanting to echo parts of the build but nothing was showing during sam build. Is there something this library can do (or myself) when using a Makefile to see what is happing in my own files?

I also realize this just might be having to learn make. But thought I would ask first. Thanks again!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
sriram-mvcommented, May 26, 2020

As @smacintyre pointed out, yeah the intention behind the usage of the makefile was so that users can use it to adjust everything as required, before being picked up by sam build.

However, that being said. Streaming the output of triggering the make - build target, seems reasonable.

2reactions
smacintyrecommented, May 24, 2020

When creating your Makefile it will be easier to initially run make directly while you get things setup. That way you can echo things and see what is going on. Also, keep in mind that make is going to be called for each function with Metadata: makefile set.

You can run the build for a function by running following. Where FUNCTION is the logical name of your function and PATH is where you want the files to be deposited for your testing… Then you can see the full output of your function including any echos. By default commands are executed with /bin/sh.

make build-[FUNCTION] ARTIFACTS_DIR=[PATH]

Make is very flexible and worth learning. A quick tutorial is at http://makefiletutorial.com/ . Also check out the GNU Make Standard Library. Once you have it setup you shouldn’t have to modify to much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Makefiles - O'Reilly
The first test I perform on a new makefile target is to invoke make with the --just- print (-n) option. This causes make...
Read more >
Debugging Makefiles - The Turing Way
Finally, you can also debug the Makefile by running Make with the debug flag: make -d . This will print all the rules...
Read more >
Tool for debugging makefiles - Stack Overflow
The debugging information says which files are being considered for remaking, which file-times are being compared and with what results, which files actually ......
Read more >
Debugging Makefiles (1) - Reliable Embedded Systems
The simplest way to find out the value of a macro in a Makefile is to use the $(warning...) function. When GNU Make...
Read more >
New Makefile Output & Debugging #2006 - aws/aws-sam-cli
When creating your Makefile it will be easier to initially run make directly while you get things setup. That way you can echo...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found