Comments (4)
Thanks @itsleeowen! I like what you're trying to do here--I'll try it myself. I often get people started by providing example makefiles.
What does setting SHELL
do in this example? Is this required?
from entr.
It's a way to specify which shell make should use. I don't believe bin/bash is required for this example, I believe make defaults to /bin/sh.
https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
I'm using this for local development with a suite of docker services, specifically for a frontend service which runs four separate tasks based on file type and writes to a build volume... transpile typescript, copy media assets, bundle css, and copy html templates.
Running the tasks separately with entr via make -j
results in a faster build time for the developer actively working on the project, rather than repeating each of the 4 tasks whenever any of the file types is changed. Performance is still great, CPU usage remains low.
go-task is another where you can pair file patterns with a single task among a group, using yaml for configuration:
https://github.com/go-task/examples/blob/master/go-web-app/Taskfile.yml
from entr.
Based only on the documentation for make, parallel behavior is not very easy to understand. The first problem I ran into is that each implementation of Make has it's own system for identifying parallel work and preventing fork bombs when -j
is used. This is from the OpenBSD's make(1) man page:
In parallel mode, -j n only limits the number of direct children of make.
During recursive invocations, each level may multiply the total number of
processes by n. However, make includes some heuristics to try to prevent
catastrophic behavior: if a command is marked as expensive, or preceded by
‘+’, or seems to invoke a program that looks sufficiently like ‘make’, make
will assume recursive invocation, and not start any new process until said
command has finished running. Thus the number of processes run directly or
indirectly by make will increase linearly with each level of recursion instead
of exponentially.
So the heuristics for this version of BSD make prevents this example from running in parallel. gmake also has some oddities, for example I kept observing this warning
gmake[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
My intuition so far is that build tools designed from the start to work effectively in parallel like go-task
or ninja
will be better.
from entr.
👍 Sounds good, it's working fine on my end so far.
from entr.
Related Issues (20)
- entr: No regular files to watch in ruby HOT 8
- Alternatives to SIGTERM with -r HOT 11
- Use strlcpy with >=glibc-2.38 HOT 9
- Missing entr command on website HOT 1
- Ability to kill the process after a timeout if it fails to stop gracefully HOT 7
- `/_` marker and quotes. HOT 2
- doesn't this force the RLIMIT_NOFILES to be exactly 65536? HOT 11
- Feature request: provide a way to debounce triggers HOT 8
- fatal error: sys/sysctl.h: No such file or directory HOT 3
- `entr` apparently don't work when called from a Makefile task HOT 3
- Only the first event is handled when using entr to watch the script that runs entr HOT 9
- $0 isn't populated on macOS when using -s HOT 5
- Git tags are not signed HOT 4
- Feature request: print blank line between runs with -b HOT 2
- Feature request: suppress exit status message with -q HOT 7
- 'entr: setrlimit cannot set rlim_cur to 61440: Invalid argument' on macOS HOT 23
- Is there an easy way to print out the time that `entr` ran the last command? HOT 4
- Update link to doc page HOT 3
- Include workspaces HOT 3
- Commands run twice with the -d flag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entr.