Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"-disallow-use-new-driver" unnecessarily set #65461

Closed
thekief opened this issue Apr 27, 2023 · 7 comments
Closed

"-disallow-use-new-driver" unnecessarily set #65461

thekief opened this issue Apr 27, 2023 · 7 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@thekief
Copy link

thekief commented Apr 27, 2023

Description

Using the 5.8 release causes issues regarding the driver choice when experimenting with a toolchain build from f9611bc.

Previous to the release, everything seemed to work in regards to the driver selection. A most noteable detail is that we updated to the newest Xcode version around the same time, potentially being the root cause for this issue.

Trying to build a project with the Github version, yields following error:

Invalid manifest (compiled with: ["/Library/Developer/Toolchains/swift-LOCAL-2023-03-31-a.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/jh/vhc853k541j16db9k_0klvr40000gn/T/TemporaryDirectory.x5UWZ6/vfs.yaml", "-L", "/Applications/Xcode.app/Contents/PlugIns/IDESwiftPackageCore.framework/Versions/A/Frameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode.app/Contents/PlugIns/IDESwiftPackageCore.framework/Versions/A/Frameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos12.0", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk", "-swift-version", "5", "-I", "/Applications/Xcode.app/Contents/PlugIns/IDESwiftPackageCore.framework/Versions/A/Frameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk", "-package-description-version", "5.3.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/test/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/toast-swift.dia", "/Users/test/Library/Developer/Xcode/DerivedData/Test-bnglvjhsuerwyxamkapehgevsujg/SourcePackages/checkouts/toast-swift/Package.swift", "-disallow-use-new-driver", "-o", "/var/folders/jh/vhc853k541j16db9k_0klvr40000gn/T/TemporaryDirectory.sZSseI/toast-swift-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
<unknown>:0: error: unable to execute command: <unknown>

Steps to reproduce

  • build an iOS toolchain based on f9611bc
  • try to compile an iOS project

Expected behavior

The build succeeds

Environment

  • Swift compiler version info: 5.8-f9611bc8
  • Xcode version info: 14.3 (14E222b)
  • Deployment target: n/a
@thekief thekief added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Apr 27, 2023
@thekief thekief changed the title "-disallow-use-new-driver" set unnecessarily set "-disallow-use-new-driver" unnecessarily set Apr 27, 2023
@thekief
Copy link
Author

thekief commented Oct 9, 2023

The issue is not further reproducible.

@thekief thekief closed this as completed Oct 9, 2023
@dreampiggy
Copy link

dreampiggy commented Nov 13, 2023

Anyone faced this issue on Swift Package Manager and Xcode integration with custom xctoolchain ?
Swift 5.9 / Xcode 15.0

image

@thekief
Copy link
Author

thekief commented Nov 13, 2023

@dreampiggy , I had something similar going on right now with a new version too. In my case it resolved itself by cleaning the cache/project. You might also want to remove the local dependency cache that can be found here:

  • ~/Library/Caches/org.swift.swiftpm (might want to set it read-only as well)
  • ~/Library/Developer/Xcode/DerivedData/<PROJECT>_<ID>

@dreampiggy
Copy link

dreampiggy commented Nov 13, 2023

Does not help.

Tested toolchain:

https://download.swift.org/swift-5.9-branch/xcode/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-11-09-a/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-11-09-a-osx.pkg

You can use the open-source App: https://github.com/Dimillian/IceCubesApp

Run:

xcodebuild clean build -scheme IceCubesApp -configuration Release -destination generic/platform=iOS -toolchain org.swift.59202311091a

To test the behavior. This still fail

Some logs:

  Invalid manifest (compiled with: ["/Users/lizhuoli/Library/Developer/Toolchains/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-11-09-a.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/3j/f1xz341d5ys0srwhn7_bphhw0000gn/T/TemporaryDirectory.VU07kb/vfs.yaml", "-L", "/Applications/Xcode-15.0.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode-15.0.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos13.0", "-sdk", "/Applications/Xcode-15.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk", "-swift-version", "5", "-I", "/Applications/Xcode-15.0.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode-15.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk", "-package-description-version", "5.7.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/lizhuoli/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/network.dia", "/Users/lizhuoli/Documents/GitHub/IceCubesApp/Packages/Network/Package.swift", "-disallow-use-new-driver", "-o", "/var/folders/3j/f1xz341d5ys0srwhn7_bphhw0000gn/T/TemporaryDirectory.9G4Ac1/network-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
<unknown>:0: error: unable to execute command: <unknown>

@dreampiggy
Copy link

Need I submit a new issue to apple/swift ?

Isn't SwiftPM and Xcodebuild on Apple platform should be inside the compiler compatible test case ?

@thekief
Copy link
Author

thekief commented Nov 13, 2023

Alright, that makes it a somewhat uncharted territory for me. I also opened this issue swiftlang/swift-driver#1349 where @artemcm made some comments. Maybe he has some insight.

@krypt-lx
Copy link

krypt-lx commented Jan 9, 2024

I just got this exception warning trying to archive mac os cli app using bazel:
workspace compiles outside of bazel just fine

ERROR: /Users/krypt/repo/smart-kit/buildsystem/BUILD.bazel:4:8: Executing genrule //buildsystem:build_config_gen failed: (Exit 74): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_krypt/de9844abaa047ea4e0868fa95089f211/sandbox/darwin-sandbox/98/execroot/_main && \
  exec env - \
    PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin \
    TMPDIR=/var/folders/py/np32xt611ds3fb8l6djrc8s40000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_krypt/de9844abaa047ea4e0868fa95089f211/sandbox/darwin-sandbox/98/sandbox.sb /var/tmp/_bazel_krypt/install/ba45a1a358416fb2acebb17d65c986f3/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_krypt/de9844abaa047ea4e0868fa95089f211/sandbox/darwin-sandbox/98/stats.out' /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; cd ./buildsystem/cli-config-gen && xcodebuild -workspace cli-config-gen.xcworkspace -scheme cli-config-gen -configuration Release -archivePath "./archive.xcarchive" archive')
2024-01-09 16:33:46.380 xcodebuild[29741:449138] Writing error result bundle to /var/folders/py/np32xt611ds3fb8l6djrc8s40000gn/T/ResultBundle_2024-09-01_16-33-0046.xcresult
xcodebuild: error: Could not resolve package dependencies:
  Invalid manifest (compiled with: ["/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/py/np32xt611ds3fb8l6djrc8s40000gn/T/TemporaryDirectory.MlFks2/vfs.yaml", "-L", "/Applications/Xcode.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos13.0", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-swift-version", "5", "-I", "/Applications/Xcode.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-package-description-version", "5.9.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/krypt/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/deps.dia", "/var/tmp/_bazel_krypt/de9844abaa047ea4e0868fa95089f211/sandbox/darwin-sandbox/98/execroot/_main/buildsystem/cli-config-gen/deps/Package.swift", "-disallow-use-new-driver", "-o", "/var/folders/py/np32xt611ds3fb8l6djrc8s40000gn/T/TemporaryDirectory.ZqgUHM/deps-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'sandbox-exec: sandbox_apply: Operation not permitted

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace cli-config-gen.xcworkspace -scheme cli-config-gen -configuration Release -archivePath ./archive.xcarchive archive

User defaults from command line:
    IDEArchivePathOverride = /private/var/tmp/_bazel_krypt/de9844abaa047ea4e0868fa95089f211/sandbox/darwin-sandbox/98/execroot/_main/buildsystem/cli-config-gen/archive.xcarchive
    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'sandbox-exec: sandbox_apply: Operation not permitted

Target //buildsystem:build_config_gen failed to build
INFO: Elapsed time: 2.516s, Critical Path: 2.37s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

3 participants