Skip to content

Commit b09727a

Browse files
committed
fixup build
1 parent 53c58c8 commit b09727a

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
ARG IMAGE=scratch
2+
FROM ${IMAGE} AS frr
3+
# size reduction hack
4+
RUN for frr in /nix/store/*-frr-*; do \
5+
ln -s "${frr}" "$(sed 's|/nix/store/.*-\(.*-frr-.*\)|/nix/store/\1|' <<<"${frr}")"; \
6+
done
27
FROM ${IMAGE} as doc-env
38
FROM ${IMAGE} as compile-env
49

default.nix

+2-4
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@
164164
rtrlib = (optimizedBuild super.rtrlib).overrideAttrs(orig: {
165165
cmakeFlags = (orig.cmakeFlags or []) ++ [ "-DENABLE_STATIC=1" ];
166166
});
167-
c-ares = (optimizedBuild super.c-ares).overrideAttrs(orig: {
168-
cmakeFlags = (orig.cmakeFlags or []) ++ [ "-DCARES_STATIC=ON" ];
169-
});
170167
abseil-cpp = (optimizedBuild super.abseil-cpp);
171168
protobuf_25 = (optimizedBuild super.protobuf_25).overrideAttrs(orig: {
172169
cmakeFlags = (orig.cmakeFlags or []) ++ [ "-Dprotobuf_BUILD_SHARED_LIBS=OFF" ];
@@ -422,13 +419,14 @@
422419
contents = (map clearDeps (with pkgs.release.gnu64; [
423420
bash
424421
coreutils
422+
frr
425423
glibc.bin
426424
glibc.out
427425
gnugrep
426+
gnused
428427
libxcrypt
429428
ncurses
430429
readline
431-
frr
432430
])) ++ [ initfrr ];
433431
config = {
434432
Env = [

justfile

+13-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ _doc_env_container_name := container_repo + "/doc-env"
7070

7171
_compile_env_container_name := container_repo + "/compile-env"
7272

73+
_frr_container_name := container_repo + "/frr"
74+
7375
# This is a unique identifier for the build.
7476
# We temporarily tag our containers with this id so that we can be certain that we are
7577
# not retagging or pushing some other container.
@@ -117,6 +119,11 @@ _nix_build attribute:
117119
build-sysroot: (_nix_build "sysroots") (_nix_build "env.sysroot.gnu64.dev") (_nix_build "env.sysroot.gnu64.release") (_nix_build "env.sysroot.musl64.dev") (_nix_build "env.sysroot.musl64.release") (_nix_build "sysroot")
118120
{{ _just_debug_ }}
119121

122+
# Build FRR
123+
[script]
124+
build-frr: (_nix_build "pkgs.release.gnu64.frr")
125+
{{ _just_debug_ }}
126+
120127
# Builds and post processes a container from the nix build
121128
[private]
122129
[script]
@@ -180,8 +187,11 @@ build-doc-env-container: (_build-container "doc-env" _doc_env_container_name)
180187
# Build and tag the compile-env container
181188
build-compile-env-container: (_build-container "compile-env" _compile_env_container_name)
182189

190+
# Build and tag the frr container
191+
build-frr-container: build-frr (_build-container "frr" _frr_container_name)
192+
183193
# Build the sysroot, and compile-env containers
184-
build: build-sysroot build-compile-env-container build-doc-env-container
194+
build: build-sysroot build-frr-container build-compile-env-container build-doc-env-container
185195

186196
# Push the compile-env and doc-env containers to the container registry
187197
[script]
@@ -191,6 +201,8 @@ push: build
191201
docker push "{{ _compile_env_container_name }}:{{ _commit }}.rust-{{ rust }}"
192202
docker push "{{ _doc_env_container_name }}:{{ _slug }}.rust-{{ rust }}"
193203
docker push "{{ _doc_env_container_name }}:{{ _commit }}.rust-{{ rust }}"
204+
docker push "{{ _frr_container_name }}:{{ _slug }}.rust-{{ rust }}"
205+
docker push "{{ _frr_container_name }}:{{ _commit }}.rust-{{ rust }}"
194206

195207
# Delete all the old generations of the nix store and run the garbage collector
196208
[script]

nix/dpdk-wrapper/default.nix

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
bintools
1616
];
1717

18-
CFLAGS=""; # in case no override is provided
19-
2018
buildPhase = ''
2119
set euxo pipefail
2220
mkdir -p $out/{lib,include}

nix/frr/default.nix

+9-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# other general options besides snmp support
4444
, rpkiSupport ? false
4545
, numMultipath ? 8
46-
, watchfrrSupport ? false
46+
, watchfrrSupport ? true
4747
, cumulusSupport ? false
4848
, rtadvSupport ? true
4949
, irdpSupport ? false
@@ -211,7 +211,14 @@ stdenv.mkDerivation (finalAttrs: {
211211
make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" -j32
212212
cd zebra
213213
ls -lah
214-
$CC $CFLAGS $LDFLAGS -I /build/source -I /build/source/lib -I /build/source/lib/zebra -o sample_plugin.so -shared -fPIC sample_plugin.c
214+
$CC $CFLAGS $LDFLAGS \
215+
-I /build/source \
216+
-I /build/source/lib \
217+
-I /build/source/lib/zebra \
218+
-o sample_plugin.so \
219+
-shared \
220+
-fPIC \
221+
sample_plugin.c
215222
mkdir -p $out/lib/frr/modules
216223
cp sample_plugin.so $out/lib/frr/modules
217224
cd ..

0 commit comments

Comments
 (0)