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

dotnet core upgrade #39

Closed
wants to merge 6 commits into from
Closed

dotnet core upgrade #39

wants to merge 6 commits into from

Conversation

CloneDeath
Copy link

I've upgraded the two projects to dotnet core (using netstandard2.0), and updated the csproj files to the new format. I moved the demo project into its own directory, simply because of the way the new csproj file format works... otherwise I would have had to make the project exclude everything and only bring in demo.cs, making it a lot more complex.

In order to get around the mono dependency, I've added a nuget reference to the beta netstandard posix nuget package, which looks to be working fine.

I've added dlerror in order to help diagnose issues.

Also, when lazy loading ncurses on my platform, I always got intptr.zero. But, when I changed it to load now (1 instead of 0 for the mode), it ran perfectly for me.

Lastly, i changed the dllimport bindings from libc to libdl. Again, I had issues binding to libc, and I'm not entirely sure why. (libdl just wraps libc for the dl calls, btw). If you have a problem with this (it doesn't run), then I can go ahead and create two bindings, one for libc, and one for libdl, and try one before falling back to the other. I don't know if this is necessary, so I held back on doing this to keep my changes minimal for this pull request.

@simplexidev
Copy link

simplexidev commented Jan 31, 2018

Have you thought about adding <EnableDefaultCompileItems>false</EnableDefaultCompileItems> to the demo project, and add the line <Compile Exclude="demo.cs" /> to the main project? This would avoid reorganizing the whole project, and still have the same result. Just a thought, since I as looking at this project. :P
EDIT: I forgot to mention that with the use of a false value in <EnableDefaultCompileItems>, you would have to add <Compile Include="demo.cs" /> to the demo project file as well.

@CloneDeath
Copy link
Author

Yes, I considered that. And ultimately, the change I made only involved moving two files: demo.cs and Terminal.csproj

Most projects usually are separated with one project per folder, and not mixed with the main solution... I'm not sure why this was an exception.

I'm not against doing exactly as you said though, if for no other reason than to keep this pull request focused solely on the dotnet core upgrade.

@simplexidev
Copy link

I wasn't against what you did, as I prefer a single project per folder, I was just mentioning it. :)

migueldeicaza added a commit to mono/mono-curses that referenced this pull request Feb 3, 2018
@migueldeicaza
Copy link
Collaborator

I applied the changes to bindings.cs to the upstream project (mono-curses), which is regularly synced here.

The only downside of going to .NET Standard is that it results in a very large executable if I want to keep using Mono and it is slower to startup than what I am using now. Perhaps we should build the .NET standard library separately for now.

@migueldeicaza
Copy link
Collaborator

I had another problem: the poll() call does not seem to be returning the data about activity on a file descriptor, so the application goes into a tight loop. Need to debug this.

@CloneDeath
Copy link
Author

Sorry, I was sick all last week.

I think this stems from the fact that I used the beta release of Mono.Posix. I think the time to revisit this is when that package leaves beta.

@migueldeicaza
Copy link
Collaborator

There is a new version that should take care of this.

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.

None yet

3 participants