Skip to content

Commit

Permalink
Merge pull request #4378 from jestabro/libvyosconfig-build
Browse files Browse the repository at this point in the history
T5400: Move libvyosconfig build out of the Docker image
  • Loading branch information
jestabro authored Mar 5, 2025
2 parents 99d929d + 731195c commit 67a4363
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
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

0 comments on commit 67a4363

Please sign in to comment.