sandstorm-io/sandstorm-rawapi-example

Do we still need the "empty" hack in sandstorm-pkgdef.capnp?

paulproteus opened this issue · 2 comments

Question:

Context:

When I was helping David Benson revise the draw.io package recently, we ran into an issue where this empty directory did not exist.

Eventually, we noticed that in a vagrant-spk context, we should use a sourceMap of:

  sourceMap = (
    # Here we defined where to look for files to copy into your package. The
    # `spk dev` command actually figures out what files your app needs
    # automatically by running it on a FUSE filesystem. So, the mappings
    # here are only to tell it where to find files that the app wants.
    searchPath = [
      ( sourcePath = "." ),  # Search this directory first.
      ( sourcePath = "/",    # Then search the system root directory.
        hidePaths = [ "home", "proc", "sys",
                      "etc/passwd", "etc/hosts", "etc/host.conf",
                      "etc/nsswitch.conf", "etc/resolv.conf" ]
        # You probably don't want the app pulling files from these places,
        # so we hide them. Note that /dev, /var, and /tmp are implicitly
        # hidden because Sandstorm itself provides them.
      )
    ] 
  ),

I don't remember if we used that full long value as the sourceMap but anyway, after removing empty we were able to run spk pack. Interestingly this error only shows up at spk pack time, I believe, so it resulted in a somewhat inscrutable C++ exception without any function names because Sandstorm binaries don't have debug info. I had to video-call David to figure out what was going on.

If the empty hack isn't needed anymore, then I'd love to see it removed from this repo.

Related: perhaps "rawapi" should be a vagrant-spk platform stack? Curious if you would find that interesting, @kentonv .

I was going to mention again regarding sandstorm-io/sandstorm#2541 that rawapi needs to be easier.

I tried this out just now, and the empty hack is apparently still needed.