Skip to content

Commit

Permalink
Bypass SwiftLint using ACTION instead of CONFIGURATION (#24094)
Browse files Browse the repository at this point in the history
* Bypass SwiftLint using `ACTION` instead of `CONFIGURATION`

Co-authored-by: Olivier Halligon <olivier.halligon@automattic.com>

Follows up on
#23996 (comment)

Makes the logic more precise, given the error occurs when archiving.

* Add note about inconsistent failure when archiving locally
  • Loading branch information
mokagio authored Feb 19, 2025
1 parent ad30f1e commit 28c270c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Scripts/BuildPhases/SwiftLint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ if [ -n "${CI+x}" ]; then
exit 0
fi

# Only run on debug builds.
# For some reason, running when trying to archive, via CLI, results in a compilation failure.
# Do not run when archiving (ACTION = install).
#
# For some reason, running when trying to archive, via CLI, results in a compilation failure at times.
#
# fatal error: module 'WordPressSharedObjC' in AST file '/path/to/DerivedData/ModuleCache.noindex/EQUUY9BHSJ5N/WordPressSharedObjC-5G93B85NZ09I.pcm'
# (imported by AST file '/Users/gio/Developer/a8c/wpios/DerivedData/WordPress/Build/Intermediates.noindex/ArchiveIntermediates/WordPress Alpha/PrecompiledHeaders/WordPress-Bridging-Header-swift_1L0UBHDEION2G-clang_EQUUY9BHSJ5N.pch')
# is not defined in any loaded module map file;
# maybe you need to load '/Users/gio/Developer/a8c/wpios/DerivedData/WordPress/Build/Intermediates.noindex/ArchiveIntermediates/WordPress Alpha/IntermediateBuildFilesPath/GeneratedModuleMaps-iphoneos/WordPressSharedObjC.modulemap'?
if [ "${CONFIGURATION}" != "Debug" ]; then
echo 'Running in a build configuration other than Debug. Skipping SwiftLint in production builds.'
if [ "${ACTION}" == "install" ]; then
echo "info: Running during archival (detected ACTION = $ACTION). Skipping SwiftLint because of a build failure during archival we are yet to investigate."
exit 0
fi

Expand Down

0 comments on commit 28c270c

Please sign in to comment.