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

Site Build error with Xcode Version 16.0 beta 6 (16A5230g) #110

Open
ppporch opened this issue Aug 25, 2024 · 1 comment
Open

Site Build error with Xcode Version 16.0 beta 6 (16A5230g) #110

ppporch opened this issue Aug 25, 2024 · 1 comment

Comments

@ppporch
Copy link

ppporch commented Aug 25, 2024

I started going through your ignite livestream and deleted the original ignite clone from git and cloned it again. I built ignite without and issues and installed it. I created a new site with the ignite new ExampleSite command without issues. I opened Xcode per the instructions and set my Mac as the destination. I tried a build but got the following...

struct ExampleSite: Site {
var name = "Hello World"
var titleSuffix = " – My Awesome Site"
var url = URL("https://www.example.com")
var builtInIconsEnabled = true

var author = "John Appleseed"

var homePage = Home()
var theme = MyTheme()

}

but the line var url = URL("https://www.example.com") is flagged with the following error. Ambiguous use of 'init(_:)'

I then tried the build in the command line with ignite build in the ExampleSite directory and here are the errors I got.

[257/260] Compiling Ignite resource_bundle_accessor.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[258/264] Compiling IgniteStarter Home.swift
[259/264] Compiling IgniteStarter MainTheme.swift
[260/264] Emitting module IgniteStarter
/Users/ppporch/Documents/Hacking with Swift/BrushAndBark/Sources/Site.swift:20:15: error: ambiguous use of 'init(:)'
18 | var name = "Hello World"
19 | var titleSuffix = " – My Awesome Site"
20 | var url = URL("https://www.example.com")
| `- error: ambiguous use of 'init(
:)'
21 | var builtInIconsEnabled = true
22 |

Foundation.URL:8:12: note: found this candidate in module 'Foundation'
6 | @available(tvOS, introduced: 14.0, deprecated: 16.0, renamed: "init(filePath:)")
7 | @available(visionOS, unavailable, renamed: "init(filePath:)")
8 | public init?(_ path: FilePath)
| `- note: found this candidate in module 'Foundation'
9 | @available(macOS, introduced: 11.0, deprecated: 13.0, message: "Use init?(filePath:directoryHint:) instead")
10 | @available(iOS, introduced: 14.0, deprecated: 16.0, message: "Use init?(filePath:directoryHint:) instead")

/Users/ppporch/Documents/Hacking with Swift/BrushAndBark/.build/checkouts/Ignite/Sources/Ignite/Extensions/URL-Unwrapped.swift:13:12: note: found this candidate in module 'Ignite'
11 | /// Creates URLs from static strings, which will only fail if you have made
12 | /// a significant typing error.
13 | public init(_ string: StaticString) {
| - note: found this candidate in module 'Ignite' 14 | if let created = URL(string: String(describing: string)) { 15 | self = created [261/264] Compiling IgniteStarter Site.swift /Users/ppporch/Documents/Hacking with Swift/BrushAndBark/Sources/Site.swift:20:15: error: ambiguous use of 'init(_:)' 18 | var name = "Hello World" 19 | var titleSuffix = " – My Awesome Site" 20 | var url = URL("https://www.example.com") | - error: ambiguous use of 'init(_:)'
21 | var builtInIconsEnabled = true
22 |

Foundation.URL:8:12: note: found this candidate in module 'Foundation'
6 | @available(tvOS, introduced: 14.0, deprecated: 16.0, renamed: "init(filePath:)")
7 | @available(visionOS, unavailable, renamed: "init(filePath:)")
8 | public init?(_ path: FilePath)
| `- note: found this candidate in module 'Foundation'
9 | @available(macOS, introduced: 11.0, deprecated: 13.0, message: "Use init?(filePath:directoryHint:) instead")
10 | @available(iOS, introduced: 14.0, deprecated: 16.0, message: "Use init?(filePath:directoryHint:) instead")

/Users/ppporch/Documents/Hacking with Swift/BrushAndBark/.build/checkouts/Ignite/Sources/Ignite/Extensions/URL-Unwrapped.swift:13:12: note: found this candidate in module 'Ignite'
11 | /// Creates URLs from static strings, which will only fail if you have made
12 | /// a significant typing error.
13 | public init(_ string: StaticString) {
| `- note: found this candidate in module 'Ignite'
14 | if let created = URL(string: String(describing: string)) {
15 | self = created

❌ Failed to build.

I know this could be just from the beta 6 of Xcode I am using but wondered if there are changes that will be needed in the future to accomidate Xcode 16.

@vdhamer
Copy link
Contributor

vdhamer commented Aug 26, 2024

See #81
Workaround:
var url: URL = URL(static: "https://www.example.com")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants