···507507 program =
508508 (pkgs.writeShellApplication {
509509 name = "lexgen";
510510+ runtimeInputs = [pkgs.stdenv.cc];
510511 text = ''
511512 if ! command -v lexgen > /dev/null; then
512513 echo "error: must be executed from devshell"
513514 exit 1
514515 fi
516516+517517+ # pin CC to a glibc gcc so a stray musl cc cant mess up CGO
518518+ export CC=${pkgs.stdenv.cc}/bin/cc
515519516520 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
517521 cd "$rootDir"
···528532 sed -i '/^func.*\(MarshalCBOR\|UnmarshalCBOR\)/,/^}/ s/^/\/\/ /' {} +
529533 for f in api/tangled/*_ext.go; do [ -e "''$f" ] && mv "''$f" "''$f.bak"; done
530534 ${pkgs.gotools}/bin/goimports -w api/tangled/*
531531- CGO_ENABLED=0 go run ./cmd/cborgen/
535535+ CGO_ENABLED=1 go run ./cmd/cborgen/
532536 for f in api/tangled/*_ext.go.bak; do [ -e "''$f" ] && mv "''$f" "''${f%.bak}"; done
533537534538 lexgen --build-file lexicon-build-config.json lexicons