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

Doesn't compile on Ubuntu 24.04 #323

Open
Torgen opened this issue Nov 5, 2024 · 10 comments
Open

Doesn't compile on Ubuntu 24.04 #323

Torgen opened this issue Nov 5, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@Torgen
Copy link

Torgen commented Nov 5, 2024

You're pinned to a released version of ZIPFoundation, but their last release didn't unwrap an optional value in the else case of a #if os(macos) || ... check. They fixed it at head in weichsel/ZIPFoundation#323, but they haven't released a version with the fix.

@hendricksond
Copy link
Member

Which version of Swift are you using?

@Torgen
Copy link
Author

Torgen commented Nov 5, 2024

$ swift --version
Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-linux-gnu

@hendricksond
Copy link
Member

Can you give an example of the error? 5.10 is the correct version for this project, and it's building fine for me on debian 12, even after cleaning the project. There are a lot of warnings, but I'm not seeing any build errors, and the server runs fine.

@Torgen
Copy link
Author

Torgen commented Nov 5, 2024

/mnt/c/Users/Dan/Documents/GitHub/swiftarr/.build/checkouts/ZIPFoundation/Sources/ZIPFoundation/Archive+MemoryFile.swift:45:20: 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>')
            fseeko(result, 0, SEEK_END)
                   ^
/mnt/c/Users/Dan/Documents/GitHub/swiftarr/.build/checkouts/ZIPFoundation/Sources/ZIPFoundation/Archive+MemoryFile.swift:45:20: note: coalesce using '??' to provide a default when the optional value contains 'nil'
            fseeko(result, 0, SEEK_END)
                   ^
                          ?? <#default value#>
/mnt/c/Users/Dan/Documents/GitHub/swiftarr/.build/checkouts/ZIPFoundation/Sources/ZIPFoundation/Archive+MemoryFile.swift:45:20: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
            fseeko(result, 0, SEEK_END)
                   ^
                         !

@Torgen
Copy link
Author

Torgen commented Nov 5, 2024

It's possible it only affects Ubuntu 24.04, since that's also the version mentioned in weichsel/ZIPFoundation#320.

@hendricksond
Copy link
Member

We do use ubuntu on our server, but I can't remember which version... I'm not really sure it matters, though, since it's dockerized and using bitnami images.

@cohoe Do you have any suggestions, or a recommended ubuntu version?

@hendricksond
Copy link
Member

Not sure if there's anything we can really do to solve this until ZIPFoundation puts out a new version.

@challfry
Copy link
Collaborator

challfry commented Nov 5, 2024

For now, you can locally switch the package() method to package(url:revision:), so: .package(url: "https://github.com/weichsel/ZIPFoundation.git", revision: "fac78dfe5a886ad98e355ba98475b30b3753213a"). Assuming the fix is merged into head, that ought to get you up and compiling. I'd prefer to avoid merging in that sort of change to the package file (because no updates); here's hoping a new ZipFoundation release is forthcoming.

@Torgen Torgen changed the title Doesn't compile on Linux Doesn't compile on Ubuntu 24.04 Nov 6, 2024
@Torgen
Copy link
Author

Torgen commented Nov 6, 2024

As you may have been able to tell from the paths, my Ubuntu was on WSL, so I installed Debian as well and it seems to be working there.

@cohoe cohoe added the bug Something isn't working label Nov 6, 2024
@cohoe
Copy link
Member

cohoe commented Nov 6, 2024

I haven't dug into this at all yet. We've used Ubuntu 22.04 as the server OS and base container image for the last two sailings in 2023 and 2024 (20.04 before that in 2022, the debut of Swiftarr). When I did my developing on Fedora 37ish there was a glibc update that made certain Swift features not work natively on my laptop. It took a release or two of the OS or Swift or both for that to sort itself out. Meaning this happens, and it's unfortunate. Yay evolving tech.

I do not intend on spending cycles to upgrade us to Ubuntu 24.04 for the 2025 sailing unless there is a really compelling reason to do so. The next big jump in my mind will likely come along with Swift 6.

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

No branches or pull requests

4 participants