AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

VSCode devcontainer: cannot run 'validate' #1434

Closed sjcjoosten closed 8 months ago

sjcjoosten commented 10 months ago

What happened

When running 'validate' inside the devcontainer, I get a fatal that says it cannot parse the php result:

Validating SQL expressions...
/bin/sh: 1: php: not found
Could not execute PHP: readCreateProcess: php "/tmp/tmpPhpQueryOfAmpersand.php" > "/tmp/tmpPhpQueryOfAmpersand.phpResult" (exit 127): failed

(part of output removed)

Temp database created succesfully.
Validating terms: 1 of 125 I[PF_Interface] (EDcI PF_Interface)./bin/sh: 1: php: not found

What I expected

I expect to get either an error that explains that I need to install php and mysql, and how I can do so, or to get the 'validate' script to run succesfully.

Version of ampersand that was used

4.7.6 main

Steps to reproduce

  1. Clone the Ampersand repository
  2. Open the Ampersand directory in vscode, then allow vscode to open it within a devcontainer.
  3. Type 'stack install' in the vscode terminal (open it with ctrl+shift+`) and wait for the installation to complete
  4. Type 'ampersand validate testing/performance/Issue1409/Issue1409B.adl'

Analysis

The message Temp database created succesfully. is wrong. A cause of the error is that php is not installed inside the devcontainer, and no mysql server is running in it either. I believe that the best way to fix this is to add php and a running mysql server to the devcontainer.

Workaround

Install php and mysql locally, and don't use the vscode terminal when working from a devcontainer.

hanjoosten commented 10 months ago

Interesting. We could install all those things in the devcontainer, but it will make it even larger than it is now. It depends on what we really want the devcontainer to be able to support. The error messages in this case could be better, but I am not sure if we want to install php and mysql in the devcontainer. I wonder what @stefjoosten thinks about this.

The good news is that you tried out the devcontainer, and apart from this functionality, does it work? The main purpose is that you get the Haskell support when you write Haskell.

stefjoosten commented 10 months ago

I see the problem. We need to think about the test architecture to solve this problem. It is undesirable to stuff it all in one container because it will make the container useless. We could adapt an existing Ampersand server (e.g. one of the RAP deployments) to serve such test cases. After all, RAP already knows how to run a script and has an Ampersand compiler on board. I will label this issue for discussion...