23 Commits

Author SHA1 Message Date
M. Anthony Aiello
375c977ee0 Improve run_example.py
Recent updates to linters revealed a number of potential code-quality
issues.

Most were related to the use of f-strings in loggers, which is
discouraged because the string interpolation is greedy (happens even if
that logging level is disabled) and because it makes the job of log
aggregators more difficult (unlikely to matter to us).

There was an instance of use of a "global" that was not intended to be
such. This was spotted by moving the core script-like functionality into
a function, which avoided adding names to the global namespace.

The script is also renamed to conform to python module-naming
conventions.

All warnings and errors are resolved, except the overly broad catching
of Exception, which is explicitly silenced.

Add a workflow for running the HelloWorld example in CI as a simple
sanity check on run-example functionality.
2022-03-24 11:23:03 -04:00
M. Anthony Aiello
57c299e89e Improve support from running LmcpGen; refactor.
RunLmcpGen.py is renamed to run_lmcpgen.py, to be consistent with python
module naming guidelines.

run_lmcpgen.py is now wrapped by a shell script, `run-lmcpgen`. This
allows it to be used without requiring the user to manually activate the
python venv - just like run-example or anod. This also means that the
user is prompted to install infrastructure it needed.

Logging in run_lmcpgen.py is much improved: it is more verbose on info
(communicates what is being done to the user) and more accurate on
warning and critical (actually explain the problem correctly) and
provide remedial action (run anod devel-setup).

Logger config for run_lmcpgen.py and run-example.py is regularized
and refactored into uxas.util.logging - this eliminates redundant code
between the two files. e3 is still not required, but is used if
available.

A workflow has been added to GitHub Actions to test the invocation of
run-lmcpgen automatically.
2022-03-15 09:46:40 -04:00
Joffrey Huguet
ee500fc6b8 Use GNAT Community Edition 2021 in GitHub Actions 2021-07-28 09:32:48 +02:00
lhumphrey
28dea43272 Update uxas-module.yaml 2021-07-06 09:51:18 -04:00
lhumphrey
f605997e6a Update uxas-module.yaml 2021-07-06 09:48:28 -04:00
lhumphrey
0cd925d54a Update uxas-module.yaml 2021-07-06 09:45:34 -04:00
lhumphrey
54ebe50f26 Update uxas-module.yaml 2021-07-06 09:36:44 -04:00
lhumphrey
887576b453 Update uxas-module.yaml 2021-05-27 10:23:35 -04:00
lhumphrey
37de997bb5 Update uxas-cpp.yml 2021-05-27 10:21:28 -04:00
lhumphrey
da60a2ff27 Update uxas-ada.yml 2021-05-27 10:19:26 -04:00
lhumphrey
fdf6c618a6 Update infrastructure-install.yaml 2021-05-27 10:17:00 -04:00
lhumphrey
8b82c5c6e0 Update amase.yml 2021-05-27 10:04:05 -04:00
lhumphrey
e1078e1122 Update uxas-cpp.yml 2021-05-26 14:24:34 -04:00
lhumphrey
8df6c42673 Update uxas-module.yaml 2021-05-26 14:15:59 -04:00
M. Anthony Aiello
5712513b30 Bootstrap Integration (#24)
* Integrate OpenUxAS-bootstrap into OpenUxAS

This commit represents a complete, working integration along with
several key enhancements. Note that the README is entirely unchanged and
not suitable.

***NOTE: the build will fail currently because of a problem with e3***
e3 provides no way to modify the list of excluded globs for sync_tree;
this will need to be fixed.

The bootstrap script works and will download and install needed support
for anod. The instructions printed at the end of the install are out of
date; the user doesn't need to do anything more than call anod with

    ./anod build uxas

The top-level anod script takes care of activating the python venv and
then calls the python anod script.

The user can also `source anod`, which will then register anod as a
shell function, allowing simpler invocation and a working setenv
command.

Anod's devel setup no longer supports uxas, since that's superfluous. It
does support lmcpgen and amase. They are placed in `develop` as before,
although finding a better name for the containing directory seems nice.

run-example works, as does resources/RunLmcpGen

make works

VS Code integration works

There is definite room for improvement. Specifically, factoring the
informtion about repository structure into some central set of
includable scripts seems like it should be really useful. Likewise,
anod's support should be a real python module so that it's easier to
use.

Finally, there's no reason not to automatically install the python venv
and all needed support the first time anod is invokved (including from
make). This would eliminate a needed step by the user. We could still
retain the bootstrap script if desired.

* Rename and create constants for repo structure

This commit reorganizes the directories a bit and introduces better
handling of pathnames through constants defined in paths.sh.
Unfortunately, because of the way python handles environment variables,
(and because we can't necessarily assume that python scripts are always
invoked through shell scripts that call paths.sh) we have to duplicate a
lot of the path information; this will hopefully be addressed in a
future commit.

* Refactor infrastructure and add github workflows.

OpenUxAS anod support is now a proper python module named `uxas`. Paths
within the uxas module are refactored. The module directory under
infrastructure/uxas has the expected layout for a python module project
and includes a tox.ini file so that tox can be used for development and
in CI.

infrastructure/install is now a script that calls into python scripts in
infrastructure/install-libexec; these are not a proper python module,
since that would create a chicken-and-egg problem. There is a tox.ini
file here, too, for development and CI.

infrastructure/bootstrap is the new bootstrap script, which is less
useful now but still usable.

Scripts have been updated as needed to take advantage of the uxas python
module. In particular, anod and run-example check for the python venv
and call into infrastructure/install if needed.

* Add Ada support and improve scripts

Added support for Ada back in by reactivating and updating
install-gnat.py Added Ada build-prove workflow

Refactored venv activation to paths.sh

Added ensure_gnat, which will check for gnat on the path (via which) or
will add a local install of GNAT CE to the path (if it's there) or will
offer to install GNAT CE via install-gnat.py This means the user can
always choose a different GNAT and it will be used; otherwise, the local
install of GNAT CE will be used.

Added wrapper shell scripts for the python testing and proof scripts so
that the environment can be automatically configured.

Updated the C++ workflow

Note: sourcing anod and then running anod as a shell function isn't
behaving quite right in either bash or zsh (and for different reasons).
Needs further investigation.

* Add debug output to print commands executed.

This should address concern that users won't be able to figure out what
the scripts are doing if things break and require manual intervention.

Also modify the workflows so that they will run if critical scripts are
updated.

* Enhance run-example to better search for binaries.

run-example now follows similar logic to run-tests in searching for
binaries. uxas and uxas-ada are also special-cased so that searching
locally and in anod should succeed as expected. The search order is:

1. path (using `which`)
2. local (obj/cpp/uxas or src/ada/uxas-ada)
3. anod (inside uxas-release or uxas-ada-release)

run-example also follows similar logic in search for OpenAMASE:

1. specified via argument
2. local (develop/OpenAMASE)
3. anod (inside amse)

I believe these have all been tested.

Help / error strings have been updated so that they are consistent with
the new infrastructure.

Debug output has been improved to be more consistent with that provided
by e3 (but doesn't actually directly use e3, still).

This commit also improves the .gitignore for ada support and updates the
Makefile so that it removes the binary on clean.

* Update README and scripts.

Create a temporary README with testing instructions.

Also fix some issues in the debug output of the scripts (the $ was not
escaped properly in some instances).

* Relativize path to anod in run-example

This looks nicer and better supports the common case: in which the user
runs run-example from the repo root.

* Fix python version in Makefile

Makefile was using python to determine the platform; this was one of a
few remaining non-python3 uses of `python`. Having fixed it, things
seem to work smoothly on a machine where python ≠ python3.

* Don't install GNAT CE by default.

Most users won't want to build Ada, so offering to install GNAT CE by
default is likely to just be confusing.

* Change the way Java is installed.

Rather than installing Java (OpenJDK 13) by way of anod in the sandbox,
instead install Java (OpenJDK 11) by way of apt. This results in Java
being available system-wide and avoids having to put ant/java on the
path using anod commands for things like generating LMCP.

Update workflows to install Java using the appropriate github action.
This should reduce the number of spurious build failures we've
encountered.

* Fix run-example issue for uxas-ada.

The shared library for uxas-ada wasn't being placed on the path.
Additionally, there was an unconditional and unlogged exit leftover from
testing in the python script.

* Update anod self-install process to be automatic.

Rather than running the install script in interactive mode, give the
user a full message up front that explains what will happen, followed by
a choice to continue. Then, run the install script in automatic mode.

This avoids some confusion identified whereby the script seems to ask
multiple times to do things in a way that's not particularly helpful
when the expectation is that it will just "take care of things" for the
user.

* Update the README

This new version of the README is tailored to the changes that were made
to integrated -bootstrap into this repository. It is intended to be
minimal and simple. Detail will be provided later to the documentation
site that AFRL is setting up. Once that site is live, links will be made
from this README to that site.

* Improve script with debug_and_run

Rather than printing the string for a command and then separately
issuing the command, we pass the string form of the command to a debug
print method and then eval the string. This removes duplication and
ensures that the printed command really is the command that is executed.

* Minor improvements to README

Fix a couple of typos.
2021-04-01 15:30:51 -04:00
Joffrey Huguet
642ec64775 Reference ada-actions/toolchain@ce2020 in Actions script instead of v0.2.0 2020-11-24 17:43:18 +01:00
Joffrey Huguet
0a43d70573 Proof testsuite can exit with an error code in case one test fails 2020-08-18 14:56:11 +02:00
James Hamil
5e7dbbd5d5 Changes for afrl-rq repository 2020-07-27 12:45:18 -04:00
M. Anthony Aiello
5c1745313e Final cleanup and refactoring (#57) 2020-07-24 19:13:47 -04:00
M. Anthony Aiello
041d7cc357 Refactor the repository.
This commit makes significant effort towards refactoring the repository
so that it is in a cleaner and more consistent state going forward.

Since we are now explicitly expecting multiple languages to be used for
OpenUxAS, we have reorganized `src` accordingly. Likewise, we have
reorganized `tests`.

This is a candidate for the rebaseline of afrl-rq/OpenUxAS.
2020-07-24 08:39:41 -04:00
M. Anthony Aiello
ba47d6834c Bugfix/run tests without coverage (#54)
* Fix run-tests when coverage is not available

We were using the presence of the UXAS_SOURCE_DIR and UXAS_BUILD_DIR
variables to tell us that coverage information had been computed during
the uxas build - but that is not precise. Those variables are now always
set by `anod printenv`. The fix is to check for the presence of files
generated by gcov, which is more precise.

* Update gitignore for recently added outputs

Now ignoring obj, and outputs in testsuite.

* Update the workflow for fixed run-tests

Also remove the switches to bootstrap for no-gnat, since that is now the
default behavior of bootstrap.
2020-07-15 10:19:56 -04:00
Joffrey Huguet
80c07a9940 Increase timeout for proof in GitHub Actions script 2020-07-01 14:23:24 +02:00
M. Anthony Aiello
4a73a2e98b Feature/use GitHub actions (#51)
Use GitHub actions to build OpenUxAS using OpenUxAS-bootstrap in a matrix.
2020-06-30 15:36:46 -04:00