2016-07-29 21:48:20 +02: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-29 22:44:28 +02:00
|
|
|
package config
|
2016-07-29 21:48:20 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"android/soong/android"
|
2020-04-13 19:21:23 +02:00
|
|
|
"android/soong/remoteexec"
|
2016-07-29 21:48:20 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2017-05-23 01:11:34 +02: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-29 21:48:20 +02:00
|
|
|
commonGlobalCflags = []string{
|
|
|
|
"-DANDROID",
|
|
|
|
"-fmessage-length=0",
|
|
|
|
"-W",
|
|
|
|
"-Wall",
|
|
|
|
"-Wno-unused",
|
|
|
|
"-Winit-self",
|
|
|
|
"-Wpointer-arith",
|
2020-02-23 04:28:56 +01:00
|
|
|
"-Wunreachable-code-loop-increment",
|
2016-07-29 21:48:20 +02:00
|
|
|
|
2017-11-03 06:38:32 +01:00
|
|
|
// Make paths in deps files relative
|
|
|
|
"-no-canonical-prefixes",
|
2017-11-06 21:53:30 +01:00
|
|
|
"-fno-canonical-system-headers",
|
2017-11-03 06:38:32 +01:00
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
"-DNDEBUG",
|
|
|
|
"-UDEBUG",
|
2017-11-03 06:38:32 +01:00
|
|
|
|
|
|
|
"-fno-exceptions",
|
|
|
|
"-Wno-multichar",
|
|
|
|
|
|
|
|
"-O2",
|
|
|
|
"-g",
|
2020-11-03 18:44:15 +01:00
|
|
|
"-fdebug-info-for-profiling",
|
2017-11-03 06:38:32 +01:00
|
|
|
|
|
|
|
"-fno-strict-aliasing",
|
2019-08-28 04:37:10 +02:00
|
|
|
|
|
|
|
"-Werror=date-time",
|
2019-12-04 03:13:00 +01:00
|
|
|
"-Werror=pragma-pack",
|
|
|
|
"-Werror=pragma-pack-suspicious-include",
|
2020-11-11 23:41:32 +01:00
|
|
|
"-Werror=string-plus-int",
|
2020-02-23 04:28:56 +01:00
|
|
|
"-Werror=unreachable-code-loop-increment",
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
|
|
|
|
2016-10-17 23:19:06 +02:00
|
|
|
commonGlobalConlyflags = []string{}
|
2016-10-07 22:12:58 +02:00
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
deviceGlobalCflags = []string{
|
|
|
|
"-fdiagnostics-color",
|
|
|
|
|
2017-11-03 06:55:19 +01:00
|
|
|
"-ffunction-sections",
|
2017-11-06 23:02:02 +01:00
|
|
|
"-fdata-sections",
|
|
|
|
"-fno-short-enums",
|
2017-11-03 06:55:19 +01:00
|
|
|
"-funwind-tables",
|
|
|
|
"-fstack-protector-strong",
|
|
|
|
"-Wa,--noexecstack",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
|
|
|
|
"-Wstrict-aliasing=2",
|
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
"-Werror=return-type",
|
|
|
|
"-Werror=non-virtual-dtor",
|
|
|
|
"-Werror=address",
|
|
|
|
"-Werror=sequence-point",
|
2017-11-03 06:55:19 +01:00
|
|
|
"-Werror=format-security",
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
|
|
|
|
2017-11-06 22:59:48 +01: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 07:09:41 +01: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 04:18:53 +01: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 02:57:50 +02:00
|
|
|
"-Wl,--exclude-libs,libgcc.a",
|
2019-05-07 01:18:33 +02:00
|
|
|
"-Wl,--exclude-libs,libgcc_stripped.a",
|
2019-12-11 03:37:45 +01:00
|
|
|
"-Wl,--exclude-libs,libunwind_llvm.a",
|
2021-01-14 04:18:53 +01:00
|
|
|
"-Wl,--exclude-libs,libunwind.a",
|
2021-03-23 07:05:22 +01:00
|
|
|
"-Wl,--icf=safe",
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
|
|
|
|
2018-04-03 20:33:34 +02:00
|
|
|
deviceGlobalLldflags = append(ClangFilterUnknownLldflags(deviceGlobalLdflags),
|
|
|
|
[]string{
|
|
|
|
"-fuse-ld=lld",
|
|
|
|
}...)
|
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
hostGlobalCflags = []string{}
|
|
|
|
|
2017-11-06 22:59:48 +01: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 07:09:41 +01:00
|
|
|
hostGlobalLdflags = []string{}
|
|
|
|
|
2018-04-17 23:16:05 +02:00
|
|
|
hostGlobalLldflags = []string{"-fuse-ld=lld"}
|
2018-04-03 20:33:34 +02:00
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
commonGlobalCppflags = []string{
|
|
|
|
"-Wsign-promo",
|
|
|
|
}
|
|
|
|
|
|
|
|
noOverrideGlobalCflags = []string{
|
2020-11-11 23:41:32 +01:00
|
|
|
"-Werror=bool-operation",
|
|
|
|
"-Werror=implicit-int-float-conversion",
|
|
|
|
"-Werror=int-in-bool-context",
|
2016-07-29 21:48:20 +02:00
|
|
|
"-Werror=int-to-pointer-cast",
|
|
|
|
"-Werror=pointer-to-int-cast",
|
2020-11-11 23:41:32 +01:00
|
|
|
"-Werror=string-compare",
|
|
|
|
"-Werror=xor-used-as-pow",
|
2020-07-15 20:11:57 +02: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 02:52:05 +02:00
|
|
|
"-Werror=fortify-source",
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
|
|
|
|
2016-07-29 22:44:28 +02:00
|
|
|
IllegalFlags = []string{
|
2016-07-29 21:48:20 +02:00
|
|
|
"-w",
|
|
|
|
}
|
2016-10-17 23:19:06 +02:00
|
|
|
|
2017-02-04 01:13:38 +01:00
|
|
|
CStdVersion = "gnu99"
|
2018-11-30 17:03:06 +01:00
|
|
|
CppStdVersion = "gnu++17"
|
2017-02-04 01:13:38 +01:00
|
|
|
ExperimentalCStdVersion = "gnu11"
|
2018-11-28 23:16:39 +01:00
|
|
|
ExperimentalCppStdVersion = "gnu++2a"
|
2017-05-09 19:21:52 +02:00
|
|
|
|
2017-05-23 01:11:34 +02:00
|
|
|
// prebuilts/clang default settings.
|
|
|
|
ClangDefaultBase = "prebuilts/clang/host"
|
2021-04-15 19:01:22 +02:00
|
|
|
ClangDefaultVersion = "clang-r416183b"
|
|
|
|
ClangDefaultShortVersion = "12.0.5"
|
2017-11-14 23:09:14 +01:00
|
|
|
|
2017-12-25 07:24:47 +01:00
|
|
|
// Directories with warnings from Android.bp files.
|
2017-11-14 23:09:14 +01:00
|
|
|
WarningAllowedProjects = []string{
|
|
|
|
"device/",
|
|
|
|
"vendor/",
|
|
|
|
}
|
|
|
|
|
2017-12-25 07:24:47 +01:00
|
|
|
// Directories with warnings from Android.mk files.
|
|
|
|
WarningAllowedOldProjects = []string{}
|
2016-07-29 21:48:20 +02:00
|
|
|
)
|
|
|
|
|
2016-07-29 22:44:28 +02:00
|
|
|
var pctx = android.NewPackageContext("android/soong/cc/config")
|
|
|
|
|
2016-07-29 21:48:20 +02:00
|
|
|
func init() {
|
2020-10-20 07:52:49 +02:00
|
|
|
if android.BuildOs == android.Linux {
|
|
|
|
commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
|
|
|
|
}
|
|
|
|
|
2016-10-07 22:12:58 +02:00
|
|
|
pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
|
2017-11-06 22:59:48 +01: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 07:09:41 +01:00
|
|
|
pctx.StaticVariable("DeviceGlobalLdflags", strings.Join(deviceGlobalLdflags, " "))
|
2018-04-03 20:33:34 +02:00
|
|
|
pctx.StaticVariable("DeviceGlobalLldflags", strings.Join(deviceGlobalLldflags, " "))
|
2017-11-06 22:59:48 +01: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 07:09:41 +01:00
|
|
|
pctx.StaticVariable("HostGlobalLdflags", strings.Join(hostGlobalLdflags, " "))
|
2018-04-03 20:33:34 +02:00
|
|
|
pctx.StaticVariable("HostGlobalLldflags", strings.Join(hostGlobalLldflags, " "))
|
2016-07-29 21:48:20 +02:00
|
|
|
|
2019-06-11 02:40:12 +02: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 02:59:09 +02:00
|
|
|
// Prefer zero-init if multiple options are set.
|
2019-06-11 02:40:12 +02: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-28 23:43:11 +01:00
|
|
|
} else if ctx.Config().IsEnvTrue("AUTO_UNINITIALIZE") {
|
|
|
|
flags = append(flags, "-ftrivial-auto-var-init=uninitialized")
|
2020-01-31 00:06:00 +01:00
|
|
|
} else {
|
2020-05-14 02:59:09 +02: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 02:40:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return strings.Join(flags, " ")
|
|
|
|
})
|
|
|
|
|
2019-01-17 23:44:05 +01: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-29 22:44:28 +02:00
|
|
|
pctx.StaticVariable("HostClangGlobalCflags",
|
|
|
|
strings.Join(ClangFilterUnknownCflags(hostGlobalCflags), " "))
|
|
|
|
pctx.StaticVariable("NoOverrideClangGlobalCflags",
|
|
|
|
strings.Join(append(ClangFilterUnknownCflags(noOverrideGlobalCflags), "${ClangExtraNoOverrideCflags}"), " "))
|
2016-07-29 21:48:20 +02:00
|
|
|
|
2016-07-29 22:44:28 +02:00
|
|
|
pctx.StaticVariable("CommonClangGlobalCppflags",
|
|
|
|
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " "))
|
2016-07-29 21:48:20 +02:00
|
|
|
|
2018-06-06 23:42:44 +02:00
|
|
|
pctx.StaticVariable("ClangExternalCflags", "${ClangExtraExternalCflags}")
|
|
|
|
|
2016-09-15 18:30:46 +02:00
|
|
|
// Everything in these lists is a crime against abstraction and dependency tracking.
|
2016-07-29 21:48:20 +02:00
|
|
|
// Do not add anything to this list.
|
2017-04-11 00:47:24 +02:00
|
|
|
pctx.PrefixedExistentPathsForSourcesVariable("CommonGlobalIncludes", "-I",
|
2016-09-23 00:29:50 +02:00
|
|
|
[]string{
|
2016-09-23 17:48:51 +02:00
|
|
|
"system/core/include",
|
2020-10-09 23:49:58 +02:00
|
|
|
"system/logging/liblog/include",
|
2016-10-05 21:36:42 +02:00
|
|
|
"system/media/audio/include",
|
2016-10-05 21:36:42 +02:00
|
|
|
"hardware/libhardware/include",
|
2016-11-03 23:45:34 +01:00
|
|
|
"hardware/libhardware_legacy/include",
|
|
|
|
"hardware/ril/include",
|
2016-10-05 21:36:42 +02:00
|
|
|
"frameworks/native/include",
|
2016-12-14 20:13:16 +01:00
|
|
|
"frameworks/native/opengl/include",
|
2016-07-29 21:48:20 +02:00
|
|
|
"frameworks/av/include",
|
|
|
|
})
|
|
|
|
|
2017-05-23 01:11:34 +02:00
|
|
|
pctx.SourcePathVariable("ClangDefaultBase", ClangDefaultBase)
|
2018-03-12 21:24:09 +01:00
|
|
|
pctx.VariableFunc("ClangBase", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_PREBUILTS_BASE"); override != "" {
|
|
|
|
return override
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
2018-03-12 21:24:09 +01:00
|
|
|
return "${ClangDefaultBase}"
|
2016-07-29 21:48:20 +02:00
|
|
|
})
|
2018-03-12 21:24:09 +01:00
|
|
|
pctx.VariableFunc("ClangVersion", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
|
|
|
|
return override
|
2016-07-29 21:48:20 +02:00
|
|
|
}
|
2018-03-12 21:24:09 +01:00
|
|
|
return ClangDefaultVersion
|
2016-07-29 21:48:20 +02:00
|
|
|
})
|
2016-07-29 22:44:28 +02:00
|
|
|
pctx.StaticVariable("ClangPath", "${ClangBase}/${HostPrebuiltTag}/${ClangVersion}")
|
|
|
|
pctx.StaticVariable("ClangBin", "${ClangPath}/bin")
|
|
|
|
|
2018-03-12 21:24:09 +01:00
|
|
|
pctx.VariableFunc("ClangShortVersion", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("LLVM_RELEASE_VERSION"); override != "" {
|
|
|
|
return override
|
2016-11-19 02:12:38 +01:00
|
|
|
}
|
2018-03-12 21:24:09 +01:00
|
|
|
return ClangDefaultShortVersion
|
2016-11-19 02:12:38 +01:00
|
|
|
})
|
2018-01-25 04:58:36 +01:00
|
|
|
pctx.StaticVariable("ClangAsanLibDir", "${ClangBase}/linux-x86/${ClangVersion}/lib64/clang/${ClangShortVersion}/lib/linux")
|
2016-08-26 21:55:49 +02:00
|
|
|
|
2017-02-02 04:19:52 +01: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 00:47:24 +02:00
|
|
|
pctx.PrefixedExistentPathsForSourcesVariable("RsGlobalIncludes", "-I",
|
2017-05-02 02:37:24 +02:00
|
|
|
[]string{
|
|
|
|
"external/clang/lib/Headers",
|
|
|
|
"frameworks/rs/script_api/include",
|
|
|
|
})
|
|
|
|
|
2018-03-12 21:24:09 +01:00
|
|
|
pctx.VariableFunc("CcWrapper", func(ctx android.PackageVarContext) string {
|
|
|
|
if override := ctx.Config().Getenv("CC_WRAPPER"); override != "" {
|
|
|
|
return override + " "
|
2016-08-26 21:55:49 +02:00
|
|
|
}
|
2018-03-12 21:24:09 +01:00
|
|
|
return ""
|
2016-08-26 21:55:49 +02:00
|
|
|
})
|
2020-04-13 19:21:23 +02:00
|
|
|
|
2021-03-12 20:28:25 +01: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-29 21:48:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
|
|
|
|
|
2020-04-13 19:21:23 +02: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
|
|
|
|
}
|
|
|
|
}
|