pythongoogle-chromevisual-studio-2012ppapi

Pepper API error during the example


I'm starting to play around with the new Pepper API for an important project (phasing out Java) and I'm having an issue with this example.

https://developer.chrome.com/native-client/devguide/devcycle/vs-addin

I've installed the plugin to VS, added the paths, started the python webserver yet when I debug it gives me a 404...

enter image description here

I'm starting the python webserver as per https://developer.chrome.com/native-client/sdk/examples

The issue being the HTML file it's looking for is in F:\nacl_sdk\vs_addin\examples\hello_world_gles\hello_world_gles and the localhost root is F:\nacl_sdk\pepper_42\getting_started

Has anyone else had this issue?

I also have plenty of intellisense errors:

enter image description here

Since I posted this I tried copying the example directory to the root directory being used by localhost. The page loads, however I'm not capable of running the plugin...

enter image description here


Solution

  • I think you're not supposed to be starting the Python web server, as per the vs addin documentation:

    When you run one of the Native Client platforms Visual Studio builds the corresponding type of Native Client module (either a .nexe or .pexe), starts a web server to serve it up, and launches a copy of Chrome that fetches the module from the server and runs it.

    However, to be honest, I'm still unable to run this sample, even though I'm following this instruction. I'm seeing an "ERR_CONNECTION_REFUSED" result page. I'm using VS 2012 Express, and Chrome 43.

    Update. I've finally managed to run the sample. First, I've installed VS 2012 Ultimate instead of Express (because Express doesn't support Add-Ins). Second, the latest VS addin seems to be unable to run the Python web-server, it passes the port paramater in a wrong format. You can see that if you read the output in the "Native Client Web Server Output" pane in VS. So what I did, is I modified the %NACL_SDK_ROOT%\tools\httpd.py, so that it doesn't attempt to parse the command line arguments :)

    Here is the new main from my httpd.py:

    def main(args):
      server = LocalHTTPServer(os.path.abspath('.'), 5103)
    
      # Serve until the client tells us to stop. When it does, it will give us an
      # errorcode.
      print 'Serving %s on %s...' % (options.serve_dir, server.GetURL(''))
      return server.ServeForever()
    

    HTH.