2016-07-30 03:48:20 +08:00
|
|
|
// Copyright 2016 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2016-07-30 04:44:28 +08:00
|
|
|
package config
|
2016-07-30 03:48:20 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"android/soong/android"
|
2020-04-14 01:21:23 +08:00
|
|
|
"android/soong/remoteexec"
|
2016-07-30 03:48:20 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2017-05-23 07:11:34 +08:00
|
|
|
// Flags used by lots of devices. Putting them in package static variables
|
|
|
|
// will save bytes in build.ninja so they aren't repeated for every file
|
2016-07-30 03:48:20 +08:00
|
|
|
commonGlobalCflags = []string{
|
|
|
|
"-DANDROID",
|
|
|
|
"-fmessage-length=0",
|
|
|
|
"-W",
|
|
|
|
"-Wall",
|
|
|
|
"-Wno-unused",
|
|
|
|
"-Winit-self",
|
|
|
|
"-Wpointer-arith",
|
2020-02-23 11:28:56 +08:00
|
|
|
"-Wunreachable-code-loop-increment",
|
2016-07-30 03:48:20 +08:00
|
|
|
|
2017-11-03 13:38:32 +08:00
|
|
|
// Make paths in deps files relative
|
|
|
|
"-no-canonical-prefixes",
|
2017-11-07 04:53:30 +08:00
|
|
|
"-fno-canonical-system-headers",
|
2017-11-03 13:38:32 +08:00
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
"-DNDEBUG",
|
|
|
|
"-UDEBUG",
|
2017-11-03 13:38:32 +08:00
|
|
|
|
|
|
|
"-fno-exceptions",
|
|
|
|
"-Wno-multichar",
|
|
|
|
|
|
|
|
"-O2",
|
|
|
|
"-g",
|
2020-11-04 01:44:15 +08:00
|
|
|
"-fdebug-info-for-profiling",
|
2017-11-03 13:38:32 +08:00
|
|
|
|
|
|
|
"-fno-strict-aliasing",
|
2019-08-28 10:37:10 +08:00
|
|
|
|
|
|
|
"-Werror=date-time",
|
2019-12-04 10:13:00 +08:00
|
|
|
"-Werror=pragma-pack",
|
|
|
|
"-Werror=pragma-pack-suspicious-include",
|
2020-11-12 06:41:32 +08:00
|
|
|
"-Werror=string-plus-int",
|
2020-02-23 11:28:56 +08:00
|
|
|
"-Werror=unreachable-code-loop-increment",
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
|
|
|
|
2016-10-18 05:19:06 +08:00
|
|
|
commonGlobalConlyflags = []string{}
|
2016-10-08 04:12:58 +08:00
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
deviceGlobalCflags = []string{
|
|
|
|
"-fdiagnostics-color",
|
|
|
|
|
2017-11-03 13:55:19 +08:00
|
|
|
"-ffunction-sections",
|
2017-11-07 06:02:02 +08:00
|
|
|
"-fdata-sections",
|
|
|
|
"-fno-short-enums",
|
2017-11-03 13:55:19 +08:00
|
|
|
"-funwind-tables",
|
|
|
|
"-fstack-protector-strong",
|
|
|
|
"-Wa,--noexecstack",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
|
|
|
|
"-Wstrict-aliasing=2",
|
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
"-Werror=return-type",
|
|
|
|
"-Werror=non-virtual-dtor",
|
|
|
|
"-Werror=address",
|
|
|
|
"-Werror=sequence-point",
|
2017-11-03 13:55:19 +08:00
|
|
|
"-Werror=format-security",
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
|
|
|
|
2017-11-07 05:59:48 +08:00
|
|
|
deviceGlobalCppflags = []string{
|
|
|
|
"-fvisibility-inlines-hidden",
|
|
|
|
}
|
|
|
|
|
Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version
Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 14:09:41 +08:00
|
|
|
deviceGlobalLdflags = []string{
|
|
|
|
"-Wl,-z,noexecstack",
|
|
|
|
"-Wl,-z,relro",
|
|
|
|
"-Wl,-z,now",
|
|
|
|
"-Wl,--build-id=md5",
|
|
|
|
"-Wl,--warn-shared-textrel",
|
|
|
|
"-Wl,--fatal-warnings",
|
|
|
|
"-Wl,--no-undefined-version",
|
2021-01-14 11:18:53 +08:00
|
|
|
// TODO: Eventually we should link against a libunwind.a with hidden symbols, and then these
|
|
|
|
// --exclude-libs arguments can be removed.
|
2019-04-11 08:57:50 +08:00
|
|
|
"-Wl,--exclude-libs,libgcc.a",
|
2019-05-07 07:18:33 +08:00
|
|
|
"-Wl,--exclude-libs,libgcc_stripped.a",
|
2019-12-11 10:37:45 +08:00
|
|
|
"-Wl,--exclude-libs,libunwind_llvm.a",
|
2021-01-14 11:18:53 +08:00
|
|
|
"-Wl,--exclude-libs,libunwind.a",
|
2021-03-23 14:05:22 +08:00
|
|
|
"-Wl,--icf=safe",
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
|
|
|
|
2018-04-04 02:33:34 +08:00
|
|
|
deviceGlobalLldflags = append(ClangFilterUnknownLldflags(deviceGlobalLdflags),
|
|
|
|
[]string{
|
|
|
|
"-fuse-ld=lld",
|
|
|
|
}...)
|
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
hostGlobalCflags = []string{}
|
|
|
|
|
2017-11-07 05:59:48 +08:00
|
|
|
hostGlobalCppflags = []string{}
|
|
|
|
|
Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version
Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 14:09:41 +08:00
|
|
|
hostGlobalLdflags = []string{}
|
|
|
|
|
2018-04-18 05:16:05 +08:00
|
|
|
hostGlobalLldflags = []string{"-fuse-ld=lld"}
|
2018-04-04 02:33:34 +08:00
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
commonGlobalCppflags = []string{
|
|
|
|
"-Wsign-promo",
|
|
|
|
}
|
|
|
|
|
|
|
|
noOverrideGlobalCflags = []string{
|
2020-11-12 06:41:32 +08:00
|
|
|
"-Werror=bool-operation",
|
|
|
|
"-Werror=implicit-int-float-conversion",
|
|
|
|
"-Werror=int-in-bool-context",
|
2016-07-30 03:48:20 +08:00
|
|
|
"-Werror=int-to-pointer-cast",
|
|
|
|
"-Werror=pointer-to-int-cast",
|
2020-11-12 06:41:32 +08:00
|
|
|
"-Werror=string-compare",
|
|
|
|
"-Werror=xor-used-as-pow",
|
2020-07-16 02:11:57 +08:00
|
|
|
// http://b/161386391 for -Wno-void-pointer-to-enum-cast
|
|
|
|
"-Wno-void-pointer-to-enum-cast",
|
|
|
|
// http://b/161386391 for -Wno-void-pointer-to-int-cast
|
|
|
|
"-Wno-void-pointer-to-int-cast",
|
|
|
|
// http://b/161386391 for -Wno-pointer-to-int-cast
|
|
|
|
"-Wno-pointer-to-int-cast",
|
2019-09-19 08:52:05 +08:00
|
|
|
"-Werror=fortify-source",
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
|
|
|
|
2016-07-30 04:44:28 +08:00
|
|
|
IllegalFlags = []string{
|
2016-07-30 03:48:20 +08:00
|
|
|
"-w",
|
|
|
|
}
|
2016-10-18 05:19:06 +08:00
|
|
|
|
2017-02-04 08:13:38 +08:00
|
|
|
CStdVersion = "gnu99"
|
2018-12-01 00:03:06 +08:00
|
|
|
CppStdVersion = "gnu++17"
|
2017-02-04 08:13:38 +08:00
|
|
|
ExperimentalCStdVersion = "gnu11"
|
2018-11-29 06:16:39 +08:00
|
|
|
ExperimentalCppStdVersion = "gnu++2a"
|
2017-05-10 01:21:52 +08:00
|
|
|
|
2017-05-23 07:11:34 +08:00
|
|
|
// prebuilts/clang default settings.
|
|
|
|
ClangDefaultBase = "prebuilts/clang/host"
|
2021-04-16 01:01:22 +08:00
|
|
|
ClangDefaultVersion = "clang-r416183b"
|
|
|
|
ClangDefaultShortVersion = "12.0.5"
|
2017-11-15 06:09:14 +08:00
|
|
|
|
2017-12-25 14:24:47 +08:00
|
|
|
// Directories with warnings from Android.bp files.
|
2017-11-15 06:09:14 +08:00
|
|
|
WarningAllowedProjects = []string{
|
|
|
|
"device/",
|
|
|
|
"vendor/",
|
|
|
|
}
|
|
|
|
|
2017-12-25 14:24:47 +08:00
|
|
|
// Directories with warnings from Android.mk files.
|
|
|
|
WarningAllowedOldProjects = []string{}
|
2016-07-30 03:48:20 +08:00
|
|
|
)
|
|
|
|
|
2016-07-30 04:44:28 +08:00
|
|
|
var pctx = android.NewPackageContext("android/soong/cc/config")
|
|
|
|
|
2016-07-30 03:48:20 +08:00
|
|
|
func init() {
|
2020-10-20 13:52:49 +08:00
|
|
|
if android.BuildOs == android.Linux {
|
|
|
|
commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
|
|
|
|
}
|
|
|
|
|
2016-10-08 04:12:58 +08:00
|
|
|
pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
|
2017-11-07 05:59:48 +08:00
|
|
|
pctx.StaticVariable("DeviceGlobalCppflags", strings.Join(deviceGlobalCppflags, " "))
|
Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version
Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 14:09:41 +08:00
|
|
|
pctx.StaticVariable("DeviceGlobalLdflags", strings.Join(deviceGlobalLdflags, " "))
|
2018-04-04 02:33:34 +08:00
|
|
|
pctx.StaticVariable("DeviceGlobalLldflags", strings.Join(deviceGlobalLldflags, " "))
|
2017-11-07 05:59:48 +08:00
|
|
|
pctx.StaticVariable("HostGlobalCppflags", strings.Join(hostGlobalCppflags, " "))
|
Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version
Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 14:09:41 +08:00
|
|
|
pctx.StaticVariable("HostGlobalLdflags", strings.Join(hostGlobalLdflags, " "))
|
2018-04-04 02:33:34 +08:00
|
|
|
pctx.StaticVariable("HostGlobalLldflags", strings.Join(hostGlobalLldflags, " "))
|
2016-07-30 03:48:20 +08:00
|
|
|
|
2019-06-11 08:40:12 +08:00
|
|
|
pctx.VariableFunc("CommonClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
|
|
|
flags := ClangFilterUnknownCflags(commonGlobalCflags)
|
|
|
|
flags = append(flags, "${ClangExtraCflags}")
|
|
|
|
|
|
|
|
// http://b/131390872
|
|
|
|
// Automatically initialize any uninitialized stack variables.
|
2020-05-14 08:59:09 +08:00
|
|
|
// Prefer zero-init if multiple options are set.
|
2019-06-11 08:40:12 +08:00
|
|
|
if ctx.Config().IsEnvTrue("AUTO_ZERO_INITIALIZE") {
|
|
|
|
flags = append(flags, "-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang")
|
|
|
|
} else if ctx.Config().IsEnvTrue("AUTO_PATTERN_INITIALIZE") {
|
|
|
|
flags = append(flags, "-ftrivial-auto-var-init=pattern")
|
2020-01-29 06:43:11 +08:00
|
|
|
} else if ctx.Config().IsEnvTrue("AUTO_UNINITIALIZE") {
|
|
|
|
flags = append(flags, "-ftrivial-auto-var-init=uninitialized")
|
2020-01-31 07:06:00 +08:00
|
|
|
} else {
|
2020-05-14 08:59:09 +08:00
|
|
|
// Default to zero initialization.
|
|
|
|
flags = append(flags, "-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang")
|
2019-06-11 08:40:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return strings.Join(flags, " ")
|
|
|
|
})
|
|
|
|
|
2019-01-18 06:44:05 +08:00
|
|
|
pctx.VariableFunc("DeviceClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
|
|
|
if ctx.Config().Fuchsia() {
|
|
|
|
return strings.Join(ClangFilterUnknownCflags(deviceGlobalCflags), " ")
|
|
|
|
} else {
|
|
|
|
return strings.Join(append(ClangFilterUnknownCflags(deviceGlobalCflags), "${ClangExtraTargetCflags}"), " ")
|
|
|
|
}
|
|
|
|
})
|
2016-07-30 04:44:28 +08:00
|
|
|
pctx.StaticVariable("HostClangGlobalCflags",
|
|
|
|
strings.Join(ClangFilterUnknownCflags(hostGlobalCflags), " "))
|
|
|
|
pctx.StaticVariable("NoOverrideClangGlobalCflags",
|
|
|
|
strings.Join(append(ClangFilterUnknownCflags(noOverrideGlobalCflags), "${ClangExtraNoOverrideCflags}"), " "))
|
2016-07-30 03:48:20 +08:00
|
|
|
|
2016-07-30 04:44:28 +08:00
|
|
|
pctx.StaticVariable("CommonClangGlobalCppflags",
|
|
|
|
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " "))
|
2016-07-30 03:48:20 +08:00
|
|
|
|
2018-06-07 05:42:44 +08:00
|
|
|
pctx.StaticVariable("ClangExternalCflags", "${ClangExtraExternalCflags}")
|
|
|
|
|
2016-09-16 00:30:46 +08:00
|
|
|
// Everything in these lists is a crime against abstraction and dependency tracking.
|
2016-07-30 03:48:20 +08:00
|
|
|
// Do not add anything to this list.
|
2017-04-11 06:47:24 +08:00
|
|
|
pctx.PrefixedExistentPathsForSourcesVariable("CommonGlobalIncludes", "-I",
|
2016-09-23 06:29:50 +08:00
|
|
|
[]string{
|
2016-09-23 23:48:51 +08:00
|
|
|
"system/core/include",
|
2020-10-10 05:49:58 +08:00
|
|
|
"system/logging/liblog/include",
|
2016-10-06 03:36:42 +08:00
|
|
|
"system/media/audio/include",
|
2016-10-06 03:36:42 +08:00
|
|
|
"hardware/libhardware/include",
|
2016-11-04 06:45:34 +08:00
|
|
|
"hardware/libhardware_legacy/include",
|
|
|
|
"hardware/ril/include",
|
2016-10-06 03:36:42 +08:00
|
|
|
"frameworks/native/include",
|
2016-12-15 03:13:16 +08:00
|
|
|
"frameworks/native/opengl/include",
|
2016-07-30 03:48:20 +08:00
|
|
|
"frameworks/av/include",
|
|
|
|
})
|
|
|
|
|
2017-05-23 07:11:34 +08:00
|
|
|
pctx.SourcePathVariable("ClangDefaultBase", ClangDefaultBase)
|
2018-03-13 04:24:09 +08:00
|
|
|
pctx.VariableFunc("ClangBase", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_PREBUILTS_BASE"); override != "" {
|
|
|
|
return override
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
2018-03-13 04:24:09 +08:00
|
|
|
return "${ClangDefaultBase}"
|
2016-07-30 03:48:20 +08:00
|
|
|
})
|
2018-03-13 04:24:09 +08:00
|
|
|
pctx.VariableFunc("ClangVersion", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
|
|
|
|
return override
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
2018-03-13 04:24:09 +08:00
|
|
|
return ClangDefaultVersion
|
2016-07-30 03:48:20 +08:00
|
|
|
})
|
2016-07-30 04:44:28 +08:00
|
|
|
pctx.StaticVariable("ClangPath", "${ClangBase}/${HostPrebuiltTag}/${ClangVersion}")
|
|
|
|
pctx.StaticVariable("ClangBin", "${ClangPath}/bin")
|
|
|
|
|
2018-03-13 04:24:09 +08:00
|
|
|
pctx.VariableFunc("ClangShortVersion", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_RELEASE_VERSION"); override != "" {
|
|
|
|
return override
|
2016-11-19 09:12:38 +08:00
|
|
|
}
|
2018-03-13 04:24:09 +08:00
|
|
|
return ClangDefaultShortVersion
|
2016-11-19 09:12:38 +08:00
|
|
|
})
|
2018-01-25 11:58:36 +08:00
|
|
|
pctx.StaticVariable("ClangAsanLibDir", "${ClangBase}/linux-x86/${ClangVersion}/lib64/clang/${ClangShortVersion}/lib/linux")
|
2016-08-27 03:55:49 +08:00
|
|
|
|
2017-02-02 11:19:52 +08:00
|
|
|
// These are tied to the version of LLVM directly in external/llvm, so they might trail the host prebuilts
|
|
|
|
// being used for the rest of the build process.
|
|
|
|
pctx.SourcePathVariable("RSClangBase", "prebuilts/clang/host")
|
|
|
|
pctx.SourcePathVariable("RSClangVersion", "clang-3289846")
|
|
|
|
pctx.SourcePathVariable("RSReleaseVersion", "3.8")
|
|
|
|
pctx.StaticVariable("RSLLVMPrebuiltsPath", "${RSClangBase}/${HostPrebuiltTag}/${RSClangVersion}/bin")
|
|
|
|
pctx.StaticVariable("RSIncludePath", "${RSLLVMPrebuiltsPath}/../lib64/clang/${RSReleaseVersion}/include")
|
|
|
|
|
2017-04-11 06:47:24 +08:00
|
|
|
pctx.PrefixedExistentPathsForSourcesVariable("RsGlobalIncludes", "-I",
|
2017-05-02 08:37:24 +08:00
|
|
|
[]string{
|
|
|
|
"external/clang/lib/Headers",
|
|
|
|
"frameworks/rs/script_api/include",
|
|
|
|
})
|
|
|
|
|
2018-03-13 04:24:09 +08:00
|
|
|
pctx.VariableFunc("CcWrapper", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("CC_WRAPPER"); override != "" {
|
|
|
|
return override + " "
|
2016-08-27 03:55:49 +08:00
|
|
|
}
|
2018-03-13 04:24:09 +08:00
|
|
|
return ""
|
2016-08-27 03:55:49 +08:00
|
|
|
})
|
2020-04-14 01:21:23 +08:00
|
|
|
|
2021-03-13 03:28:25 +08:00
|
|
|
pctx.StaticVariableWithEnvOverride("RECXXPool", "RBE_CXX_POOL", remoteexec.DefaultPool)
|
|
|
|
pctx.StaticVariableWithEnvOverride("RECXXLinksPool", "RBE_CXX_LINKS_POOL", remoteexec.DefaultPool)
|
|
|
|
pctx.StaticVariableWithEnvOverride("REClangTidyPool", "RBE_CLANG_TIDY_POOL", remoteexec.DefaultPool)
|
|
|
|
pctx.StaticVariableWithEnvOverride("RECXXLinksExecStrategy", "RBE_CXX_LINKS_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
|
|
|
|
pctx.StaticVariableWithEnvOverride("REClangTidyExecStrategy", "RBE_CLANG_TIDY_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
|
|
|
|
pctx.StaticVariableWithEnvOverride("REAbiDumperExecStrategy", "RBE_ABI_DUMPER_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
|
|
|
|
pctx.StaticVariableWithEnvOverride("REAbiLinkerExecStrategy", "RBE_ABI_LINKER_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
|
2016-07-30 03:48:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
|
|
|
|
|
2020-04-14 01:21:23 +08:00
|
|
|
func envOverrideFunc(envVar, defaultVal string) func(ctx android.PackageVarContext) string {
|
|
|
|
return func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv(envVar); override != "" {
|
|
|
|
return override
|
|
|
|
}
|
|
|
|
return defaultVal
|
|
|
|
}
|
|
|
|
}
|