Re: Local web server

Hi Jim,

Jim Schaad <ietf@augustcellars.com>, 2016-03-25 15:08 -0700:
> My problem is not a lack of openssl, but an excess of it.  I have
> multiple copies on my computer.  Remember that I am a crypto person.  And
> it is not on my path so I don't get the wrong version at any given time
> when I am doing various types of testing.

OK. So have you figured out how to get the script to see whatever python
version you want to use with these tests?

I don’t know how to do it on windows, but in a linux/bash/etc command-line
environment, you could do it by setting some environment variables in the
command-line invocation of the `serve` script by doing this:

  FOO_BAR=/some/path ./serve

Alternatively, you could hack the script to set it. And long-term we could
add a command-line option to the script to let you specify which openssl
installation on your system that you want to use. That won’t solve the
problem for you right now but at least it would for others who come along
later that have their environments set up in the same way.

> Turns out that the lack of openssl on my computer, while a problem, was
> not the actual problem that I was having at the time.   After trying to
> debug things and pounding my head on the table, I noticed that there was
> not anybody calling the function main in serve.py.

I’m not a python expert but as far as I can see in fact it is getting called.

> I have no idea of how you are getting this done, but without an explicit
> call to main it does not work for me.  Rather it compiles the code and
> exits.

I believe it’s working like this:

https://github.com/w3c/web-platform-tests/blob/master/serve has `import
serve`, which cause it the `serve.py` file to be loaded and evaluated, and
then `serve` calls `serve.main()`, which therefore calls `main()` in
`serve.py`, which calls another `serve.main()` but this time imported from
`tools.serve`, which is https://github.com/w3c/wpt-tools (as a git
submodule) and which then calls https://github.com/w3c/wptserve (as a
nested git submodule). Which is where all the real Web-server code is.

So while I have never tested this on Windows I know that others have and
found that it works. And just to be very clear what I mean is, you just
change to the web-platform-tests directory and type `./serve`. Or on
Windows I guess `.\serve` or whatever the actual Windows syntax is.

  —Mike

-- 
Michael[tm] Smith https://people.w3.org/mike

Received on Saturday, 26 March 2016 00:23:38 UTC