Skip to content

Commit e333814

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
getdeps generate-github-actions: collapse per-dep build pyramid into single recursive step
Summary: Replace the per-dep `Build <dep>` / `Cache <dep>` step pyramid in generated GitHub Actions workflows with a single `Build <project> --recursive` step. With sccache enabled by default (since 6c880b17) we do not need per-dep builds. Changes: - `workflow_generator.py`: remove the per-dep deps loop, `has_same_repo_dep`, `no_deps_arg`, `free_up_disk_arg`, and `--use-build-cache` CLI flag; `final_build_cmd` now always passes `--recursive --src-dir=.` - `templates/workflow.yml.j2`: remove `cache_restore`/`cache_save` macros and the `for dep in deps` loop - `test/workflow_generator_test.py`: drop `use_build_cache` from base args - Golden fixtures and all OSS project workflows regenerated via `update-all-github-actions.sh` Reviewed By: bigfootjon Differential Revision: D106028158 fbshipit-source-id: e1d69616fe85553b0d00b6822988dac58bec9c3c
1 parent 43bfaf3 commit e333814

10 files changed

Lines changed: 11 additions & 604 deletions

File tree

.github/workflows/getdeps_linux.yml

Lines changed: 1 addition & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -157,148 +157,8 @@ jobs:
157157
if: ${{ steps.paths.outputs.fbthrift_SOURCE }}
158158
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fbthrift
159159

160-
- name: Build libaio
161-
if: ${{ steps.paths.outputs.libaio_SOURCE }}
162-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libaio
163-
164-
- name: Build ninja
165-
if: ${{ steps.paths.outputs.ninja_SOURCE }}
166-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests ninja
167-
168-
- name: Build cmake
169-
if: ${{ steps.paths.outputs.cmake_SOURCE }}
170-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests cmake
171-
172-
- name: Build benchmark
173-
if: ${{ steps.paths.outputs.benchmark_SOURCE }}
174-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests benchmark
175-
176-
- name: Build fmt
177-
if: ${{ steps.paths.outputs.fmt_SOURCE }}
178-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests fmt
179-
180-
- name: Build googletest
181-
if: ${{ steps.paths.outputs.googletest_SOURCE }}
182-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests googletest
183-
184-
- name: Build xxhash
185-
if: ${{ steps.paths.outputs.xxhash_SOURCE }}
186-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests xxhash
187-
188-
- name: Build zstd
189-
if: ${{ steps.paths.outputs.zstd_SOURCE }}
190-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests zstd
191-
192-
- name: Build zlib
193-
if: ${{ steps.paths.outputs.zlib_SOURCE }}
194-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests zlib
195-
196-
- name: Build boost
197-
if: ${{ steps.paths.outputs.boost_SOURCE }}
198-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests boost
199-
200-
- name: Build double-conversion
201-
if: ${{ steps.paths.outputs.double-conversion_SOURCE }}
202-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests double-conversion
203-
204-
- name: Build fast_float
205-
if: ${{ steps.paths.outputs.fast_float_SOURCE }}
206-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests fast_float
207-
208-
- name: Build gflags
209-
if: ${{ steps.paths.outputs.gflags_SOURCE }}
210-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests gflags
211-
212-
- name: Build glog
213-
if: ${{ steps.paths.outputs.glog_SOURCE }}
214-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests glog
215-
216-
- name: Build libdwarf
217-
if: ${{ steps.paths.outputs.libdwarf_SOURCE }}
218-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libdwarf
219-
220-
- name: Build libevent
221-
if: ${{ steps.paths.outputs.libevent_SOURCE }}
222-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libevent
223-
224-
- name: Build lz4
225-
if: ${{ steps.paths.outputs.lz4_SOURCE }}
226-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests lz4
227-
228-
- name: Build openssl
229-
if: ${{ steps.paths.outputs.openssl_SOURCE }}
230-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests openssl
231-
232-
- name: Build snappy
233-
if: ${{ steps.paths.outputs.snappy_SOURCE }}
234-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests snappy
235-
236-
- name: Build magic_enum
237-
if: ${{ steps.paths.outputs.magic_enum_SOURCE }}
238-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests magic_enum
239-
240-
- name: Build sparsemap
241-
if: ${{ steps.paths.outputs.sparsemap_SOURCE }}
242-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests sparsemap
243-
244-
- name: Build liboqs
245-
if: ${{ steps.paths.outputs.liboqs_SOURCE }}
246-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests liboqs
247-
248-
- name: Build autoconf
249-
if: ${{ steps.paths.outputs.autoconf_SOURCE }}
250-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests autoconf
251-
252-
- name: Build automake
253-
if: ${{ steps.paths.outputs.automake_SOURCE }}
254-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests automake
255-
256-
- name: Build libtool
257-
if: ${{ steps.paths.outputs.libtool_SOURCE }}
258-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libtool
259-
260-
- name: Build numa
261-
if: ${{ steps.paths.outputs.numa_SOURCE }}
262-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests numa
263-
264-
- name: Build libiberty
265-
if: ${{ steps.paths.outputs.libiberty_SOURCE }}
266-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libiberty
267-
268-
- name: Build libsodium
269-
if: ${{ steps.paths.outputs.libsodium_SOURCE }}
270-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libsodium
271-
272-
- name: Build libunwind
273-
if: ${{ steps.paths.outputs.libunwind_SOURCE }}
274-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests libunwind
275-
276-
- name: Build xz
277-
if: ${{ steps.paths.outputs.xz_SOURCE }}
278-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests xz
279-
280-
- name: Build folly
281-
if: ${{ steps.paths.outputs.folly_SOURCE }}
282-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests folly
283-
284-
- name: Build fizz
285-
if: ${{ steps.paths.outputs.fizz_SOURCE }}
286-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests fizz
287-
288-
- name: Build wangle
289-
if: ${{ steps.paths.outputs.wangle_SOURCE }}
290-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests wangle
291-
292-
- name: Build mvfst
293-
if: ${{ steps.paths.outputs.mvfst_SOURCE }}
294-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests mvfst
295-
296-
- name: Build fbthrift
297-
if: ${{ steps.paths.outputs.fbthrift_SOURCE }}
298-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --free-up-disk --no-tests fbthrift
299-
300160
- name: Build cachelib
301-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --src-dir=. cachelib --project-install-prefix cachelib:/usr/local
161+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --recursive --src-dir=. cachelib --project-install-prefix cachelib:/usr/local
302162

303163
- name: Show sccache stats
304164
if: always()

build/fbcode_builder/getdeps/templates/workflow.yml.j2

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@ Jinja delimiters here are doubled angle brackets (variables) and angle-percent
55
The Jinja env is configured trim_blocks + lstrip_blocks, so block tags on
66
their own line consume the whole line cleanly without `-` stripping markers.
77
#>
8-
<% macro cache_restore(name) %>
9-
- name: Restore <<name>> from cache
10-
id: restore_<<name>>
11-
if: ${{ steps.paths.outputs.<<name>>_SOURCE }}
12-
uses: actions/cache/restore@v4
13-
with:
14-
path: ${{ steps.paths.outputs.<<name>>_INSTALL }}
15-
key: ${{ steps.paths.outputs.<<name>>_CACHE_KEY }}-install
16-
<%- endmacro %>
17-
18-
<% macro cache_save(name) %>
19-
- name: Save <<name>> to cache
20-
uses: actions/cache/save@v4
21-
if: ${{ steps.paths.outputs.<<name>>_SOURCE && ! steps.restore_<<name>>.outputs.cache-hit }}
22-
with:
23-
path: ${{ steps.paths.outputs.<<name>>_INSTALL }}
24-
key: ${{ steps.paths.outputs.<<name>>_CACHE_KEY }}-install
25-
<%- endmacro %>
26-
278
# This file was <<"@" + "generated">> by getdeps.py
289

2910
name: <<job_name>>
@@ -146,21 +127,6 @@ jobs:
146127
<% endfor %>
147128
<% endif %>
148129

149-
<# Per-dep build (with optional cache restore + save) #>
150-
<% for dep in deps %>
151-
<% if dep.use_cache %>
152-
<<cache_restore(dep.name)>>
153-
<% endif %>
154-
- name: Build <<dep.name>>
155-
<% if dep.if_clause %>
156-
if: ${{ <<dep.if_clause>> }}
157-
<% endif %>
158-
run: <<dep.build_cmd>>
159-
<% if dep.use_cache %>
160-
<<cache_save(dep.name)>>
161-
<% endif %>
162-
163-
<% endfor %>
164130
<% if free_up_disk_before_build and not is_windows %>
165131
- name: Free up disk space before build
166132
run: |

build/fbcode_builder/getdeps/test/fixtures/expected/folly_shared_libs/getdeps_shared-libs_linux.yml

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -124,104 +124,8 @@ jobs:
124124
if: ${{ steps.paths.outputs.xz_SOURCE }}
125125
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xz
126126

127-
- name: Build boost
128-
if: ${{ steps.paths.outputs.boost_SOURCE }}
129-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests boost
130-
131-
- name: Build libaio
132-
if: ${{ steps.paths.outputs.libaio_SOURCE }}
133-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libaio
134-
135-
- name: Build openssl
136-
if: ${{ steps.paths.outputs.openssl_SOURCE }}
137-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests openssl
138-
139-
- name: Build ninja
140-
if: ${{ steps.paths.outputs.ninja_SOURCE }}
141-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests ninja
142-
143-
- name: Build cmake
144-
if: ${{ steps.paths.outputs.cmake_SOURCE }}
145-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests cmake
146-
147-
- name: Build double-conversion
148-
if: ${{ steps.paths.outputs.double-conversion_SOURCE }}
149-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests double-conversion
150-
151-
- name: Build fast_float
152-
if: ${{ steps.paths.outputs.fast_float_SOURCE }}
153-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests fast_float
154-
155-
- name: Build fmt
156-
if: ${{ steps.paths.outputs.fmt_SOURCE }}
157-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests fmt
158-
159-
- name: Build gflags
160-
if: ${{ steps.paths.outputs.gflags_SOURCE }}
161-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests gflags
162-
163-
- name: Build glog
164-
if: ${{ steps.paths.outputs.glog_SOURCE }}
165-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests glog
166-
167-
- name: Build googletest
168-
if: ${{ steps.paths.outputs.googletest_SOURCE }}
169-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests googletest
170-
171-
- name: Build libdwarf
172-
if: ${{ steps.paths.outputs.libdwarf_SOURCE }}
173-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libdwarf
174-
175-
- name: Build libevent
176-
if: ${{ steps.paths.outputs.libevent_SOURCE }}
177-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libevent
178-
179-
- name: Build zlib
180-
if: ${{ steps.paths.outputs.zlib_SOURCE }}
181-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests zlib
182-
183-
- name: Build lz4
184-
if: ${{ steps.paths.outputs.lz4_SOURCE }}
185-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests lz4
186-
187-
- name: Build snappy
188-
if: ${{ steps.paths.outputs.snappy_SOURCE }}
189-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests snappy
190-
191-
- name: Build zstd
192-
if: ${{ steps.paths.outputs.zstd_SOURCE }}
193-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests zstd
194-
195-
- name: Build autoconf
196-
if: ${{ steps.paths.outputs.autoconf_SOURCE }}
197-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests autoconf
198-
199-
- name: Build automake
200-
if: ${{ steps.paths.outputs.automake_SOURCE }}
201-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests automake
202-
203-
- name: Build libtool
204-
if: ${{ steps.paths.outputs.libtool_SOURCE }}
205-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libtool
206-
207-
- name: Build libiberty
208-
if: ${{ steps.paths.outputs.libiberty_SOURCE }}
209-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libiberty
210-
211-
- name: Build libsodium
212-
if: ${{ steps.paths.outputs.libsodium_SOURCE }}
213-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libsodium
214-
215-
- name: Build libunwind
216-
if: ${{ steps.paths.outputs.libunwind_SOURCE }}
217-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests libunwind
218-
219-
- name: Build xz
220-
if: ${{ steps.paths.outputs.xz_SOURCE }}
221-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --free-up-disk --no-tests xz
222-
223127
- name: Build folly
224-
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --src-dir=. folly --project-install-prefix folly:/usr/local
128+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --build-type RelWithDebInfo --shared-lib --recursive --src-dir=. folly --project-install-prefix folly:/usr/local
225129

226130
- name: Show sccache stats
227131
if: always()

0 commit comments

Comments
 (0)