←back to thread

392 points mfiguiere | 5 comments | | HN request time: 1.044s | source
Show context
0cf8612b2e1e ◴[] No.35472006[source]
I like to use Makefiles for project automation. Does Buck make it straightforward to run phony target tasks? I have been considering transitioning to Justfiles, but Buck will obviously be getting significantly more expose and mindshare.
replies(1): >>35474327 #
1. ndmitchell ◴[] No.35474327[source]
There's no such thing as a phony target, but there is both `buck2 build` and `buck2 run` - each target can say how to run and how to build it separately. So you can have a shell script in the repo, write an export_file rule for it, then do `buck2 run :my_script` and it will run.
replies(1): >>35474633 #
2. 0cf8612b2e1e ◴[] No.35474633[source]
Nuts. Possible, but I would be fighting the platform a bit. Especially if I might want something like phony1 to depends on phony2.
replies(1): >>35476497 #
3. mkl ◴[] No.35476497[source]
What kinds of things are you using phony targets for?
replies(1): >>35477548 #
4. 0cf8612b2e1e ◴[] No.35477548{3}[source]
Everything I can. Building docs, checking health of prod, deploying to dev/prod (which has real+phony dependencies), starting the development web server with watchexec, running lint, tests, etc. Some of these might have real artifacts, but I typically have more phony than not.

Make has quite a few flaws, but it is near universal and a good location to centralize all required project work. Even if the entire task is defined in a shell script elsewhere. That being said, I have being looking longingly at just[0] which is not just concerned with compiling C, but has task automation builtin from the beginning.

[0] https://github.com/casey/just

replies(1): >>35478222 #
5. joshuamorton ◴[] No.35478222{4}[source]
Tests are done with `buck test`, linting and such can be done in bazel with aspects, not sure if buck can do the same, although I wouldn't recommend in most cases.

Deployment can be done with `run`, but again I wouldn't recommend it for deployment to real environments, starting a local devserver with run is a common pattern though.