One of the first dependencies in an existing Makefile is downloading a nodejs archive and extracting it for later use as a tool.
I started a BUILD file in a "buildtools/" directory/package with the following
remote_file(
name = "node_archive",
out = "node-v8.11.3-linux-x64",
extract = True
)
Mostly to test out the "extract" option, but I think it's intended to extract just 1 file from the archive? Otherwise I wasn't sure what to use for "out = ". This was the error.
11:13:44.852 INFO: //buildtools:node_archive: Extracting...
11:13:45.324 INFO: //buildtools:node_archive: Collecting outputs...
11:13:45.358 INFO: Shutting down cache workers...
11:13:45.358 INFO: [7/7 tasks] //buildtools:node_archive: Build failed: Error moving outputs for target //buildtools:node_archive: Callback: lstat plz-out/tmp/buildtools/node_archive._build/lib: no such file or directory [0.5s]
So I was also trying the following
node_archive = remote_file(
out = "node-v8.11.3-linux-x64.tar.gz",
deps = [":node_archive"],
Attempting to use the node_archive out as a src in the extraction rule. But, the tar extraction doesn't look to be running at all
11:18:23.207 INFO: //:pleasings: Building...
11:18:23.225 INFO: //:pleasings: Collecting outputs...
11:18:23.237 DEBUG: Outputs for //:pleasings have changed
11:18:23.248 INFO: //:pleasings: Storing...
11:18:23.248 DEBUG: Storing //:pleasings: pleasings in dir cache...
11:18:23.248 INFO: [5/8 tasks] //:pleasings: Built [0.0s]
11:18:23.401 INFO: //buildtools:node_archive: Collecting outputs...
11:18:23.401 DEBUG: Outputs for //buildtools:node_archive have changed
11:18:23.418 INFO: //buildtools:node_archive: Storing...
11:18:23.418 DEBUG: Need to rebuild //buildtools:extract_node, //buildtools:node_archive has changed
11:18:23.418 DEBUG: Storing //buildtools:node_archive: node-v8.11.3-linux-x64.tar.gz in dir cache...
11:18:23.418 INFO: [5/8 tasks] //buildtools:node_archive: Built [0.8s]
11:18:23.418 DEBUG: Need to rebuild //buildtools:print_node, //buildtools:node_archive has changed
11:18:23.419 INFO: //buildtools:extract_node: Preparing...
11:18:23.419 INFO: //buildtools:print_node: Preparing...
11:18:23.419 INFO: Shutting down cache workers...
11:18:23.419 INFO: [8/8 tasks] //buildtools:extract_node: Nothing to do [0.0s]
11:18:23.419 DEBUG: Shut down all cache workers
11:18:23.419 INFO: [8/8 tasks] //buildtools:print_node: Nothing to do [0.0s]
Build finished; total time 870ms, incrementality 0.0%. Outputs:
//buildtools:extract_node:
//buildtools:node_archive:
plz-out/gen/buildtools/node-v8.11.3-linux-x64.tar.gz
$ find plz-out/ | grep node
plz-out/tmp/buildtools/print_node._build
plz-out/tmp/buildtools/extract_node._build
plz-out/gen/buildtools/node-v8.11.3-linux-x64.tar.gz
I am definitely missing something but am a bit stuck at this point.
If I can work through this i'd like to contribute back a guide to using plz for front end focused, incremental builds.