Commit e257e6b
authored
Fix redundant git clone and build delays in setup-workspace.sh (#4290)
* Fix redundant profile activation in setup-workspace.sh
Explicitly disable the `download-cn1-binaries` Maven profile during the `setup-workspace.sh` script execution. The script already provisions these binaries externally and passes the path via `-Dcn1.binaries`, but the profile was still activating and attempting a redundant `git clone` into the target directory, causing concurrency errors (exit code 128) and significant delays.
* Optimize setup-workspace.sh performance
Enhance build performance in `scripts/setup-workspace.sh` by:
1. Adding `-T 1C` to Maven commands to enable parallel builds using one thread per core.
2. Adding `-Dmaven.javadoc.skip=true` and `-Dmaven.source.skip=true` to skip time-consuming and unnecessary documentation and source artifact generation during the workspace setup phase.
3. Explicitly disabling the `download-cn1-binaries` profile (`-P !download-cn1-binaries`) to prevent redundant `git clone` operations that were causing "Result: 128" errors and delays.
* Optimize setup-workspace.sh and trigger CI on changes
1. Optimize `scripts/setup-workspace.sh` build time by enabling parallel builds (`-T 1C`) and skipping unnecessary Javadoc/Source generation.
2. Fix "Result: 128" git errors by explicitly disabling the `download-cn1-binaries` profile (`-P !download-cn1-binaries`).
3. Fix "Stubber.jar not found" build failure by explicitly passing `-Dcn1.binaries="$CN1_BINARIES"` to Maven commands, ensuring the external binaries are located.
4. Update `.github/workflows/pr.yml` to trigger the PR CI workflow when `scripts/setup-workspace.sh` is modified, enabling validation of these changes.
* Fix Android port build script and PR CI triggers
1. **Optimize `scripts/setup-workspace.sh`:**
* Enable parallel builds (`-T 1C`) for faster execution.
* Skip Javadoc and Source generation to save time.
* Explicitly disable the `download-cn1-binaries` profile (`-P !download-cn1-binaries`) to prevent redundant git operations and "Result: 128" errors.
* Pass `-Dcn1.binaries="$CN1_BINARIES"` to ensure the build can locate the pre-provisioned binaries.
2. **Fix `scripts/build-android-port.sh`:**
* Apply the same fixes as above (disable download profile, pass binaries path, optimization flags) to resolve "Result: 128" errors during the Android port build stage.
3. **Update `.github/workflows/pr.yml`:**
* Add `!scripts/setup-workspace.sh` to the `paths-ignore` list for both `push` and `pull_request` triggers. This ensures that changes to the setup script properly trigger the CI workflow for validation.
* Fix Android port build scripts and CI triggers
1. **Optimize `scripts/setup-workspace.sh`**:
* Enable parallel Maven builds (`-T 1C`) for faster execution.
* Skip Javadoc and source generation (`-Dmaven.javadoc.skip=true`, `-Dmaven.source.skip=true`).
* Disable the `download-cn1-binaries` profile (`-P !download-cn1-binaries`) to prevent redundant cloning and "Result: 128" errors.
* Explicitly pass `-Dcn1.binaries="$CN1_BINARIES"` to ensure binaries are located correctly.
2. **Fix `scripts/build-android-port.sh`**:
* Define `CN1_BINARIES` variable with fallback logic to prevent "unbound variable" errors.
* Apply the same Maven optimizations and profile deactivation as in `setup-workspace.sh` to resolve build failures.
3. **Update `.github/workflows/pr.yml`**:
* Add `!scripts/setup-workspace.sh` to `paths-ignore` for both `push` and `pull_request` triggers to ensure CI runs when this script is modified.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 7affe5a commit e257e6b
File tree
3 files changed
+17
-5
lines changed- .github/workflows
- scripts
3 files changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
122 | | - | |
| 129 | + | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
127 | | - | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
| 236 | + | |
| 237 | + | |
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | | - | |
| 243 | + | |
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
| |||
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
275 | | - | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
0 commit comments