Skip to content

Commit

Permalink
frr: Fix cross snmpSupport to remove warning which interferes with …
Browse files Browse the repository at this point in the history
…cross eval

Release eval fails with

```
nix-env failed:
trace: evaluation warning: cannot enable SNMP support due to cross-compilation issues with net-snmp-config
```
  • Loading branch information
Artturin committed Dec 9, 2024
1 parent 2d8a312 commit 9f2266d
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pkgs/by-name/fr/frr/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@
, nettools
, nixosTests

# FRR's configure.ac gets SNMP options by executing net-snmp-config on the build host
# This leads to compilation errors when cross compiling.
# E.g. net-snmp-config for x86_64 does not return the ARM64 paths.
#
# SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
# SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
, snmpSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform

# other general options besides snmp support

# general options
, snmpSupport ? true
, rpkiSupport ? true
, numMultipath ? 64
, watchfrrSupport ? true
Expand Down Expand Up @@ -81,9 +75,6 @@
, ospfApi ? true
}:

lib.warnIf (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform))
"cannot enable SNMP support due to cross-compilation issues with net-snmp-config"

stdenv.mkDerivation (finalAttrs: {
pname = "frr";
version = "10.1";
Expand Down Expand Up @@ -194,6 +185,9 @@ stdenv.mkDerivation (finalAttrs: {
(lib.strings.enableFeature ospfApi "ospfapi")
# Cumulus options
(lib.strings.enableFeature cumulusSupport "cumulus")
] ++ lib.optionals snmpSupport [
# Used during build for paths, `dev` has build shebangs so can be run during build.
"NETSNMP_CONFIG=${lib.getDev net-snmp}/bin/net-snmp-config"
];

postPatch = ''
Expand Down

0 comments on commit 9f2266d

Please sign in to comment.