verified-network-toolchain / petr4

Petr4: Formal Semantics for P4
Apache License 2.0
74 stars 20 forks source link

Poulet4 Compiler CI #342

Closed ericthewry closed 2 years ago

ericthewry commented 2 years ago

Adding the former LightExamples as CI tests.

I made some tweaks to common.ml. Could you make sure I didn't screw anything up with the c compiler @nikaido-shinku?

I'm hoping the CI works, but I need to make the PR to see. @pataei , do you have any suggestions?

ericthewry commented 2 years ago

Looks like p4pp triggered a build error. core_kernel is missing?

Error:  The compilation of p4pp failed at "/home/runner/.opam/opam-init/hooks/sandbox.sh build dune build -p p4pp -j 4".

#=== ERROR while compiling p4pp.0.1.10 ========================================#
# context              2.0.8 | linux/x86_64 | ocaml-base-compiler.4.12.0 | pinned(git+https://github.com/cornell-netlab/p4pp.git#2c41c2d4)
# path                 ~/.opam/4.12.0/.opam-switch/build/p4pp.0.1.10
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p p4pp -j 4
# exit-code            1
# env-file             ~/.opam/log/p4pp-15965-24e2a6.env
# output-file          ~/.opam/log/p4pp-15965-24e2a6.out
### output ###
# [...]
# -> required by _build/default/META.p4pp
# -> required by _build/install/default/lib/p4pp/META
# -> required by _build/default/p4pp.install
# -> required by alias install
# File "bin/dune", line 5, characters 13-24:
# 5 |   (libraries core_kernel p4pp core))
#                  ^^^^^^^^^^^
# Error: Library "core_kernel" not found.
# -> required by _build/default/bin/main.exe
# -> required by _build/install/default/bin/p4pp
# -> required by _build/default/p4pp.install
# -> required by alias install
ericthewry commented 2 years ago

Even when core_kernel is installed I'm still getting the following error when pin-ing p4pp

# Error: This expression has type [ `Use_Sys_unix ]
# [...]
# (cd _build/default && /home/ericthewry/.opam/4.12.0/bin/ocamlc.opt -w -40 -g -bin-annot -I bin/.main.eobjs/byte -I /home/ericthewry/.opam/4.12.0/lib/base -I /home/ericthewry/.opam/4.12.0/lib/base/base_internalhash_types -I /home/ericthewry/.opam/4.12.0/lib/base/caml -I /home/ericthewry/.opam/4.12.0/lib/base/md5 -I /home/ericthewry/.opam/4.12.0/lib/base/shadow_stdlib -I /home/ericthewry/.opam/[...]
# File "bin/main.ml", line 46, characters 2-13:
# 46 |   Command.run ~version:"0.1.10" command;
#        ^^^^^^^^^^^
# Alert deprecated: Core.Command.run
# [since 2021-03] Use [Command_unix]
# File "bin/main.ml", line 46, characters 2-13:
# 46 |   Command.run ~version:"0.1.10" command;
#        ^^^^^^^^^^^
# Error: This expression has type [ `Use_Command_unix ]
#        This is not a function; it cannot be applied.
pataei commented 2 years ago

you can use workflow_dispatch: to run your actions manually, so you won't have to create a PR each time you want to check if an action works or not. Here is an example of how you can use it.

ericthewry commented 2 years ago

According to the docs, workflow_dispatch: only works when the workflow is on the default branch. Should I add it here anyway?

ericthewry commented 2 years ago

@pataei @hackedy @nikaido-shinku This is ready to merge (barring your approval)

hackedy commented 2 years ago

This looks great! Happy to have more tests in CI.

ericthewry commented 2 years ago

running tests on my merge-conflict resolution; i'll merge once they pass