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

Fedora 39 Build Issue #244

Closed
cohoe opened this issue Dec 28, 2023 · 1 comment · Fixed by #258
Closed

Fedora 39 Build Issue #244

cohoe opened this issue Dec 28, 2023 · 1 comment · Fixed by #258
Assignees
Labels
bug Something isn't working

Comments

@cohoe
Copy link
Member

cohoe commented Dec 28, 2023

Documenting this here in hope that someone (including the rubber ducks) can help me wrap my brain around what has happened here.

Commit at 896c47a was building just fine on Fedora 36 (glibc 2.35 + Swift 5.8.0). When the same commit is built on Fedora 39 (glibc 2.38 + Swift 5.8.0) it blows up with complication errors:

/home/grant/Projects/priv/swiftarr/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1392:64: error: value of optional type 'UnsafeMutablePointer<tm>?' must be unwrapped to a value of type 'UnsafeMutablePointer<tm>'
        strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime)

Description and "workaround" given in apple/swift-log#278 (JCWasmx86/swift-log@332ed31)
We then hit:

/home/grant/Projects/priv/swiftarr/.build/checkouts/swift-nio-ssl/Sources/NIOSSL/PosixPort.swift:42:64: error: cannot convert value of type '(UnsafeMutablePointer<FILE>) -> Int32' (aka '(UnsafeMutablePointer<_IO_FILE>) -> Int32') to specified type '@convention(c) (FILEPointer?) -> CInt' (aka '@convention(c) (Optional<UnsafeMutablePointer<_IO_FILE>>) -> Int32')
private let sysFclose: @convention(c) (FILEPointer?) -> CInt = fclose

Description and "workaround" given in apple/swift-nio-ssl#429
Finally we hit our own code issues:

/home/grant/Projects/priv/swiftarr/Sources/swiftarr/Image/Image.swift:359:18: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
...
/home/grant/Projects/priv/swiftarr/Sources/swiftarr/Image/Image.swift:393:18: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')

Both of which can be fixed by force-unwrapping the various file handles in the respective calls.

It seems that all of this stems from some kind of change in the way Swift interacts with newer (>2.35) glibc.

@cohoe cohoe added bug Something isn't working help wanted Extra attention is needed labels Dec 28, 2023
@cohoe cohoe self-assigned this Dec 28, 2023
cohoe added a commit to cohoe/swiftarr that referenced this issue Dec 28, 2023
cohoe added a commit that referenced this issue Jan 2, 2024
* #244 make it build on new glibc swift

* resolves #238, fixes alertwords

* #246 remove user alertword properly

* #246 disable new forum alertword notifications
cohoe added a commit to cohoe/swiftarr that referenced this issue Jan 30, 2024
@cohoe
Copy link
Member Author

cohoe commented Jan 30, 2024

These issues are fixed in latest swift-log and swift-nio-ssl which will get updated in my next PR.

@cohoe cohoe removed the help wanted Extra attention is needed label Jan 30, 2024
cohoe added a commit to cohoe/swiftarr that referenced this issue Feb 1, 2024
@cohoe cohoe closed this as completed in #258 Feb 1, 2024
cohoe added a commit that referenced this issue Feb 1, 2024
resolve #244, updates dependencies to be compatible with glibc 2.38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant