Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull the jsl Python dependency separately for the Tofino back end. #5060

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Pull the jsl Python dependency separately for the Tofino back end.
  • Loading branch information
fruffy committed Dec 12, 2024
commit 06117773e30b265e2565df8a90ffc35ff18e6185
17 changes: 17 additions & 0 deletions backends/tofino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ endif()
set (ENV{P4C_VERSION} "${BFN_P4C_VERSION} (SHA: ${BFN_P4C_GIT_SHA})")
MESSAGE(STATUS "p4c-barefoot version: $ENV{P4C_VERSION}")


# Fetch and declare the jsl for schemas.
set(FETCHCONTENT_QUIET_PREV ${FETCHCONTENT_QUIET})
set(FETCHCONTENT_QUIET OFF)
fetchcontent_declare(
tofino_jsl
URL https://github.com/aromanovich/jsl/archive/refs/tags/0.2.4.tar.gz
# URL_HASH SHA256=cc01a3a05d25e5978c20be7656f14eb8b6fcb120bb1c7e8041e497814fc273cb
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/compiler_interfaces/schemas/jsl
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
fetchcontent_makeavailable(tofino_jsl)
set(FETCHCONTENT_QUIET ${FETCHCONTENT_QUIET_PREV})
message("Done with setting up Python JSL for P4C.")

# Generate the sha specific version file. It includes the GIT SHA.
# Because this version changes frequently, we include it separately from the normal version files.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/git_sha_version.h.in"
Expand Down
1 change: 1 addition & 0 deletions backends/tofino/compiler_interfaces/schemas/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsl
2 changes: 1 addition & 1 deletion backends/tofino/compiler_interfaces/schemas/bfrt_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import sys

import jsl
import jsl.jsl as jsl
import jsonschema

########################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os.path
import sys

import jsl
import jsl.jsl as jsl

MYPATH = os.path.dirname(__file__)
if not getattr(sys, 'frozen', False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/compiler_interfaces/schemas/jgf_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import os.path
import sys

import jsl
import jsl.jsl as jsl

MYPATH = os.path.dirname(__file__)
if not getattr(sys, 'frozen', False):
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/compiler_interfaces/schemas/mau_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import inspect
import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os.path
import sys

import jsl
import jsl.jsl as jsl

MYPATH = os.path.dirname(__file__)
if not getattr(sys, 'frozen', False):
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/compiler_interfaces/schemas/phv_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os.path
import sys

import jsl
import jsl.jsl as jsl

MYPATH = os.path.dirname(__file__)
if not getattr(sys, 'frozen', False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import inspect
import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import inspect
import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import json

import jsl
import jsl.jsl as jsl

########################################################
# Schema Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import json

import jsl
import jsl.jsl as jsl
from schemas.jgf_schema import Graph, GraphEdge, GraphNode, JsonGraphFormatSchema

########################################################
Expand Down
1 change: 0 additions & 1 deletion tools/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ fi
function build_tofino() {
P4C_TOFINO_PACKAGES="rapidjson-dev"
sudo apt-get install -y --no-install-recommends ${P4C_TOFINO_PACKAGES}
sudo pip3 install jsl==0.2.4 pyinstaller==6.11.0
}

if [[ "${ENABLE_TOFINO}" == "ON" ]]; then
Expand Down
Loading