valum icon indicating copy to clipboard operation
valum copied to clipboard

Windows support

Open elegaanz opened this issue 10 years ago • 27 comments

Hello,

I'm developing with Vala on Windows (I'm the only one, I think :p ). I tried your framework with Vala 0.20, but it doesn't seems to work ...

Is a Windows support planned ? And excuse me if I have done some mistakes with English ... I'm learning. :smile:

elegaanz avatar Jan 09 '16 14:01 elegaanz

It's not planned, but it should be done whenever it would be sufficiently stable for production use.

The framework rely essentially upon portable libraries, so it should not take too much effort to build a working DLL.

What kind of issues are you experiencing?

arteymix avatar Jan 09 '16 22:01 arteymix

Here is my errors.

`using Gee;
      ^^^
vsgi-fastcgi.vala:19.7-19.13: error: The namespace name `FastCGI' could not be found
using FastCGI;
      ^^^^^^^
vsgi-fastcgi.vala:65.18-65.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @in { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:67.49-67.63: error: The symbol `FastCGI' could not be found
                public StreamInputStream (GLib.Socket socket, global::FastCGI.Stream @in) {
                                                              ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:65.18-65.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @in { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:65.18-65.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @in { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:65.18-65.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @in { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:118.18-118.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @out { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:120.18-120.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream err { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:125.50-125.64: error: The symbol `FastCGI' could not be found
                public StreamOutputStream (GLib.Socket socket, global::FastCGI.Stream @out, global::FastCGI.Stream err) {
                                                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:125.79-125.93: error: The symbol `FastCGI' could not be found
                public StreamOutputStream (GLib.Socket socket, global::FastCGI.Stream @out, global::FastCGI.Stream err) {
                                                                                            ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:118.18-118.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @out { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:118.18-118.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @out { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:118.18-118.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream @out { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:120.18-120.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream err { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:120.18-120.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream err { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:120.18-120.32: error: The symbol `FastCGI' could not be found
                public unowned global::FastCGI.Stream err { construct; get; }
                               ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:321.5-321.19: error: The symbol `FastCGI' could not be found
                                global::FastCGI.request request;
                                ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:375.20-375.34: error: The symbol `FastCGI' could not be found
                        private unowned global::FastCGI.request request;
                                        ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:391.38-391.52: error: The symbol `FastCGI' could not be found
                        public Connection (Server server, global::FastCGI.request request) {
                                                          ^^^^^^^^^^^^^^^
vsgi-fastcgi.vala:33.37-33.51: error: The symbol `FastCGI' could not be found
        private inline void process_error (global::FastCGI.Stream stream) throws IOError {
                                           ^^^^^^^^^^^^^^^
valum-view.vala:38.19-38.22: error: The symbol `Ctpl' could not be found
                private unowned Ctpl.Token tree;
                                ^^^^
valum-view.vala:45.10-45.13: error: The symbol `Ctpl' could not be found
                public Ctpl.Environ environment = new Ctpl.Environ ();
                       ^^^^
valum-view.vala:164.44-164.53: error: The type name `Collection' could not be found
                public void push_collection (string key, Collection collection) {
                                                         ^^^^^^^^^^
valum-view.vala:166.28-166.43: error: The type name `Collection' could not be found
                                this.push_ints (key, ((Collection<long>) collection).to_array ());
                                                       ^^^^^^^^^^^^^^^^
valum-view.vala:170.30-170.47: error: The type name `Collection' could not be found
                                this.push_floats (key, ((Collection<double>) collection).to_array ());
                                                         ^^^^^^^^^^^^^^^^^^
valum-view.vala:174.31-174.48: error: The type name `Collection' could not be found
                                this.push_strings (key, ((Collection<string>) collection).to_array ());
                                                          ^^^^^^^^^^^^^^^^^^
valum-view.vala:189.37-189.55: error: The type name `Map' could not be found
                public void push_map (string key, Map<string, Value?> map) {
                                                  ^^^^^^^^^^^^^^^^^^^
valum-view.vala:190.13-190.23: error: The type name `MapIterator' could not be found
                        foreach (MapIterator elem in map) {
                                 ^^^^^^^^^^^
valum-view.vala:198.44-198.62: error: The type name `Map' could not be found
                public void push_string_map (string key, Map<string, string> map) {
                                                         ^^^^^^^^^^^^^^^^^^^
valum-view.vala:199.13-199.23: error: The type name `MapIterator' could not be found
                        foreach (MapIterator elem in map) {
                                 ^^^^^^^^^^^
valum-view.vala:207.41-207.57: error: The type name `Map' could not be found
                public void push_int_map (string key, Map<string, long> map) {
                                                      ^^^^^^^^^^^^^^^^^
valum-view.vala:208.13-208.23: error: The type name `MapIterator' could not be found
                        foreach (MapIterator elem in map) {
                                 ^^^^^^^^^^^
valum-view.vala:221.49-221.72: error: The type name `MultiMap' could not be found
                public void push_string_multimap (string key, MultiMap<string, string> multimap) {
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^
valum-view.vala:232.46-232.67: error: The type name `MultiMap' could not be found
                public void push_int_multimap (string key, MultiMap<string, long> multimap) {
                                                           ^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 35 error(s), 0 warning(s)

But I have issues with Gee, I can't compile packaging it.

elegaanz avatar Jan 10 '16 19:01 elegaanz

Gee has been removed along with CTPL, so you should try this release v0.2.6.

The FastCGI namespace is provided by a VAPI https://github.com/valum-framework/valum/blob/master/vapi/fcgi.vapi It's likely a build issue.

arteymix avatar Jan 10 '16 20:01 arteymix

Ok, i'll try to build with it. Thanks.

elegaanz avatar Jan 11 '16 18:01 elegaanz

Ok, I have just one last problem (I hope). Soup.Status doesn't seems to exist in my version of libsoup (I have 2.4). Which version are you using ?

elegaanz avatar Jan 11 '16 19:01 elegaanz

Minimal dependencies are described here: http://valum-framework.readthedocs.org/en/latest/installation.html#dependencies

It requires at least libsoup-2.4 (>=2.38). You can check the version in libsoup-2.4.pc which should be in pkgconfig in the DLL folder (but I'm just guessing here).

arteymix avatar Jan 12 '16 03:01 arteymix

It's possible that the VAPI is not up-to-date though: it ships along with Vala.

arteymix avatar Jan 12 '16 03:01 arteymix

That too complicated. I stop trying to install Valum. I'll install Linux. Thanks for your help !

elegaanz avatar Jan 12 '16 20:01 elegaanz

@Bat41

I'm only half sorry to hear that! I'll have to get my hands dirty some days I suppose.

You should use Fedora, Valum comes packaged and batteries-included from that copr https://copr.fedoraproject.org/coprs/arteymix/valum-framework/

arteymix avatar Jan 14 '16 00:01 arteymix

I have recently build Val 0.32 for Windows. I tried to recompile Valum using this version, and i can compile just with few changes (6 lines). Yey ! But i still get this error :

error: program does not contain a static `main' method

Can you help me, please ? :smile:

elegaanz avatar Feb 16 '16 17:02 elegaanz

Could you gist me the whole build log?

If examples are not enabled, it should not build a program, but rather a shared library.

arteymix avatar Feb 16 '16 18:02 arteymix

Yep : https://gist.github.com/Bat41/db44c9f824f78461879c

elegaanz avatar Feb 16 '16 18:02 elegaanz

How do you tell to the compiler to output a library (.vapi I supose) ?

elegaanz avatar Feb 16 '16 19:02 elegaanz

Just add --library=valum and it should work :)

arteymix avatar Feb 16 '16 19:02 arteymix

Otherwise, just build everything along your application.

It would be nice to adapt the build with waf though.

arteymix avatar Feb 16 '16 19:02 arteymix

Then, maybe work CI out with AppVeyor

arteymix avatar Feb 16 '16 19:02 arteymix

Thanks. Now Vala compilation works, but C don't. I just have to add headers file.

elegaanz avatar Feb 16 '16 19:02 elegaanz

I have got some problems ... https://gist.github.com/Bat41/7e07829451dbde71cb7e

I think it's not today I could start using Valum. :sob:

elegaanz avatar Feb 16 '16 20:02 elegaanz

@Bat41 This is supposed to be automated by pkg-config.

In short, I would just like to hear it working, I think it would motivate me to port the build. Have you tried waf on Windows?

How about being (eventually) in charge of testing the build on Windows?

arteymix avatar Feb 16 '16 20:02 arteymix

@Bat41 You can use Vagrant to work in a virtual environment in the meantime

arteymix avatar Feb 16 '16 21:02 arteymix

I tried waf long time ago, but i didn't worked, so I made my own script. But I could try again ...

elegaanz avatar Feb 17 '16 07:02 elegaanz

Waf doesn't detect gcc. :expressionless:

But can't I just add the source in the folder of my website sources ? Without compilation.

elegaanz avatar Feb 17 '16 17:02 elegaanz

I tried, and it's not possible. :disappointed:

elegaanz avatar Feb 17 '16 17:02 elegaanz

There's a couple of things to do for Windows support:

  • [ ] conditionally build with gio-unix-2.0 (not portable)
  • [ ] fix the build (waf should work on Windows)
  • [ ] setup CI on AppVeyor
  • [ ] test with IIS HTTP server

As I said, all of Valum's dependencies are portable, so it's just a matter of how we build.

FastCGI uses UnixInputStream and UnixOutputStream to provide polling on streams. There should be a graceful fallback, probably Windows-specific.

SCGI is fully portable, but I plan on supporting UNIX domain socket as well, so it has to be conditionally enabled.

CGI work with UNIX streams too, so it should be adapted.

arteymix avatar Feb 25 '16 00:02 arteymix

@Bat41 By the way I've just successfully cross-compiled for mingwn using Meson. There's still some work to do it get it right though

There's a couple of changes to make so that the framework can be fully portable.

It would basically allow anyone to cross-compile a Web app into a Windows executable.

arteymix avatar Oct 27 '16 19:10 arteymix

Having just attempted to build under MSYS2 i've come to the conclusion this is impossible because of the dependency on gio-unix

ZanderBrown avatar Mar 20 '17 10:03 ZanderBrown

@ZanderBrown There's work in progress for making it optional, see #198 is using gio-windows instead and almost all tests are passing

arteymix avatar Mar 20 '17 13:03 arteymix