kswoll / WootzJs

C# to Javascript Compiler implemented via Roslyn
MIT License
110 stars 21 forks source link

Build Problems #1

Closed StephenStatkus closed 10 years ago

StephenStatkus commented 10 years ago

Cloning the repository and building the solution does not work. I had to jump through hoops (editing the project files) just to get the projects to load in the solution. Even after doing that it still does not compile:

1>CSC : error CS0518: Predefined type 'System.Object' is not defined or imported

I'm guessing this has to do with the import XML elements in the project file?

kswoll commented 10 years ago

Yes, there is a dependency on WootzJs.Runtime wherein that project must be built first. But I agree this is a nuisance. I will create a build script that you can run for the first time that will ensure all the necessary dependencies are in place before opening the solution. Will address this right away.

StephenStatkus commented 10 years ago

Thanks.

On Tue, Feb 11, 2014 at 10:40 PM, kswoll notifications@github.com wrote:

Yes, there is a dependency on WootzJs.Runtime wherein that project must be built first. But I agree this is a nuisance. I will create a build script that you can run for the first time that will ensure all the necessary dependencies are in place before opening the solution. Will address this right away.

Reply to this email directly or view it on GitHubhttps://github.com/kswoll/WootzJs/issues/1#issuecomment-34838267 .

kswoll commented 10 years ago

I've pushed some changes that should address this problem. (I've also updated the docs on the wiki). But once you pull, just run the build.bat located in the root. Hopefully it should finish with no errors. If so, you're in business. If not, let me know. (Also, this is the only time you should be required to run that bat file)

StephenStatkus commented 10 years ago

That didn't work. The compiling of the projects fails when run from the batch file. The project files have bad settings in them. If you download your zip for example and run it from a random directory I think you will see the issue.

StephenStatkus commented 10 years ago

My last comment really applies to the import statements in the project files. Can those be relative paths instead of hard coded to 'c:\dev\?

StephenStatkus commented 10 years ago

It looks like the overrides from the import are not taking. All the System types are not recognized.

kswoll commented 10 years ago

Apologies for the troubles you are experiencing. I have pushed some changes that address the hard-coded path to c:\dev, in addition to fixing the build order. I just did a clone on a fresh box without WootzJs anywhere, and the build script now succeeds. To verify everything built ok, you can open up the Test.htm file in .\WootzJs\WootzJs.Compiler.Tests? If all the tests pass, then everything should be working.

If you are still getting the problems where it is not recognizing the system types, can you examine your project references to see if the mscorlib reference is pointing to the mscorlib.dll in WootzJs\build? If it's not, can you let me know where it is pointing to? Thanks!

StephenStatkus commented 10 years ago

The project solution built fine and the unit tests passed. When I added the import to the visual studio project file I still get a lot of CS0246 errors...DateTime type could not be found, AutoResetEvent could not be found, etc. I must be doing something wrong.

StephenStatkus commented 10 years ago

I forgot to mention that when I reloaded the project the path to mscorlib is correct.

kswoll commented 10 years ago

Ah, I think we are homing in on the problem. It sounds like you are taking an existing project and trying to compile it with WootzJs? Currently the DateTime class is not supported, but now that you mention it, I agree that that class is very important to include, and I will address that in the next few days. As for AutoResetEvent, I do not believe that class would have any meaning in Javascript, as you can't create threads (and even web workers aren't really threads in any normal C# sense).

Can you elaborate on what the project is designed to do? If it's something that won't be feasible with this framework, I'd like to let you down early. If on the other hand it is something that should work well in Javascript, I'd look forward to implementing any missing features you require (such as DateTime).

kswoll commented 10 years ago

I'm going to close out this issue since I think at this point it's working as designed. If you have any further problems, please feel free to open a new ticket.

StephenStatkus commented 10 years ago

Sorry I didn't get back to you sooner. I basically need the entire framework types to be converted as part of our app.

Stephen

On Feb 13, 2014, at 8:24 PM, kswoll notifications@github.com wrote:

I'm going to close out this issue since I think at this point it's working as designed. If you have any further problems, please feel free to open a new ticket.

Reply to this email directly or view it on GitHubhttps://github.com/kswoll/WootzJs/issues/1#issuecomment-35049853 .

kswoll commented 10 years ago

Well, here's where I unfortunately let you down (as) quickly (as possible). Javascript does not support multithreading. Thus no classes relating to threading are supported. If you are actually depending on AutoResetEvent and threading, this will never be supported. The best that could even in principle be supported is leveraging web workers, but unfortunately that model fully encapsulates the threading code from the rest of your code, and thus does not support locks or any other cross-thread communication that you'd expect as a C# programmer.

I will update the docs to make this more clear so that developers such as yourself do not have to invest so much time before finding that this framework will not be suitable for you. I apologize that this is the case and that you've spent so much time trying to get this to work to no avail, but ultimately you are going to be beholden to what Javascript can actually do.