From 4691f00a63750b14970b71bc9dbb9bd04c8335a8 Mon Sep 17 00:00:00 2001 From: jonmeow <46229924+jonmeow@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:02:20 -0800 Subject: [PATCH] Initialize terminfo.bzl linkopts to None The underlying issue here is that line 125 checks if linkopts was assigned (by line 120) but it's not initialized, so that becomes a crash. This was noticed by someone trying to use Docker, so no terminfo library installed. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D118270 --- utils/bazel/terminfo.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/bazel/terminfo.bzl b/utils/bazel/terminfo.bzl index 2505f7627239..70281e111965 100644 --- a/utils/bazel/terminfo.bzl +++ b/utils/bazel/terminfo.bzl @@ -113,6 +113,7 @@ def _llvm_terminfo_system_impl(repository_ctx): # these would be provided as lists, but Bazel doesn't currently # support that. See: https://github.com/bazelbuild/bazel/issues/12178 linkopts_candidates = [[x] for x in repository_ctx.attr.candidate_system_linkopts] + linkopts = None # For each candidate, try to use it to link our test source file. for linkopts_candidate in linkopts_candidates: