Skip to content

Commit fce44ae

Browse files
authored
Merge pull request #1493 from rintaro/5.10-disable-sandbox
[5.10] Update Options.swift for '-disable-sandbox'
2 parents eb63540 + 9ec9dbc commit fce44ae

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

+4
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ extension Driver {
295295
try commandLine.appendLast(.enableBuiltinModule, from: &parsedOptions)
296296
}
297297

298+
if isFrontendArgSupported(.disableSandbox) {
299+
try commandLine.appendLast(.disableSandbox, from: &parsedOptions)
300+
}
301+
298302
if !useClangIncludeTree, let workingDirectory = workingDirectory {
299303
// Add -Xcc -working-directory before any other -Xcc options to ensure it is
300304
// overridden by an explicit -Xcc -working-directory, although having a

Sources/SwiftOptions/Options.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ extension Option {
216216
public static let disableRequirementMachineLoopNormalization: Option = Option("-disable-requirement-machine-loop-normalization", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable stronger minimization algorithm, for debugging only")
217217
public static let disableRequirementMachineReuse: Option = Option("-disable-requirement-machine-reuse", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable re-use of requirement machines for minimization, for debugging only")
218218
public static let disableRoundTripDebugTypes: Option = Option("-disable-round-trip-debug-types", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disables verification of debug info mangling")
219+
public static let disableSandbox: Option = Option("-disable-sandbox", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Disable using the sandbox when executing subprocesses")
219220
public static let disableSilOwnershipVerifier: Option = Option("-disable-sil-ownership-verifier", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Do not verify ownership invariants during SIL Verification ")
220221
public static let disableSilPartialApply: Option = Option("-disable-sil-partial-apply", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable use of partial_apply in SIL generation")
221222
public static let disableSilPerfOptzns: Option = Option("-disable-sil-perf-optzns", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't run SIL performance optimization passes")
@@ -604,7 +605,7 @@ extension Option {
604605
public static let O: Option = Option("-O", .flag, attributes: [.frontend, .moduleInterface], helpText: "Compile with optimizations", group: .O)
605606
public static let o: Option = Option("-o", .joinedOrSeparate, attributes: [.frontend, .noInteractive, .autolinkExtract, .moduleWrap, .indent, .argumentIsPath, .cacheInvariant], metaVar: "<file>", helpText: "Write output to <file>")
606607
public static let packageDescriptionVersion: Option = Option("-package-description-version", .separate, attributes: [.helpHidden, .frontend, .moduleInterface], metaVar: "<vers>", helpText: "The version number to be applied on the input for the PackageDescription availability kind")
607-
public static let packageName: Option = Option("-package-name", .separate, attributes: [.frontend], helpText: "Name of the package the module belongs to")
608+
public static let packageName: Option = Option("-package-name", .separate, attributes: [.frontend, .moduleInterface], helpText: "Name of the package the module belongs to")
608609
public static let parallelScan: Option = Option("-parallel-scan", .flag, attributes: [.frontend, .noDriver], helpText: "Perform dependency scanning in-parallel.")
609610
public static let parseAsLibrary: Option = Option("-parse-as-library", .flag, attributes: [.frontend, .noInteractive], helpText: "Parse the input file(s) as libraries, not scripts")
610611
public static let parseSil: Option = Option("-parse-sil", .flag, attributes: [.frontend, .noInteractive], helpText: "Parse the input file as SIL code, not Swift source")
@@ -1021,6 +1022,7 @@ extension Option {
10211022
Option.disableRequirementMachineLoopNormalization,
10221023
Option.disableRequirementMachineReuse,
10231024
Option.disableRoundTripDebugTypes,
1025+
Option.disableSandbox,
10241026
Option.disableSilOwnershipVerifier,
10251027
Option.disableSilPartialApply,
10261028
Option.disableSilPerfOptzns,

0 commit comments

Comments
 (0)