Skip to content

Commit c5e7725

Browse files
Build fixes for codeQL (#100)
1 parent 4481c68 commit c5e7725

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

.github/workflows/codeql-analysis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jobs:
5353
name: Capture Environment
5454
5555
- run: |
56-
tools/releaseBuild/vstsBuild.ps1 -Name 'centos.7' -Verbose
56+
Import-Module ./build.psm1
57+
Start-PSBootstrap
58+
Start-BuildNativeUnixBinaries
5759
name: Build
5860
5961
- name: Perform CodeQL Analysis

build.psm1

+7-5
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ function Get-EnvironmentInformation
136136
$environment += @{'IsUbuntu16' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '16.04'}
137137
$environment += @{'IsUbuntu17' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '17.10'}
138138
$environment += @{'IsUbuntu18' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '18.04'}
139+
$environment += @{'IsUbuntu22' = $Environment.IsUbuntu -and $LinuxInfo.VERSION_ID -match '22.04'}
139140
$environment += @{'IsCentOS' = $LinuxInfo.ID -match 'centos' -and $LinuxInfo.VERSION_ID -match '7'}
140141
$environment += @{'IsFedora' = $LinuxInfo.ID -match 'fedora' -and $LinuxInfo.VERSION_ID -ge 24}
142+
$environment += @{'IsRedHat' = $LinuxInfo.ID -match 'rhel'}
141143
$environment += @{'IsOpenSUSE' = $LinuxInfo.ID -match 'opensuse'}
142144
$environment += @{'IsSLES' = $LinuxInfo.ID -match 'sles'}
143145
$environment += @{'IsOpenSUSE13' = $Environmenst.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '13'}
144146
$environment += @{'IsOpenSUSE42.1' = $Environment.IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '42.1'}
145-
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora}
147+
$environment += @{'IsRedHatFamily' = $Environment.IsCentOS -or $Environment.IsFedora -or $Environment.IsRedHat}
146148
$environment += @{'IsSUSEFamily' = $Environment.IsSLES -or $Environment.IsOpenSUSE}
147149
$environment += @{'IsAlpine' = $LinuxInfo.ID -match 'alpine'}
148150

@@ -1891,7 +1893,7 @@ function Install-Dotnet {
18911893
}
18921894

18931895
function Get-RedHatPackageManager {
1894-
if ($Environment.IsCentOS) {
1896+
if ($Environment.IsCentOS -or $Environment.IsRedHat) {
18951897
"yum install -y -q"
18961898
} elseif ($Environment.IsFedora) {
18971899
"dnf install -y -q"
@@ -1978,13 +1980,13 @@ function Start-PSBootstrap {
19781980
}
19791981
} elseif ($Environment.IsRedHatFamily) {
19801982
# Build tools
1981-
$Deps += "which", "curl", "gcc-c++", "cmake", "make"
1983+
$Deps += "which", "curl", "wget"
19821984

19831985
# .NET Core required runtime libraries
1984-
$Deps += "libicu", "libunwind"
1986+
$Deps += "libicu", "openssl-libs"
19851987

19861988
# Packaging tools
1987-
if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff", 'libffi-devel' }
1989+
if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff", 'libffi-devel', "gcc-c++" }
19881990

19891991
$PackageManager = Get-RedHatPackageManager
19901992

src/libpsl-native/gmock.pc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
libdir=/usr/local/lib
1+
libdir=/usr/local/lib64
22
includedir=/usr/local/include
33

44
Name: gmock
55
Description: GoogleMock (without main() function)
66
Version: 1.9.0
77
URL: https://github.com/google/googletest
8-
Libs: -L${libdir} -lgmock
9-
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
8+
Libs: -L${libdir} -lgmock -pthread
9+
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread

src/libpsl-native/gmock_main.pc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
libdir=/usr/local/lib
1+
libdir=/usr/local/lib64
22
includedir=/usr/local/include
33

44
Name: gmock_main
55
Description: GoogleMock (with main() function)
66
Version: 1.9.0
77
URL: https://github.com/google/googletest
8-
Libs: -L${libdir} -lgmock_main
9-
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
8+
Libs: -L${libdir} -lgmock_main -pthread
9+
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread

src/libpsl-native/gtest.pc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
libdir=/usr/local/lib
1+
libdir=/usr/local/lib64
22
includedir=/usr/local/include
33

44
Name: gtest
55
Description: GoogleTest (without main() function)
66
Version: 1.9.0
77
URL: https://github.com/google/googletest
8-
Libs: -L${libdir} -lgtest
9-
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
8+
Libs: -L${libdir} -lgtest -pthread
9+
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread

src/libpsl-native/gtest_main.pc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
libdir=/usr/local/lib
1+
libdir=/usr/local/lib64
22
includedir=/usr/local/include
33

44
Name: gtest_main
55
Description: GoogleTest (with main() function)
66
Version: 1.9.0
77
URL: https://github.com/google/googletest
88
Requires: gtest
9-
Libs: -L${libdir} -lgtest_main
10-
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1
9+
Libs: -L${libdir} -lgtest_main -pthread
10+
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread

0 commit comments

Comments
 (0)