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

T5400: Move libvyosconfig build out of the Docker image #4378

Merged
merged 1 commit into from
Mar 5, 2025
Merged
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
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CFLAGS :=
BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH)
J2LINT := $(shell command -v j2lint 2> /dev/null)
PYLINT_FILES := $(shell git ls-files *.py src/migration-scripts)
LIBVYOSCONFIG_BUILD_PATH := /tmp/libvyosconfig/_build/libvyosconfig.so

config_xml_src = $(wildcard interface-definitions/*.xml.in)
config_xml_obj = $(config_xml_src:.xml.in=.xml)
Expand All @@ -19,9 +20,19 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml)
mkdir -p $(BUILD_DIR)/$(dir $@)
$(CURDIR)/scripts/transclude-template $< > $(BUILD_DIR)/$@

.PHONY: libvyosconfig
.ONESHELL:
libvyosconfig:
if ! [ -f $(LIBVYOSCONFIG_BUILD_PATH) ]; then
git clone https://github.com/vyos/libvyosconfig.git /tmp/libvyosconfig || exit 1
cd /tmp/libvyosconfig && \
git checkout 677d1e2bf8109b9fd4da60e20376f992b747e384 || exit 1
./build.sh
fi

.PHONY: interface_definitions
.ONESHELL:
interface_definitions: $(config_xml_obj)
interface_definitions: $(config_xml_obj) libvyosconfig
mkdir -p $(TMPL_DIR)

$(CURDIR)/scripts/override-default $(BUILD_DIR)/interface-definitions
Expand Down Expand Up @@ -75,7 +86,7 @@ vyshim:
$(MAKE) -C $(SHIM_DIR)

.PHONY: all
all: clean interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json
all: clean libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json

.PHONY: clean
clean:
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Build-Depends:
fakeroot,
gcc,
iproute2,
libvyosconfig0 (>= 0.0.7),
libzmq3-dev,
python3 (>= 3.10),
# For QA
Expand Down
4 changes: 3 additions & 1 deletion python/vyos/configtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

from ctypes import cdll, c_char_p, c_void_p, c_int, c_bool

LIBPATH = '/usr/lib/libvyosconfig.so.0'
BUILD_PATH = '/tmp/libvyosconfig/_build/libvyosconfig.so'
INSTALL_PATH = '/usr/lib/libvyosconfig.so.0'
LIBPATH = BUILD_PATH if os.path.isfile(BUILD_PATH) else INSTALL_PATH


def replace_backslash(s, search, replace):
Expand Down
Loading