Skip to content

Commit

Permalink
Spark in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
usr3-1415 committed Dec 29, 2022
1 parent 8d8d2d3 commit 676d166
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
32 changes: 23 additions & 9 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#
# Copy the current folder into the container and build asn1scc.
#
#################################################################################################
#################################################################################################

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

RUN apt update
RUN apt install -y python3 python3-distutils \
gnat gcc g++ make openjdk-11-jre nuget libgit2-dev libssl-dev gprbuild ; apt clean
RUN set -xe \
&& DEBIAN_FRONTEND=noninteractive apt-get update -y \
&& apt-get install -y libfontconfig libdbus-1-3 libx11-6 libx11-xcb-dev \
python3 python3-distutils gcc g++ make openjdk-11-jre nuget libgit2-dev libssl-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove \
&& apt-get clean

# Install GNAT AND SPARK from AdaCore

WORKDIR /gnat_tmp/

ADD https://community.download.adacore.com/v1/f3a99d283f7b3d07293b2e1d07de00e31e332325?filename=gnat-2021-20210519-x86_64-linux-bin ./gnat-2021-20210519-x86_64-linux-bin

RUN git clone https://github.com/AdaCore/gnat_community_install_script.git \
&& chmod +x gnat_community_install_script/install_package.sh \
&& chmod +x gnat-2021-20210519-x86_64-linux-bin \
&& gnat_community_install_script/install_package.sh ./gnat-2021-20210519-x86_64-linux-bin /opt/GNAT/gnat-x86-2021

WORKDIR /app/

RUN rm -rf /gnat_tmp/

ENV PATH="/opt/GNAT/gnat-x86-2021/bin:${PATH}"
ENTRYPOINT ["/bin/bash"]
2 changes: 1 addition & 1 deletion FrontEndAst/CheckAsn1.fs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ let CheckValueType (ot:Asn1Type) (v:Asn1Value) ast=
match ot.Kind with
| ReferenceType rf -> sprintf "%s.%s" rf.modName.Value rf.tasName.Value
| _ -> sprintf "%A" t.Kind
raise(SemanticError(v.Location, sprintf "Expecting a '%s' value" typeName))
raise(SemanticError(v.Location, sprintf "Expecting a '%s' value, got a '%s' " typeName (v.ToString())))
CheckValueType ot v ast
///checks if two types are ASN.1 compatible
let rec AreTypesCompatible (t1:Asn1Type) (t2:Asn1Type) ast =
Expand Down
11 changes: 11 additions & 0 deletions local-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#docker run -ti --rm -v $(pwd):/app -v asn1scc_workdir:/workdir myspark
cd /workdir/
git -C asn1scc pull || git clone /app/ asn1scc
cd asn1scc
dotnet build Antlr/ || exit 1
#dotnet build "asn1scc.sln"|| exit 1
cd v4Tests-32 || exit 1
make || exit 1
cd ../v4Tests || exit 1
make || exit 1
2 changes: 1 addition & 1 deletion regression/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ let executeTestCase asn1sccdll workDir (t:Test_Case) (lang:string, ws:int, slim
else
if bRunSpark then
let bWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)
let makeCommand = sprintf "gnatprove%s -Pasn1_x86.gpr -j0 -u test_case.adb --level=4 >sparklog.txt 2>&1" (if bWindows then ".exe" else ".exe")
let makeCommand = sprintf "gnatprove%s -Pasn1_x86.gpr -j0 -u test_case.adb --level=4 >sparklog.txt 2>&1" (if bWindows then ".exe" else "")
let res = executeBashScript workDir makeCommand
let sparkLogFname = Path.Combine(workDir, "sparklog.txt")
if res.ExitCode <> 0 then
Expand Down

0 comments on commit 676d166

Please sign in to comment.