Git Product home page Git Product logo

Comments (2)

gwynne avatar gwynne commented on June 9, 2024 1

For the record, the following patch fixes the swift-log build on Arch Linux (tested on Arch Linux 20231112.0.191179 (Docker tag archlinux:latest) using the swift-bin AUR package version 5.9.1-2):

diff --git a/Sources/Logging/Logging.swift b/Sources/Logging/Logging.swift
index 5910e73..23ef1ab 100644
--- a/Sources/Logging/Logging.swift
+++ b/Sources/Logging/Logging.swift
@@ -1388,7 +1388,9 @@ public struct StreamLogHandler: LogHandler {
         _ = strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", &localTime)
         #else
         var timestamp = time(nil)
-        let localTime = localtime(&timestamp)
+        guard let localTime = localtime(&timestamp) else {
+            return "<unknown>"
+        }
         strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime)
         #endif
         return buffer.withUnsafeBufferPointer {

I have opened a PR against the upstream swift-log repository with this fix, since it also fixes a potential NULL pointer dereference.

from toolbox.

gwynne avatar gwynne commented on June 9, 2024

At this time, the recommended way to build the toolbox is the same way the CI does, by just executing swift build -c release.

That being said, the problem is that Arch Linux is not currently supported as a host platform by Swift itself. This is not an issue with Vapor. As far as Linux goes, Swift currently officially supports Ubuntu (18.04 Bionic, 20.04 Focal, and 22.04 Jammy), CentOS 7, Amazon Linux 2, and RedHat UBI 9 (see https://www.swift.org/platform-support/ and https://www.swift.org/download/ for more details). Arch Linux, being a BSD-based distribution, is nominally supported by the compiler itself, but there are clearly issues in various packages, in this case swift-log. (This being said, I'll see if I can't get that particular failure fixed upstream, since there's no reason not to.)

from toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.