Skip to content

libClangSharp 13.0 osx-x64 has dependency on (missing?) libclang-cpp.dylib #321

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

Closed
ihnorton opened this issue Feb 7, 2022 · 2 comments
Closed

Comments

@ihnorton
Copy link
Contributor

ihnorton commented Feb 7, 2022

Hi, thank you for this excellent package. I'm wondering about the following issue with 13.0 on macOS 10.14 (intel).

The libClangSharp runtime package for osx-x64 contains libClangSharp.dylib. This shared library depends on libclang.dylib and libclang-cpp.dylib:

base ❯ otool -L ~/Downloads/libClangSharp.dylib
/Users/inorton/Downloads/libClangSharp.dylib:
	@rpath/libClangSharp.13.0.0.dylib (compatibility version 13.0.0, current version 13.0.0)
	@rpath/libclang-cpp.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libclang.dylib (compatibility version 1.0.0, current version 13.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)

However the libclang runtime package does not contain libclang-cpp.dylib. Is this available separately? I've looked around a bit and may have missed a separate package, if it exists.

Apologies in advance if this is user error.

@ihnorton
Copy link
Contributor Author

ihnorton commented Feb 7, 2022

By the way, the 12.0 version of libClangSharp only references libclang.dylib:

base ❯ otool -L runtimes/osx-x64/native/libClangSharp.dylib
runtimes/osx-x64/native/libClangSharp.dylib:
	@rpath/libClangSharp.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libclang.dylib (compatibility version 1.0.0, current version 12.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)

Also, for reference I am using the following simple package to try to install the dependencies automatically (based on this comment and related discussions) -- this works fine with 12.0:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <PropertyGroup>
    <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' AND '$(PackAsTool)' != 'true'">$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ClangSharp" Version="13.0.0-beta1" />
    <PackageReference Include="libClangSharp.runtime.osx-x64" Version="13.0.0-beta1" />
  </ItemGroup>

</Project>

(after building that project, I set DYLD_LIBRARY_PATH to the runtime directory before running ClangSharpPInvokeGenerator -- works for 12, fails for 13)

@ihnorton
Copy link
Contributor Author

ihnorton commented Feb 7, 2022

Ok, I see libclang-cpp is actually in the upstream and brew packages for 13.0. So something must have changed (here or upstream) such that statically-linked libclang.dylib is no longer sufficient for 13.0. Not quite working on 13.0 for me yet, but I'll go ahead and close this since the remaining issues appear unrelated to packaging. Apologies for the noise.

@ihnorton ihnorton closed this as completed Feb 7, 2022
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

1 participant