Skip to content

Commit 5bd7817

Browse files
authored
Merge pull request #107 from veracode/release/1.0.3
Release/1.0.3
2 parents 5bf9722 + 26c36d7 commit 5bd7817

8 files changed

Lines changed: 68 additions & 61 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ jobs:
1010
build:
1111
runs-on: macos-latest
1212
steps:
13-
- uses: maxim-lobanov/setup-xcode@v1
14-
with:
15-
xcode-version: '16.4.0' # Specify the desired Xcode version
16-
1713
- uses: actions/checkout@v4
1814

1915
- name: 🔨 Build

PIF/Sources/PIFSupport/PIF.swift

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file contains derivative work from the Swift Open Source Project
44
//
5-
// Copyright (c) 2014-2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -483,35 +483,59 @@ public enum PIF {
483483
/// An Xcode target, representing a single entity to build.
484484
public final class Target: BaseTarget {
485485
public enum ProductType: String, Decodable {
486-
case appExtension = "com.apple.product-type.app-extension"
487-
case appExtensionMessages = "com.apple.product-type.app-extension.messages"
488-
case stickerPackExtension = "com.apple.product-type.app-extension.messages-sticker-pack"
489-
case application = "com.apple.product-type.application"
490-
case applicationMessages = "com.apple.product-type.application.messages"
491-
case appClip = "com.apple.product-type.application.on-demand-install-capable"
492-
case bundle = "com.apple.product-type.bundle"
493-
case externalTest = "com.apple.product-type.bundle.external-test"
494-
case ocUnitTest = "com.apple.product-type.bundle.ocunit-test"
495-
case uiTesting = "com.apple.product-type.bundle.ui-testing"
496-
case unitTest = "com.apple.product-type.bundle.unit-test"
497-
case extensionKitExtension = "com.apple.product-type.extensionkit-extension"
498-
case framework = "com.apple.product-type.framework"
499-
case staticFramework = "com.apple.product-type.framework.static"
500-
case instrumentsPackage = "com.apple.product-type.instruments-package"
501-
case kernelExtension = "com.apple.product-type.kernel-extension"
502-
case ioKitKernelExtension = "com.apple.product-type.kernel-extension.iokit"
503-
case dynamicLibrary = "com.apple.product-type.library.dynamic"
504-
case staticLibrary = "com.apple.product-type.library.static"
505-
case objectFile = "com.apple.product-type.objfile"
506-
case pluginKitPlugin = "com.apple.product-type.pluginkit-plugin"
486+
case appExtension = "product-type.app-extension"
487+
case appExtensionMessages = "product-type.app-extension.messages"
488+
case stickerPackExtension = "product-type.app-extension.messages-sticker-pack"
489+
case application = "product-type.application"
490+
case applicationMessages = "product-type.application.messages"
491+
case appClip = "product-type.application.on-demand-install-capable"
492+
case bundle = "product-type.bundle"
493+
case externalTest = "product-type.bundle.external-test"
494+
case ocUnitTest = "product-type.bundle.ocunit-test"
495+
case uiTesting = "product-type.bundle.ui-testing"
496+
case unitTest = "product-type.bundle.unit-test"
497+
case extensionKitExtension = "product-type.extensionkit-extension"
498+
case framework = "product-type.framework"
499+
case staticFramework = "product-type.framework.static"
500+
case instrumentsPackage = "product-type.instruments-package"
501+
case kernelExtension = "product-type.kernel-extension"
502+
case ioKitKernelExtension = "product-type.kernel-extension.iokit"
503+
case dynamicLibrary = "product-type.library.dynamic"
504+
case staticLibrary = "product-type.library.static"
505+
case objectFile = "product-type.objfile"
506+
case pluginKitPlugin = "product-type.pluginkit-plugin"
507507
case packageProduct = "packageProduct"
508-
case systemExtension = "com.apple.product-type.system-extension"
509-
case tool = "com.apple.product-type.tool"
510-
case hostBuild = "com.apple.product-type.tool.host-build"
511-
case xpcService = "com.apple.product-type.xpc-service"
512-
case watchApp2 = "com.apple.product-type.application.watchapp2"
513-
case watchApp2Container = "com.apple.product-type.application.watchapp2-container"
514-
case watchKit2Extension = "com.apple.product-type.watchkit2-extension"
508+
case systemExtension = "product-type.system-extension"
509+
case tool = "product-type.tool"
510+
case hostBuild = "product-type.tool.host-build"
511+
case xpcService = "product-type.xpc-service"
512+
case watchApp2 = "product-type.application.watchapp2"
513+
case watchApp2Container = "product-type.application.watchapp2-container"
514+
case watchKit2Extension = "product-type.watchkit2-extension"
515+
516+
public init(from decoder: Decoder) throws {
517+
let container = try decoder.singleValueContainer()
518+
let fullValue = try container.decode(String.self)
519+
520+
let normalizedValue: String
521+
if fullValue.hasPrefix("com.apple.") {
522+
normalizedValue = String(fullValue.dropFirst("com.apple.".count))
523+
} else if fullValue.hasPrefix("org.swift.") {
524+
normalizedValue = String(fullValue.dropFirst("org.swift.".count))
525+
} else {
526+
normalizedValue = fullValue
527+
}
528+
529+
guard let decodedCase = ProductType(rawValue: normalizedValue) else {
530+
throw DecodingError.dataCorrupted(
531+
DecodingError.Context(
532+
codingPath: decoder.codingPath,
533+
debugDescription: "Cannot initialize ProductType from invalid String value \(fullValue)"
534+
)
535+
)
536+
}
537+
self = decodedCase
538+
}
515539
}
516540

517541
public let productName: String

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let package = Package(
1616
dependencies: [
1717
// Dependencies declare other packages that this package depends on.
1818
// .package(url: /* package url */, from: "1.0.0"),
19-
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
19+
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.7.0"),
2020
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
2121
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
2222
.package(path: "PIF")

Sources/GenIR/GenIR.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ struct DeprecatedOptions: ParsableArguments {
1717

1818
struct DebuggingOptions: ParsableArguments {
1919

20-
@Option(help: ArgumentHelp("Path to PIF cache. Use this in place of what is in the Xcode build log", visibility: .hidden))
20+
@Option(help: ArgumentHelp("Path to PIF cache. Use this in place of what is in the Xcode build log", visibility: .default))
2121
var pifCachePath: URL?
2222

23-
@Option(help: ArgumentHelp("Specifiy a logging level. The --debug flag will override this", visibility: .hidden))
23+
@Option(help: ArgumentHelp("Specifiy a logging level. The --debug flag will override this", visibility: .default))
2424
var logLevel: LogLevelArgument?
2525

26-
@Flag(help: ArgumentHelp("If true, add captured debug data to the xcarchive.", visibility: .hidden))
26+
@Flag(help: ArgumentHelp("If true, add captured debug data to the xcarchive.", visibility: .default))
2727
var capture: Bool = false
2828
}
2929

@@ -53,6 +53,11 @@ struct DebuggingOptions: ParsableArguments {
5353
$ xcodebuild clean && xcodebuild build -project MyProject.xcodeproj \\\n\t\t-configuration Debug \\\n\t\t-scheme MyScheme \
5454
\\\n\t\tDEBUG_INFOMATION_FORMAT=dwarf-with-dsym \\\n\t\tENABLE_BITCODE=NO \\\n\t\t2>&1 | \(programName) - x.xcarchive
5555
56+
Optionally:
57+
If using precompilation on your Xcode build, it maybe necessary to turn that off to avoid module cache path errors.
58+
GCC_PRECOMPILE_PREFIX_HEADER=NO
59+
ENABLE_MODULE_PRECOMPILATION=NO
60+
5661
""",
5762
version: "v\(Versions.version)"
5863
)
@@ -85,7 +90,6 @@ struct DebuggingOptions: ParsableArguments {
8590
// Drop this in release 0.6 or greater
8691
@OptionGroup var deprecatedOptions: DeprecatedOptions
8792

88-
// These options are hidden and will not be shown in the help text
8993
@OptionGroup var debuggingOptions: DebuggingOptions
9094

9195
mutating func validate() throws {

Sources/GenIR/Versions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Created by Thomas Hedderwick on 12/09/2022.
66
//
77
// History:
8+
// 2026-nn-nn - 1.0.3 -- SSAST-15959, SSAST-16090 - product type org.swift...; help text update
89
// 2026-nn-nn - 1.0.2 -- SSAST-11722 don't fail on TargetDependency decode failure.
910
// 2026-01-08 - 1.0.1 -- Use info logging to allow user to monitor progress.
1011
// 2025-12-01 - 1.0.0 -- Don't chase through Dynamic Dependencies
@@ -16,5 +17,5 @@
1617
import Foundation
1718

1819
enum Versions {
19-
static let version = "1.0.2"
20+
static let version = "1.0.3"
2021
}

TestAssets/Umbrella/Umbrella.xcodeproj/project.pbxproj

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
CEC11E5C29F6BF4900F16A2E /* Sources */,
113113
CEC11E5D29F6BF4900F16A2E /* Frameworks */,
114114
CEC11E5E29F6BF4900F16A2E /* Resources */,
115-
CEC11E7329F6C29D00F16A2E /* ShellScript */,
116115
);
117116
buildRules = (
118117
);
@@ -189,23 +188,6 @@
189188
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
190189
showEnvVarsInLog = 0;
191190
};
192-
CEC11E7329F6C29D00F16A2E /* ShellScript */ = {
193-
isa = PBXShellScriptBuildPhase;
194-
buildActionMask = 8;
195-
files = (
196-
);
197-
inputFileListPaths = (
198-
);
199-
inputPaths = (
200-
);
201-
outputFileListPaths = (
202-
);
203-
outputPaths = (
204-
);
205-
runOnlyForDeploymentPostprocessing = 1;
206-
shellPath = /bin/sh;
207-
shellScript = "# All other frameworks are a by-product of building this framework, but this is just an empty framework, we don't need it so we can remove it.\nrm -rf \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.framework\"\nrm -rf \"$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME\"\n";
208-
};
209191
/* End PBXShellScriptBuildPhase section */
210192

211193
/* Begin PBXSourcesBuildPhase section */

Tests/GenIRTests/UmbrellaTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class UmbrellaTests: XCTestCase {
3434

3535
func testSkipInstallNo() throws {
3636
let context = TestContext()
37-
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO"])
37+
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "ENABLE_USER_SCRIPT_SANDBOXING=YES"])
3838

3939
let output = context.archive.appendingPathComponent("IR")
4040

@@ -63,7 +63,7 @@ final class UmbrellaTests: XCTestCase {
6363

6464
func testCustomDerivedDataAndSkipInstallNo() throws {
6565
let context = TestContext()
66-
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "-derivedDataPath", "_build"])
66+
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "ENABLE_USER_SCRIPT_SANDBOXING=YES", "-derivedDataPath", "_build"])
6767

6868
let output = context.archive.appendingPathComponent("IR")
6969

0 commit comments

Comments
 (0)