Using iconv for Utf8Converter on Apple device - #15599
Conversation
| DBDB57DB2603211A004F16BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | ||
| DBDB588A2609B18F004F16BE /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Resources; path = OnnxruntimeModuleTest/Resources; sourceTree = "<group>"; }; | ||
| DBDB58AF262A92D6004F16BE /* OnnxruntimeModuleTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = OnnxruntimeModuleTest.mm; sourceTree = "<group>"; }; | ||
| E3D7A60D29F8D87D00FF5265 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; |
There was a problem hiding this comment.
Where can we find the license of this file: Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libiconv.tbd ?
Would it be bad to hardcode a XCode version here?
There was a problem hiding this comment.
This file was generated from XCode GUI Application. I have to link the library for these 2 xcode projects from the Xcode GUI. The library is part of Apple SDK.
I can try to remove the 13.3 from the MacOSX13.3.sdk, and it should works.
There was a problem hiding this comment.
The library must come with some headers files. One of them should be iconv.h. Could you please open the file and inspect its license?
There was a problem hiding this comment.
/* Copyright (C) 1999-2003, 2005-2006 Free Software Foundation, Inc.
This file is part of the GNU LIBICONV Library.
The GNU LIBICONV Library is free software; you can redistribute it
and/or modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
The GNU LIBICONV Library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU LIBICONV Library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
Fifth Floor, Boston, MA 02110-1301, USA. */
There was a problem hiding this comment.
It is GNU, but is the copyright expired?
There was a problem hiding this comment.
No. I don't think so. We should avoid using it.
There was a problem hiding this comment.
Then we have to find another alternative before we adapt MacOS SDK 13.3.
There was a problem hiding this comment.
|
@skottmckay, what do you think? |
|
Probably safest to ask CELA. I don't recall having to worry about licenses for any other libraries that are part of the OS (if we're using the /usr/lib version). Is there any reason why the /usr/lib version would not be sufficient? Also not clear to me why it would be okay to use libiconv on Linux but not on mac, but if we can stick to the /usr/lib version maybe that question doesn't matter. |
|
We do not use libiconv on Linux. libiconv is from GNU. https://www.gnu.org/software/libiconv/ . We use glibc on Linux. glibc is not licensed under GPL. |
|
The stackoverflow article made it sound like the default iconv in macos was not the GNU libiconv one, but the license in the SDK for MacOSX (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/iconv.h) is the GNU license. I can only find iconv.h in the Xcode SDKs. No other locations. https://opensource.apple.com/source/libiconv/libiconv-9/libiconv/include/iconv.h.in.auto.html Not sure if macos doesn't use libiconv so doesn't care about the GPL license or what. Can we use the source from the gnu libc version or are there too many files to copy? Other option might be boost::locale |
|
from here: https://www.gnu.org/software/libiconv/ is LGPL ok for us to use? |
If we dynamically link to it, not much obligation. Just make sure to not include it in our packages. |
# Conflicts: # onnxruntime/core/providers/cpu/nn/string_normalizer.cc


Description
using iconv for Utf8Converter on Apple device
Motivation and Context
Because wstring_convert will be deprecated in macOS SDK 13.3 C++17