Skip to content

Support package.json magic #40

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

Merged
merged 3 commits into from
Aug 3, 2016
Merged

Support package.json magic #40

merged 3 commits into from
Aug 3, 2016

Conversation

ethomson
Copy link
Member

@ethomson ethomson commented Jul 8, 2016

Apparently .NET Core type builds will:

a) eschew msbuild magic, and
b) place native binaries according to some directory hierarchy conventions.

Fixes #39

@bording
Copy link
Member

bording commented Jul 8, 2016

I believe that most of the other scripts have references to the libgit2 path that will also need to be updated to make sure everything is in the right place when the package is built.

@ethomson
Copy link
Member Author

ethomson commented Aug 3, 2016

The tragic disappointment of this change means, of course, that we'll reopen libgit2/libgit2sharp#1170. HA HA.

@bording did you happen to file a bug against mono?

@bording
Copy link
Member

bording commented Aug 3, 2016

The tragic disappointment of this change means, of course, that we'll reopen libgit2/libgit2sharp#1170. HA HA.

I randomly was thinking about this the other day, and realized this exact thing, but apparently forgot about it again before I had a chance to mention it. 😞

Unfortunately, I never found the time to actually set up a Bugzilla account at https://bugzilla.xamarin.com and go through the process of getting a decent but report filed. 😢

So, support nuget3-style native dependencies, or mono?

@bording
Copy link
Member

bording commented Aug 3, 2016

Actually wait, if the props file and dllmap file still use the lib folder, won't that still put things in the right place?

@bording
Copy link
Member

bording commented Aug 3, 2016

The question is what sort of change have to happen to the actual loading code to make this work in both scenarios? I'm not sure how you're supposed to be referencing these native libraries from managed code when using this .NET Core runtimes magic.

@ethomson
Copy link
Member Author

ethomson commented Aug 3, 2016

Actually wait, if the props file and dllmap file still use the lib folder, won't that still put things in the right place?

Hmm. That would be nice. That seems reasonable. I was hoping to get a 1:1 mapping between what's in the nuget package and what ends up on the filesystem, but there's no need for that, I suppose (except my ever-decreasing sanity.)

@ethomson
Copy link
Member Author

ethomson commented Aug 3, 2016

The question is what sort of change have to happen to the actual loading code to make this work in both scenarios? I'm not sure how you're supposed to be referencing these native libraries from managed code when using this .NET Core runtimes magic.

There shouldn't be any changes, if I understand correctly. .NET 4.whatever will still run msbuild as it used to. .NET Core won't run msbuild at all, so it will look for the magic paths.

@bording
Copy link
Member

bording commented Aug 3, 2016

Hmm. That would be nice. That seems reasonable. I was hoping to get a 1:1 mapping between what's in the nuget package and what ends up on the filesystem, but there's no need for that, I suppose (except my ever-decreasing sanity.)

That also would have required changes here to make it look somewhere other than 'lib'.

There shouldn't be any changes, if I understand correctly

So .NET Core must understand the runtime ids that are in the nuget package, and then uses those paths when processing the DllImport attribute. If that's how it works, then yeah, it seems like it should work in both cases.

Maybe one day in the future this will be supported everywhere, and the extra path manipulation code could be removed, and this could all be simplified. Hah!

Edward Thomson added 3 commits August 3, 2016 01:21
Apparently .NET Core type builds will a) eschew msbuild magic, and
b) place native binaries according to some directory hierarchy
conventions.  Let's try it.
Take the branch name or a pull request number.
@ethomson
Copy link
Member Author

ethomson commented Aug 3, 2016

Okay, well, some manual testing suggests that this is working for .NET 4 (not .NET Core) on Windows. I'm going to merge this so that I can spin an actual native nuget package (not a prerelease).

If this is terrible then of course we can revert it.

@ethomson ethomson merged commit 3e325a5 into master Aug 3, 2016
@ethomson ethomson deleted the dotnet_magic branch August 3, 2016 05:26
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

Successfully merging this pull request may close these issues.

2 participants