Skip to content

Commit

Permalink
adding start to script for spack export.
Browse files Browse the repository at this point in the history
There are a ton of symbols from system includes that are deemed missing,
but we do not have a way to know that they are from system (and not a dependency).

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Apr 16, 2021
1 parent 9fefeaa commit acf16d6
Show file tree
Hide file tree
Showing 5 changed files with 66,520 additions and 0 deletions.
19 changes: 19 additions & 0 deletions abi-python/spack/Dockerfile.clingo
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ghcr.io/autamus/clingo:latest
# docker build -f Dockerfile.clingo -t clingo .
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH=/opt/conda/bin:$PATH
RUN apt-get update && apt-get install -y curl
RUN /bin/bash -c "curl -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh && \
bash miniconda.sh -b -p /opt/conda && \
rm miniconda.sh"
RUN /bin/bash -c "conda install -y -c conda-forge mamba && \
mamba create -q -y -c potassco -n clingo-env clingo && \
source activate clingo-env && \
conda clean --all -y && \
pip install pyelftools && \
conda install clingo ipython six"
RUN echo "source activate clingo-env" > ~/.bashrc
ENV PATH /opt/conda/envs/clingo-env/bin:${PATH}
ENTRYPOINT /bin/bash
WORKDIR /code
ADD . /code
44 changes: 44 additions & 0 deletions abi-python/spack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# A Logic Program to work with Spack

The file [abi-facts.lp](abi-facts.lp) is generated with [this branch](https://github.com/vsoch/spack/tree/add/clingo-analyzer) of spack, which has an added analyzer for clingo:

```bash
$ spack install zlib+debug
$ spack install tcl+debug
$ spack analyze run -a clingo tcl
```

Note above that both tcl and it's dependency zlib were installed with debug information,
otherwise this would not work. Also note that in the command above, we are stating
that "tcl" is the main library we are interested in to assess compatibility with
it's dependencies. In the case of generating facts for a solver (likely for a splice)
the problem will be slightly different - we will still be interested in some primary package,
but we will be including facts (atoms) for the dependency version we want to splice in.

The above command generates that file in the analyzers folder, in the clingo subdirectory. We are copying it here so it's easy to develop with.
Next, let's build a container to develop in:

```bash
$ docker build -f Dockerfile.clingo -t clingo-docker .
```

And shell into it.

```bash
$ docker run -it --rm -v $PWD/:/code clingo-docker bash
```

Unlike our first attempt in the [python](../python) folder, instead of having
a main binary and two libraries (one known to work and one we are testing),
for this logic program we are throwing all symbols in the space into a bag,
including the compiler, and we target the binaries of the main package as the
ones we are interested in to assess if they still work. This means that we assume
that a dependency of this main library (that is already installed) is working,
and we don't add all nested dependency symbols into the mix. If any symbol is
missing for a main binary/library that we are interested in, we will throw an issue.

We can then develop and run our program:

```bash
(clingo-env) root@12069473da65:/code/python# clingo --out-ifs=\\n abi-facts.lp is_compatible.lp
```

0 comments on commit acf16d6

Please sign in to comment.