Skip to content

Commit 5ff4329

Browse files
authored
Merge pull request #1490 from rintaro/disable-sandbox
Update Options.swift for '-disable-sandbox'
2 parents 563d196 + 7039905 commit 5ff4329

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

+4
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ extension Driver {
319319
try commandLine.appendLast(.enableBuiltinModule, from: &parsedOptions)
320320
}
321321

322+
if isFrontendArgSupported(.disableSandbox) {
323+
try commandLine.appendLast(.disableSandbox, from: &parsedOptions)
324+
}
325+
322326
if !(isCachingEnabled && useClangIncludeTree), let workingDirectory = workingDirectory {
323327
// Add -Xcc -working-directory before any other -Xcc options to ensure it is
324328
// overridden by an explicit -Xcc -working-directory, although having a

Sources/SwiftOptions/Options.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ extension Option {
221221
public static let disableRequirementMachineLoopNormalization: Option = Option("-disable-requirement-machine-loop-normalization", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable stronger minimization algorithm, for debugging only")
222222
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")
223223
public static let disableRoundTripDebugTypes: Option = Option("-disable-round-trip-debug-types", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disables verification of debug info mangling")
224+
public static let disableSandbox: Option = Option("-disable-sandbox", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Disable using the sandbox when executing subprocesses")
224225
public static let disableSilOwnershipVerifier: Option = Option("-disable-sil-ownership-verifier", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Do not verify ownership invariants during SIL Verification ")
225226
public static let disableSilPartialApply: Option = Option("-disable-sil-partial-apply", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable use of partial_apply in SIL generation")
226227
public static let disableSilPerfOptzns: Option = Option("-disable-sil-perf-optzns", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Don't run SIL performance optimization passes")
@@ -456,13 +457,14 @@ extension Option {
456457
public static let experimentalHermeticSealAtLink: Option = Option("-experimental-hermetic-seal-at-link", .flag, attributes: [.helpHidden, .frontend], helpText: "Library code can assume that all clients are visible at linktime, and aggressively strip unused code")
457458
public static let experimentalLazyTypecheck: Option = Option("-experimental-lazy-typecheck", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Type-check lazily as needed to produce requested outputs")
458459
public static let experimentalOneWayClosureParams: Option = Option("-experimental-one-way-closure-params", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for one-way closure parameters")
459-
public static let experimentalPackageInterfaceLoad: Option = Option("-experimental-package-interface-load", .flag, attributes: [.helpHidden, .frontend, .moduleInterface], helpText: "Supports loading a module via .package.swiftinterface in the same package")
460+
public static let experimentalPackageInterfaceLoad: Option = Option("-experimental-package-interface-load", .flag, attributes: [.helpHidden, .frontend], helpText: "Enables loading a package interface if in the same package specified with package-name")
460461
public static let ExperimentalPerformanceAnnotations: Option = Option("-experimental-performance-annotations", .flag, attributes: [.helpHidden, .frontend], helpText: "Deprecated, has no effect")
461462
public static let platformCCallingConventionEQ: Option = Option("-experimental-platform-c-calling-convention=", .joined, alias: Option.platformCCallingConvention, attributes: [.helpHidden, .frontend, .noDriver])
462463
public static let platformCCallingConvention: Option = Option("-experimental-platform-c-calling-convention", .separate, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Which calling convention is used to perform non-swift calls. Defaults to llvm's standard C calling convention.")
463464
public static let experimentalPrintFullConvention: Option = Option("-experimental-print-full-convention", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "When emitting a module interface or SIL, emit additional @convention arguments, regardless of whether they were written in the source. Also requires -use-clang-function-types to be enabled.")
464465
public static let experimentalSkipAllFunctionBodies: Option = Option("-experimental-skip-all-function-bodies", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Skip type-checking function bodies and all SIL generation")
465466
public static let experimentalSkipNonExportableDecls: Option = Option("-experimental-skip-non-exportable-decls", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Skip decls that are not exported to clients")
467+
public static let experimentalSkipNonInlinableFunctionBodiesIsLazy: Option = Option("-experimental-skip-non-inlinable-function-bodies-is-lazy", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Infer lazy typechecking for -experimental-skip-non-inlinable-function-bodies")
466468
public static let experimentalSkipNonInlinableFunctionBodiesWithoutTypes: Option = Option("-experimental-skip-non-inlinable-function-bodies-without-types", .flag, attributes: [.helpHidden, .frontend], helpText: "Skip work on non-inlinable function bodies that do not declare nested types")
467469
public static let experimentalSkipNonInlinableFunctionBodies: Option = Option("-experimental-skip-non-inlinable-function-bodies", .flag, attributes: [.helpHidden, .frontend], helpText: "Skip type-checking and SIL generation for non-inlinable function bodies")
468470
public static let experimentalSpiImports: Option = Option("-experimental-spi-imports", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for SPI imports")
@@ -630,6 +632,7 @@ extension Option {
630632
public static let pchOutputDir: Option = Option("-pch-output-dir", .separate, attributes: [.helpHidden, .frontend, .argumentIsPath], helpText: "Directory to persist automatically created precompiled bridging headers")
631633
public static let placeholderDependencyModuleMap: Option = Option("-placeholder-dependency-module-map-file", .separate, attributes: [.frontend, .noDriver], metaVar: "<path>", helpText: "Specify a JSON file containing information of external Swift module dependencies")
632634
public static let playgroundHighPerformance: Option = Option("-playground-high-performance", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Omit instrumentation that has a high runtime performance impact")
635+
public static let playgroundOption: Option = Option("-playground-option", .separate, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Provide an option to the playground transform (if enabled)")
633636
public static let playground: Option = Option("-playground", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Apply the playground semantics and transformation")
634637
public static let pluginPath: Option = Option("-plugin-path", .separate, attributes: [.frontend, .argumentIsPath], helpText: "Add directory to the plugin search path", group: .pluginSearch)
635638
public static let prebuiltModuleCachePathEQ: Option = Option("-prebuilt-module-cache-path=", .joined, alias: Option.prebuiltModuleCachePath, attributes: [.frontend, .noDriver, .cacheInvariant])
@@ -1045,6 +1048,7 @@ extension Option {
10451048
Option.disableRequirementMachineLoopNormalization,
10461049
Option.disableRequirementMachineReuse,
10471050
Option.disableRoundTripDebugTypes,
1051+
Option.disableSandbox,
10481052
Option.disableSilOwnershipVerifier,
10491053
Option.disableSilPartialApply,
10501054
Option.disableSilPerfOptzns,
@@ -1287,6 +1291,7 @@ extension Option {
12871291
Option.experimentalPrintFullConvention,
12881292
Option.experimentalSkipAllFunctionBodies,
12891293
Option.experimentalSkipNonExportableDecls,
1294+
Option.experimentalSkipNonInlinableFunctionBodiesIsLazy,
12901295
Option.experimentalSkipNonInlinableFunctionBodiesWithoutTypes,
12911296
Option.experimentalSkipNonInlinableFunctionBodies,
12921297
Option.experimentalSpiImports,
@@ -1454,6 +1459,7 @@ extension Option {
14541459
Option.pchOutputDir,
14551460
Option.placeholderDependencyModuleMap,
14561461
Option.playgroundHighPerformance,
1462+
Option.playgroundOption,
14571463
Option.playground,
14581464
Option.pluginPath,
14591465
Option.prebuiltModuleCachePathEQ,

0 commit comments

Comments
 (0)