Re:Build faster with Buck2: Our open source build system
by ndmitchell on Thursday April 06, 2023 @04:58PM
(#35474327)
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.
[ Parent
| on HN ]
Re:Build faster with Buck2: Our open source build system
by 0cf8612b2e1e on Thursday April 06, 2023 @05:19PM
(#35474633)
Nuts. Possible, but I would be fighting the platform a bit. Especially if I might want something like phony1 to depends on phony2.
Re:Build faster with Buck2: Our open source build system
by mkl on Thursday April 06, 2023 @08:30PM
(#35476497)
What kinds of things are you using phony targets for?
Re:Build faster with Buck2: Our open source build system
by 0cf8612b2e1e on Thursday April 06, 2023 @11:08PM
(#35477548)
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.
Re:Build faster with Buck2: Our open source build system
by joshuamorton on Friday April 07, 2023 @01:04AM
(#35478222)
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.