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

Does not seem to work in linux environment #288

Open
neilt opened this issue Jun 17, 2019 · 1 comment
Open

Does not seem to work in linux environment #288

neilt opened this issue Jun 17, 2019 · 1 comment

Comments

@neilt
Copy link

neilt commented Jun 17, 2019

Tried to use XCGLogger in Fedora 30 with swift-lang.

Get the following error:

#include "/home/admin/rss2pg/.build/checkouts/XCGLogger/Sources/ObjcExceptionBridging/include/ObjcExceptionBridging.h"
         ^
/home/admin/rss2pg/.build/checkouts/XCGLogger/Sources/ObjcExceptionBridging/include/ObjcExceptionBridging.h:10:9: error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
        ^
/home/admin/rss2pg/.build/checkouts/XCGLogger/Sources/XCGLogger/Misc/HelperFunctions.swift:11:8: error: could not build C module 'ObjcExceptionBridging'
import ObjcExceptionBridging
       ^

XCGLogger is being installed using:

 .package(url: "https://github.com/DaveWoodCom/XCGLogger.git", from: "7.0.0"),
  1. Is there a way to install using the package manager without ObjcExceptionBridging since linux does not have the Objc runtime?

  2. Any chance of making XCGLogger work with linux using #if statements? Maybe #if !os(linux) around the ObjcExceptionBridging stuff.

  3. Maybe there are other reasons this will never work and it is futile to try? If so, what reasons?

BTW
This is on

Swift version 5.0.1 (swift-5.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu
@phimage
Copy link

phimage commented Sep 3, 2019

ObjcExceptionBridging stuff aim to catch obj runtime errors

func _try(_ tryClosure: @escaping () -> (), catch catchClosure: @escaping (_ exception: NSException) -> (), finally finallyClosure: (() -> ())? = nil) {

inside FileDestination

so @neilt you can PR on HelperFunctions.swift
#if !os(Linux) #endif on import and on the two _try_objc call

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