Lines Matching +full:build +full:- +full:clang

191             if path[-1] == name:
201 from_name = path[-1]
206 Return post-order list of node names.
219 Print pre-order node names with indentation denoting node depth level.
278 cmd = ["make", "-n", target]
289 "-j",
292 "-l",
295 "-O",
311 check_call_cmd("sudo", "-n", "--", "ldconfig")
343 build = pkg.build_system()
344 if not build:
345 raise Exception(f"Unable to find build system for {name}.")
347 for dep in set(build.dependencies()):
379 not os.path.exists(os.path.join("build", "compile_commands.json"))
389 "-j",
391 "--enable=style,performance,portability,missingInclude",
392 "--inline-suppr",
393 "--suppress=useStlAlgorithm",
394 "--suppress=unusedStructMember",
395 "--suppress=postfixOperator",
396 "--suppress=unreadVariable",
397 "--suppress=knownConditionTrueFalse",
398 "--library=googletest",
399 "--project=build/compile_commands.json",
400 f"--cppcheck-build-dir={cpp_dir}",
415 src = os.path.join(temp, "unit-test-vg.c")
416 exe = os.path.join(temp, "unit-test-vg")
433 ["gcc", "-O2", "-o", exe, src],
439 ["valgrind", "--error-exitcode=99", exe],
454 src = "unit-test-sanitize.c"
455 exe = "./unit-test-sanitize"
463 "-O2",
464 "-fsanitize=address",
465 "-fsanitize=undefined",
466 "-o",
475 # TODO - Sanitizer not working on ppc64le
476 # https://github.com/openbmc/openbmc-build-scripts/issues/31
493 via `make check-valgrind`. If the package does not have valgrind testing
503 if not make_target_exists("check-valgrind"):
507 cmd = make_parallel + ["check-valgrind"]
512 if re.search("test-suite-[a-z]+.log", f) is None:
521 via `make check-code-coverage`. If the package does not have code coverage
524 if not make_target_exists("check-code-coverage"):
529 cmd = make_parallel + ["check-code-coverage"]
537 Build systems generally provide the means to configure, build, install and
539 which Autotools, Meson, CMake and possibly other build system drivers can
545 """Initialise the driver with properties independent of the build
558 """Test if the build system driver can be applied to the package
560 Return True if the driver can drive the package's build system,
564 build system's configuration file(s).
575 data from the build system configuration.
588 implies that the package will be configured to build
592 Generally configure() is implemented by invoking the build system
597 def build(self): member in BuildSystem
598 """Build the software ready for installation and/or testing
600 Should raise an exception if the build fails
602 Generally build() is implemented by invoking `make` or `ninja`.
611 Like build(), install() is generally implemented by invoking `make` or
617 """Build and run the test suite associated with the package
619 Should raise an exception if the build or testing fails.
631 Some analysis tools such as scan-build need injection into the build
633 behaviour. Analyzers independent of the build system can also be
635 the build system driver implementations.
667 autoconf_cmdline = ["autoconf", "-Wno-undefined", "-"]
674 document = contents.encode("utf-8")
684 for match in re.compile(pattern).finditer(stdout.decode("utf-8")):
705 return "--" + ("enable" if enabled else "disable") + "-" + flag
710 self._configure_feature("silent-rules", False),
717 self._configure_feature("code-coverage", False),
730 def build(self): member in Autotools
734 check_call_cmd("sudo", "-n", "--", *(make_parallel + ["install"]))
735 check_call_cmd("sudo", "-n", "--", "ldconfig")
747 if "test-suite.log" not in files:
749 check_call_cmd("cat", os.path.join(root, "test-suite.log"))
771 "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
772 "-DCMAKE_CXX_FLAGS='-DBOOST_USE_VALGRIND'",
773 "-DITESTS=ON",
779 "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
780 "-DCMAKE_CXX_FLAGS='-DBOOST_USE_VALGRIND'",
784 def build(self): member in CMake
787 "--build",
789 "--",
790 "-j",
795 check_call_cmd("sudo", "cmake", "--install", ".")
796 check_call_cmd("sudo", "-n", "--", "ldconfig")
803 if os.path.isfile(".clang-tidy"):
804 with TemporaryDirectory(prefix="build", dir=".") as build_dir:
805 # clang-tidy needs to run on a clang-specific build
808 "-DCMAKE_C_COMPILER=clang",
809 "-DCMAKE_CXX_COMPILER=clang++",
810 "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
811 "-H.",
812 "-B" + build_dir,
816 "run-clang-tidy", "-header-filter=.*", "-p", build_dir
828 ["meson", "introspect", "--projectinfo", path],
830 ).decode("utf-8")
837 return os.path.isfile(os.path.join(self.path, "meson.build"))
840 meson_build = os.path.join(self.path, "meson.build")
846 if "meson.build" not in files:
848 with open(os.path.join(root, "meson.build"), "rt") as f:
923 return "-D{}={}".format(key, str_val)
933 "-Db_colorout=never",
934 "-Dwerror=true",
935 "-Dwarning_level=3",
936 "-Dcpp_args='-DBOOST_USE_VALGRIND'",
939 # -Ddebug=true -Doptimization=g is helpful for abi-dumper but isn't a combination that
940 # is supported by meson's build types. Configure it manually.
941 meson_flags.append("-Ddebug=true")
942 meson_flags.append("-Doptimization=g")
944 meson_flags.append("--buildtype=debugoptimized")
971 "meson", "setup", "--reconfigure", "build", *meson_flags
974 shutil.rmtree("build", ignore_errors=True)
975 check_call_cmd("meson", "setup", "build", *meson_flags)
977 self.package = Meson._project_name("build")
979 def build(self): member in Meson
980 check_call_cmd("ninja", "-C", "build")
983 check_call_cmd("sudo", "-n", "--", "ninja", "-C", "build", "install")
984 check_call_cmd("sudo", "-n", "--", "ldconfig")
987 # It is useful to check various settings of the meson.build file
991 # project-under-test (otherwise an upstream dependency could fail
996 test_args = ("--repeat", str(args.repeat), "-C", "build")
997 check_call_cmd("meson", "test", "--print-errorlogs", *test_args)
1004 Returns whether the meson build supports the named test setup.
1015 "-C",
1016 "build",
1017 "--setup",
1025 output = output.decode("utf-8")
1032 configurations by utilizing add_test_setup() in a meson.build
1042 "-t",
1044 "-C",
1045 "build",
1046 "--print-errorlogs",
1047 "--setup",
1055 "-t",
1057 "-C",
1058 "build",
1059 "--print-errorlogs",
1060 "--wrapper",
1061 "valgrind --error-exitcode=1",
1070 # Run clang-tidy only if the project has a configuration
1071 if os.path.isfile(".clang-tidy"):
1073 clang_env["CC"] = "clang"
1074 clang_env["CXX"] = "clang++"
1075 # Clang-20 currently has some issue with libstdcpp's
1077 # Adding -fno-builtin-std-forward_like causes them to go away.
1078 clang_env["CXXFLAGS"] = "-fno-builtin-std-forward_like"
1081 with TemporaryDirectory(prefix="build", dir=".") as build_dir:
1083 if not os.path.isfile(".openbmc-no-clang"):
1085 "meson", "compile", "-C", build_dir, env=clang_env
1090 "-C",
1092 "clang-tidy-fix",
1098 "-C",
1100 "--no-pager",
1105 # Run the basic clang static analyzer otherwise
1107 check_call_cmd("ninja", "-C", "build", "scan-build")
1110 # b_lundef is needed if clang++ is CXX since it resolves the
1112 # in the build process to ensure we don't have undefined
1116 meson_flags.append("-Db_sanitize=address,undefined")
1119 "meson", "setup", "--reconfigure", "build", *meson_flags
1122 shutil.rmtree("build", ignore_errors=True)
1123 check_call_cmd("meson", "setup", "build", *meson_flags)
1127 "-C",
1128 "build",
1129 "--print-errorlogs",
1130 "--logbase",
1131 "testlog-ubasan",
1134 # check_call_cmd('meson', 'configure', 'build',
1135 # '-Db_sanitize=memory')
1136 # check_call_cmd('meson', 'test', '-C', 'build'
1137 # '--logbase', 'testlog-msan')
1140 "-Db_sanitize=address,undefined", "-Db_sanitize=none"
1146 "meson", "setup", "--reconfigure", "build", *meson_flags
1149 shutil.rmtree("build", ignore_errors=True)
1150 check_call_cmd("meson", "setup", "build", *meson_flags)
1155 check_call_cmd("meson", "configure", "build", "-Db_coverage=true")
1157 # Only build coverage HTML if coverage files were produced
1158 for root, dirs, files in os.walk("build"):
1160 check_call_cmd("ninja", "-C", "build", "coverage-html")
1162 check_call_cmd("meson", "configure", "build", "-Db_coverage=false")
1166 with open(os.path.join(self.path, "meson.build"), "rt") as f:
1177 # identify this. Add to our unit-test checks so that we don't
1178 # get a meson.build missing this.
1185 "C++20 support requires specifying in meson.build: "
1190 # identify this. Add to our unit-test checks so that we don't
1191 # get a meson.build missing this.
1198 "C++23 support requires specifying in meson.build: "
1247 system.build()
1252 system.build()
1279 if os.path.split(root)[-1] == "subprojects":
1281 subproject = ".".join(f.split(".")[0:-1])
1294 "phosphor-logging": [
1295 "--enable-metadata-processing",
1296 "--enable-openpower-pel-extension",
1297 "YAML_DIR=/usr/local/share/phosphor-dbus-yaml/yaml",
1303 "phosphor-dbus-interfaces": [
1304 "-Ddata_com_ibm=true",
1305 "-Ddata_org_open_power=true",
1307 "phosphor-logging": ["-Dopenpower-pel-extension=enabled"],
1312 "AC_CHECK_LIB": {"mapper": "phosphor-objmgr"},
1314 "host-ipmid": "phosphor-host-ipmid",
1315 "blobs-ipmid": "phosphor-ipmi-blobs",
1320 "phosphor-logging/log.hpp": "phosphor-logging",
1324 "phosphor-dbus-interfaces": "phosphor-dbus-interfaces",
1325 "libipmid": "phosphor-host-ipmid",
1326 "libipmid-host": "phosphor-host-ipmid",
1331 "phosphor-logging": "phosphor-logging",
1332 "phosphor-snmp": "phosphor-snmp",
1333 "ipmiblob": "ipmi-blob-tool",
1334 "hei": "openpower-libhei",
1335 "phosphor-ipmi-blobs": "phosphor-ipmi-blobs",
1336 "libcr51sign": "google-misc",
1349 DEPENDENCIES_REGEX = {"phosphor-logging": r"\S+-dbus-interfaces$"}
1354 "-w",
1355 "--workspace",
1361 "-p",
1362 "--package",
1368 "-t",
1369 "--test-only",
1377 "--no-cppcheck",
1386 "--integration-tests",
1394 "--no-integration-tests",
1401 "-v",
1402 "--verbose",
1407 "-r", "--repeat", help="Repeat tests N times", type=int, default=1
1410 "-b",
1411 "--branch",
1418 "-n",
1419 "--noformat",
1447 # Run format-code.sh, which will in turn call any repo-level formatters.
1451 WORKSPACE, "openbmc-build-scripts", "scripts", "format-code.sh"
1458 "git", "-C", CODE_SCAN_DIR, "--no-pager", "diff", "--exit-code"
1464 print("No valid build system, exit")
1499 ci_scripts = find_file(["run-ci.sh", "run-ci"], CODE_SCAN_DIR)