dsh-remote 0.8.91 → 0.8.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +369 -368
  3. package/README.md +354 -353
  4. package/cordis.patch.yml +9 -9
  5. package/lib/audit.js +45 -45
  6. package/lib/binding.js +172 -172
  7. package/lib/client.js +4647 -4550
  8. package/lib/credential.js +270 -263
  9. package/lib/errors.js +141 -141
  10. package/lib/exec-job.js +242 -242
  11. package/lib/file-reference.js +457 -457
  12. package/lib/forwards.js +258 -258
  13. package/lib/host-api.js +822 -822
  14. package/lib/hostkey.js +108 -108
  15. package/lib/http-transport.js +201 -201
  16. package/lib/ignore.js +202 -202
  17. package/lib/index.js +4488 -4394
  18. package/lib/instructions-dynamic.js +415 -415
  19. package/lib/instructions.js +288 -288
  20. package/lib/open-folder.js +56 -56
  21. package/lib/openssh.js +940 -881
  22. package/lib/paths.js +292 -292
  23. package/lib/pool.js +1029 -970
  24. package/lib/posix-shell.cjs +34 -0
  25. package/lib/registry.js +296 -296
  26. package/lib/remote-fs.js +173 -173
  27. package/lib/remote-sandbox.js +183 -183
  28. package/lib/remote-shell-child.cjs +397 -400
  29. package/lib/remote-shell.js +697 -697
  30. package/lib/remote-skills.js +312 -0
  31. package/lib/routes-audit.js +58 -58
  32. package/lib/routes-forwards.js +72 -72
  33. package/lib/routes-fs.js +251 -245
  34. package/lib/routes-machines.js +186 -186
  35. package/lib/routes-misc.js +187 -150
  36. package/lib/routes-term.js +169 -169
  37. package/lib/routes-update.js +143 -143
  38. package/lib/routes-web-attach.js +112 -112
  39. package/lib/routes-workspace.js +312 -312
  40. package/lib/search.js +235 -235
  41. package/lib/sftp-surface.js +119 -119
  42. package/lib/sshconfig.js +779 -779
  43. package/lib/sync.js +350 -350
  44. package/lib/tasks.js +95 -95
  45. package/lib/telemetry.js +247 -247
  46. package/lib/terminal.js +205 -205
  47. package/lib/tui/flow.js +130 -130
  48. package/lib/tui/format.js +380 -380
  49. package/lib/tui/i18n.js +350 -350
  50. package/lib/tui/index.js +531 -531
  51. package/lib/tui/provider.js +344 -344
  52. package/lib/tui/scene.js +986 -986
  53. package/lib/update.js +490 -472
  54. package/lib/web-attach.js +860 -850
  55. package/lib/workspace-cleanup.js +337 -337
  56. package/package.json +103 -100
  57. package/node_modules/buildcheck/.eslintrc.js +0 -5
  58. package/node_modules/buildcheck/.github/workflows/ci.yml +0 -88
  59. package/node_modules/buildcheck/.github/workflows/lint.yml +0 -27
  60. package/node_modules/buildcheck/.npmignore +0 -3
  61. package/node_modules/buildcheck/LICENSE +0 -19
  62. package/node_modules/buildcheck/README.md +0 -106
  63. package/node_modules/buildcheck/deps/Find-VisualStudio.cs +0 -250
  64. package/node_modules/buildcheck/lib/findvs.js +0 -361
  65. package/node_modules/buildcheck/lib/index.js +0 -738
  66. package/node_modules/buildcheck/package.json +0 -36
  67. package/node_modules/buildcheck/test/test.js +0 -8
  68. package/node_modules/cpu-features/.eslintrc.js +0 -5
  69. package/node_modules/cpu-features/.github/workflows/ci.yml +0 -74
  70. package/node_modules/cpu-features/.github/workflows/lint.yml +0 -27
  71. package/node_modules/cpu-features/LICENSE +0 -19
  72. package/node_modules/cpu-features/README.md +0 -59
  73. package/node_modules/cpu-features/binding.gyp +0 -16
  74. package/node_modules/cpu-features/buildcheck.js +0 -32
  75. package/node_modules/cpu-features/deps/cpu_features/.clang-format +0 -4
  76. package/node_modules/cpu-features/deps/cpu_features/.dockerignore +0 -31
  77. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +0 -5
  78. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +0 -30
  79. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +0 -22
  80. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +0 -26
  81. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +0 -31
  82. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +0 -43
  83. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +0 -25
  84. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +0 -31
  85. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +0 -24
  86. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +0 -30
  87. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +0 -29
  88. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +0 -28
  89. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +0 -27
  90. package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +0 -21
  91. package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +0 -329
  92. package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +0 -261
  93. package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +0 -23
  94. package/node_modules/cpu-features/deps/cpu_features/LICENSE +0 -230
  95. package/node_modules/cpu-features/deps/cpu_features/README.md +0 -272
  96. package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +0 -19
  97. package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +0 -5
  98. package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +0 -11
  99. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +0 -3
  100. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +0 -3
  101. package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +0 -30
  102. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +0 -252
  103. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +0 -40
  104. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +0 -64
  105. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +0 -312
  106. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +0 -7
  107. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +0 -48
  108. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +0 -34
  109. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +0 -22
  110. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +0 -11
  111. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +0 -107
  112. package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +0 -15
  113. package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +0 -105
  114. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +0 -54
  115. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +0 -384
  116. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +0 -259
  117. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +0 -121
  118. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +0 -74
  119. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +0 -149
  120. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +0 -72
  121. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +0 -108
  122. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +0 -288
  123. package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +0 -40
  124. package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +0 -37
  125. package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +0 -39
  126. package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +0 -240
  127. package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +0 -49
  128. package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +0 -110
  129. package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +0 -70
  130. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +0 -60
  131. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +0 -4
  132. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +0 -205
  133. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +0 -320
  134. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +0 -12
  135. package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +0 -456
  136. package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +0 -165
  137. package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +0 -75
  138. package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +0 -490
  139. package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +0 -79
  140. package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +0 -19
  141. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +0 -86
  142. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +0 -26
  143. package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +0 -22
  144. package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +0 -62
  145. package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +0 -169
  146. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +0 -88
  147. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +0 -79
  148. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +0 -82
  149. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +0 -138
  150. package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +0 -212
  151. package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +0 -93
  152. package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +0 -163
  153. package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +0 -111
  154. package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +0 -120
  155. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +0 -2055
  156. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +0 -68
  157. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +0 -58
  158. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +0 -57
  159. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +0 -58
  160. package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +0 -132
  161. package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +0 -192
  162. package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +0 -461
  163. package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +0 -114
  164. package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +0 -53
  165. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +0 -396
  166. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +0 -384
  167. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +0 -176
  168. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +0 -131
  169. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +0 -180
  170. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +0 -82
  171. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +0 -1729
  172. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +0 -103
  173. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +0 -61
  174. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +0 -52
  175. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +0 -31
  176. package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +0 -132
  177. package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +0 -202
  178. package/node_modules/cpu-features/lib/index.js +0 -5
  179. package/node_modules/cpu-features/package.json +0 -40
  180. package/node_modules/cpu-features/src/binding.cc +0 -151
  181. package/node_modules/cpu-features/test/test.js +0 -12
@@ -1,27 +0,0 @@
1
- name: s390x Linux CMake
2
-
3
- on:
4
- push:
5
- pull_request:
6
- schedule:
7
- # min hours day(month) month day(week)
8
- - cron: '0 0 7,22 * *'
9
-
10
- jobs:
11
- # Building using the github runner environement directly.
12
- make:
13
- runs-on: ubuntu-latest
14
- strategy:
15
- matrix:
16
- targets: [
17
- [s390x],
18
- ]
19
- fail-fast: false
20
- env:
21
- TARGET: ${{ matrix.targets[0] }}
22
- steps:
23
- - uses: actions/checkout@v2
24
- - name: Build
25
- run: make --directory=cmake/ci ${TARGET}_build
26
- - name: Test
27
- run: make --directory=cmake/ci ${TARGET}_test
@@ -1,21 +0,0 @@
1
- ---
2
- dataSource: "prs"
3
- ignoreLabels:
4
- - "Apple M1"
5
- - "duplicate"
6
- - "help wanted"
7
- - "invalid"
8
- - "question"
9
- - "wontfix"
10
- onlyMilestones: false
11
- groupBy:
12
- "API Change":
13
- - "API Change"
14
- "New features / Enhancements":
15
- - "enhancement"
16
- - "internal"
17
- "Bug Fixes":
18
- - "bug"
19
- "Misc":
20
- - "misc"
21
- changelogFilename: "CHANGELOG.md"
@@ -1,329 +0,0 @@
1
- # cpu_features, a cross platform C99 library to get cpu features at runtime.
2
-
3
- load("@bazel_skylib//lib:selects.bzl", "selects")
4
- load("//:bazel/platforms.bzl", "PLATFORM_CPU_ARM", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_MIPS", "PLATFORM_CPU_PPC", "PLATFORM_CPU_X86_64")
5
-
6
- package(
7
- default_visibility = ["//visibility:public"],
8
- licenses = ["notice"],
9
- )
10
-
11
- exports_files(["LICENSE"])
12
-
13
- INCLUDES = ["include"]
14
-
15
- C99_FLAGS = [
16
- "-std=c99",
17
- "-Wall",
18
- "-Wextra",
19
- "-Wmissing-declarations",
20
- "-Wmissing-prototypes",
21
- "-Wno-implicit-fallthrough",
22
- "-Wno-unused-function",
23
- "-Wold-style-definition",
24
- "-Wshadow",
25
- "-Wsign-compare",
26
- "-Wstrict-prototypes",
27
- ]
28
-
29
- cc_library(
30
- name = "cpu_features_macros",
31
- copts = C99_FLAGS,
32
- includes = INCLUDES,
33
- textual_hdrs = ["include/cpu_features_macros.h"],
34
- )
35
-
36
- cc_library(
37
- name = "cpu_features_cache_info",
38
- copts = C99_FLAGS,
39
- includes = INCLUDES,
40
- textual_hdrs = ["include/cpu_features_cache_info.h"],
41
- deps = [":cpu_features_macros"],
42
- )
43
-
44
- cc_library(
45
- name = "bit_utils",
46
- copts = C99_FLAGS,
47
- includes = INCLUDES,
48
- textual_hdrs = ["include/internal/bit_utils.h"],
49
- deps = [":cpu_features_macros"],
50
- )
51
-
52
- cc_test(
53
- name = "bit_utils_test",
54
- srcs = ["test/bit_utils_test.cc"],
55
- includes = INCLUDES,
56
- deps = [
57
- ":bit_utils",
58
- "@com_google_googletest//:gtest_main",
59
- ],
60
- )
61
-
62
- cc_library(
63
- name = "memory_utils",
64
- copts = C99_FLAGS,
65
- includes = INCLUDES,
66
- textual_hdrs = [
67
- "src/copy.inl",
68
- "src/equals.inl",
69
- ],
70
- )
71
-
72
- cc_library(
73
- name = "string_view",
74
- srcs = [
75
- "src/string_view.c",
76
- ],
77
- copts = C99_FLAGS,
78
- includes = INCLUDES,
79
- textual_hdrs = ["include/internal/string_view.h"],
80
- deps = [
81
- ":cpu_features_macros",
82
- ":memory_utils",
83
- ],
84
- )
85
-
86
- cc_test(
87
- name = "string_view_test",
88
- srcs = ["test/string_view_test.cc"],
89
- includes = INCLUDES,
90
- deps = [
91
- ":string_view",
92
- "@com_google_googletest//:gtest_main",
93
- ],
94
- )
95
-
96
- cc_library(
97
- name = "filesystem",
98
- srcs = ["src/filesystem.c"],
99
- copts = C99_FLAGS,
100
- includes = INCLUDES,
101
- textual_hdrs = ["include/internal/filesystem.h"],
102
- deps = [":cpu_features_macros"],
103
- )
104
-
105
- cc_library(
106
- name = "filesystem_for_testing",
107
- testonly = 1,
108
- srcs = [
109
- "src/filesystem.c",
110
- "test/filesystem_for_testing.cc",
111
- ],
112
- hdrs = [
113
- "include/internal/filesystem.h",
114
- "test/filesystem_for_testing.h",
115
- ],
116
- defines = ["CPU_FEATURES_MOCK_FILESYSTEM"],
117
- includes = INCLUDES,
118
- deps = [
119
- ":cpu_features_macros",
120
- ],
121
- )
122
-
123
- cc_library(
124
- name = "stack_line_reader",
125
- srcs = ["src/stack_line_reader.c"],
126
- copts = C99_FLAGS,
127
- defines = ["STACK_LINE_READER_BUFFER_SIZE=1024"],
128
- includes = INCLUDES,
129
- textual_hdrs = ["include/internal/stack_line_reader.h"],
130
- deps = [
131
- ":cpu_features_macros",
132
- ":filesystem",
133
- ":string_view",
134
- ],
135
- )
136
-
137
- cc_test(
138
- name = "stack_line_reader_test",
139
- srcs = [
140
- "include/internal/stack_line_reader.h",
141
- "src/stack_line_reader.c",
142
- "test/stack_line_reader_test.cc",
143
- ],
144
- defines = ["STACK_LINE_READER_BUFFER_SIZE=16"],
145
- includes = INCLUDES,
146
- deps = [
147
- ":cpu_features_macros",
148
- ":filesystem_for_testing",
149
- ":string_view",
150
- "@com_google_googletest//:gtest_main",
151
- ],
152
- )
153
-
154
- cc_library(
155
- name = "stack_line_reader_to_use_with_filesystem_for_testing",
156
- testonly = 1,
157
- srcs = ["src/stack_line_reader.c"],
158
- hdrs = ["include/internal/stack_line_reader.h"],
159
- copts = C99_FLAGS,
160
- defines = ["STACK_LINE_READER_BUFFER_SIZE=1024"],
161
- includes = INCLUDES,
162
- deps = [
163
- ":cpu_features_macros",
164
- ":filesystem_for_testing",
165
- ":string_view",
166
- ],
167
- )
168
-
169
- cc_library(
170
- name = "hwcaps",
171
- srcs = ["src/hwcaps.c"],
172
- copts = C99_FLAGS,
173
- defines = ["HAVE_STRONG_GETAUXVAL"],
174
- includes = INCLUDES,
175
- textual_hdrs = ["include/internal/hwcaps.h"],
176
- deps = [
177
- ":cpu_features_macros",
178
- ":filesystem",
179
- ":string_view",
180
- ],
181
- )
182
-
183
- cc_library(
184
- name = "hwcaps_for_testing",
185
- testonly = 1,
186
- srcs = [
187
- "src/hwcaps.c",
188
- "test/hwcaps_for_testing.cc",
189
- ],
190
- hdrs = [
191
- "include/internal/hwcaps.h",
192
- "test/hwcaps_for_testing.h",
193
- ],
194
- defines = [
195
- "CPU_FEATURES_MOCK_GET_ELF_HWCAP_FROM_GETAUXVAL",
196
- "CPU_FEATURES_TEST",
197
- ],
198
- includes = INCLUDES,
199
- deps = [
200
- ":cpu_features_macros",
201
- ":filesystem_for_testing",
202
- ":string_view",
203
- ],
204
- )
205
-
206
- cc_library(
207
- name = "cpuinfo",
208
- srcs = selects.with_or({
209
- PLATFORM_CPU_X86_64: [
210
- "src/impl_x86_freebsd.c",
211
- "src/impl_x86_linux_or_android.c",
212
- "src/impl_x86_macos.c",
213
- "src/impl_x86_windows.c",
214
- ],
215
- PLATFORM_CPU_ARM: ["src/impl_arm_linux_or_android.c"],
216
- PLATFORM_CPU_ARM64: ["src/impl_aarch64_linux_or_android.c"],
217
- PLATFORM_CPU_MIPS: ["src/impl_mips_linux_or_android.c"],
218
- PLATFORM_CPU_PPC: ["src/impl_ppc_linux.c"],
219
- }),
220
- copts = C99_FLAGS,
221
- includes = INCLUDES,
222
- textual_hdrs = selects.with_or({
223
- PLATFORM_CPU_X86_64: [
224
- "src/impl_x86__base_implementation.inl",
225
- "include/cpuinfo_x86.h",
226
- "include/internal/cpuid_x86.h",
227
- "include/internal/windows_utils.h",
228
- ],
229
- PLATFORM_CPU_ARM: ["include/cpuinfo_arm.h"],
230
- PLATFORM_CPU_ARM64: ["include/cpuinfo_aarch64.h"],
231
- PLATFORM_CPU_MIPS: ["include/cpuinfo_mips.h"],
232
- PLATFORM_CPU_PPC: ["include/cpuinfo_ppc.h"],
233
- }) + [
234
- "src/define_introspection.inl",
235
- "src/define_introspection_and_hwcaps.inl",
236
- ],
237
- deps = [
238
- ":bit_utils",
239
- ":cpu_features_cache_info",
240
- ":cpu_features_macros",
241
- ":filesystem",
242
- ":hwcaps",
243
- ":memory_utils",
244
- ":stack_line_reader",
245
- ":string_view",
246
- ],
247
- )
248
-
249
- cc_library(
250
- name = "cpuinfo_for_testing",
251
- testonly = 1,
252
- srcs = selects.with_or({
253
- PLATFORM_CPU_X86_64: [
254
- "src/impl_x86_freebsd.c",
255
- "src/impl_x86_linux_or_android.c",
256
- "src/impl_x86_macos.c",
257
- "src/impl_x86_windows.c",
258
- ],
259
- PLATFORM_CPU_ARM: ["src/impl_arm_linux_or_android.c"],
260
- PLATFORM_CPU_ARM64: ["src/impl_aarch64_linux_or_android.c"],
261
- PLATFORM_CPU_MIPS: ["src/impl_mips_linux_or_android.c"],
262
- PLATFORM_CPU_PPC: ["src/impl_ppc_linux.c"],
263
- }),
264
- hdrs = selects.with_or({
265
- PLATFORM_CPU_X86_64: [
266
- "include/cpuinfo_x86.h",
267
- "include/internal/cpuid_x86.h",
268
- "include/internal/windows_utils.h",
269
- ],
270
- PLATFORM_CPU_ARM: ["include/cpuinfo_arm.h"],
271
- PLATFORM_CPU_ARM64: ["include/cpuinfo_aarch64.h"],
272
- PLATFORM_CPU_MIPS: ["include/cpuinfo_mips.h"],
273
- PLATFORM_CPU_PPC: ["include/cpuinfo_ppc.h"],
274
- }),
275
- copts = C99_FLAGS,
276
- defines = selects.with_or({
277
- PLATFORM_CPU_X86_64: ["CPU_FEATURES_MOCK_CPUID_X86"],
278
- "//conditions:default": [],
279
- }),
280
- includes = INCLUDES,
281
- textual_hdrs = selects.with_or({
282
- PLATFORM_CPU_X86_64: ["src/impl_x86__base_implementation.inl"],
283
- "//conditions:default": [],
284
- }) + [
285
- "src/define_introspection.inl",
286
- "src/define_introspection_and_hwcaps.inl",
287
- ],
288
- deps = [
289
- ":bit_utils",
290
- ":cpu_features_cache_info",
291
- ":cpu_features_macros",
292
- ":filesystem_for_testing",
293
- ":hwcaps_for_testing",
294
- ":memory_utils",
295
- ":stack_line_reader_to_use_with_filesystem_for_testing",
296
- ":string_view",
297
- ],
298
- )
299
-
300
- cc_test(
301
- name = "cpuinfo_test",
302
- srcs = selects.with_or({
303
- PLATFORM_CPU_ARM64: ["test/cpuinfo_aarch64_test.cc"],
304
- PLATFORM_CPU_ARM: ["test/cpuinfo_arm_test.cc"],
305
- PLATFORM_CPU_MIPS: ["test/cpuinfo_mips_test.cc"],
306
- PLATFORM_CPU_PPC: ["test/cpuinfo_ppc_test.cc"],
307
- PLATFORM_CPU_X86_64: ["test/cpuinfo_x86_test.cc"],
308
- }),
309
- includes = INCLUDES,
310
- deps = [
311
- ":cpuinfo_for_testing",
312
- ":filesystem_for_testing",
313
- ":hwcaps_for_testing",
314
- ":string_view",
315
- "@com_google_googletest//:gtest_main",
316
- ],
317
- )
318
-
319
- cc_binary(
320
- name = "list_cpu_features",
321
- srcs = ["src/utils/list_cpu_features.c"],
322
- copts = C99_FLAGS,
323
- includes = INCLUDES,
324
- deps = [
325
- ":bit_utils",
326
- ":cpu_features_macros",
327
- ":cpuinfo",
328
- ],
329
- )
@@ -1,261 +0,0 @@
1
- cmake_minimum_required(VERSION 3.19.2)
2
-
3
- # option() honors normal variables.
4
- # see: https://cmake.org/cmake/help/git-stage/policy/CMP0077.html
5
- if(POLICY CMP0077)
6
- cmake_policy(SET CMP0077 NEW)
7
- endif()
8
-
9
- project(CpuFeatures VERSION 0.8.0 LANGUAGES C)
10
-
11
- set(CMAKE_C_STANDARD 99)
12
-
13
- # Default Build Type to be Release
14
- if(NOT CMAKE_BUILD_TYPE)
15
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING
16
- "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
17
- FORCE)
18
- endif(NOT CMAKE_BUILD_TYPE)
19
-
20
- # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
21
- # it prominent in the GUI.
22
- # cpu_features uses bit-fields which are - to some extends - implementation-defined (see https://en.cppreference.com/w/c/language/bit_field).
23
- # As a consequence it is discouraged to use cpu_features as a shared library because different compilers may interpret the code in different ways.
24
- # Prefer static linking from source whenever possible.
25
- option(BUILD_SHARED_LIBS "Build library as shared." OFF)
26
-
27
- # Force PIC on unix when building shared libs
28
- # see: https://en.wikipedia.org/wiki/Position-independent_code
29
- if(BUILD_SHARED_LIBS AND UNIX)
30
- option(CMAKE_POSITION_INDEPENDENT_CODE "Build with Position Independant Code." ON)
31
- endif()
32
-
33
- include(CheckIncludeFile)
34
- include(CheckSymbolExists)
35
- include(GNUInstallDirs)
36
-
37
- macro(setup_include_and_definitions TARGET_NAME)
38
- target_include_directories(${TARGET_NAME}
39
- PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
40
- PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/internal>
41
- )
42
- target_compile_definitions(${TARGET_NAME}
43
- PUBLIC STACK_LINE_READER_BUFFER_SIZE=1024
44
- )
45
- endmacro()
46
-
47
- set(PROCESSOR_IS_MIPS FALSE)
48
- set(PROCESSOR_IS_ARM FALSE)
49
- set(PROCESSOR_IS_AARCH64 FALSE)
50
- set(PROCESSOR_IS_X86 FALSE)
51
- set(PROCESSOR_IS_POWER FALSE)
52
- set(PROCESSOR_IS_S390X FALSE)
53
- set(PROCESSOR_IS_RISCV FALSE)
54
-
55
- if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
56
- set(PROCESSOR_IS_MIPS TRUE)
57
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)")
58
- set(PROCESSOR_IS_AARCH64 TRUE)
59
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
60
- set(PROCESSOR_IS_ARM TRUE)
61
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)")
62
- set(PROCESSOR_IS_X86 TRUE)
63
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
64
- set(PROCESSOR_IS_POWER TRUE)
65
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x)")
66
- set(PROCESSOR_IS_S390X TRUE)
67
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv")
68
- set(PROCESSOR_IS_RISCV TRUE)
69
- endif()
70
-
71
- macro(add_cpu_features_headers_and_sources HDRS_LIST_NAME SRCS_LIST_NAME)
72
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_macros.h)
73
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_cache_info.h)
74
- file(GLOB IMPL_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/impl_*.c")
75
- list(APPEND ${SRCS_LIST_NAME} ${IMPL_SOURCES})
76
- if(PROCESSOR_IS_MIPS)
77
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_mips.h)
78
- elseif(PROCESSOR_IS_ARM)
79
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_arm.h)
80
- elseif(PROCESSOR_IS_AARCH64)
81
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_aarch64.h)
82
- list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
83
- elseif(PROCESSOR_IS_X86)
84
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_x86.h)
85
- list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/cpuid_x86.h)
86
- list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
87
- elseif(PROCESSOR_IS_POWER)
88
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_ppc.h)
89
- elseif(PROCESSOR_IS_S390X)
90
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_s390x.h)
91
- elseif(PROCESSOR_IS_RISCV)
92
- list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_riscv.h)
93
- else()
94
- message(FATAL_ERROR "Unsupported architectures ${CMAKE_SYSTEM_PROCESSOR}")
95
- endif()
96
- endmacro()
97
-
98
- #
99
- # library : utils
100
- #
101
-
102
- add_library(utils OBJECT
103
- ${PROJECT_SOURCE_DIR}/include/internal/bit_utils.h
104
- ${PROJECT_SOURCE_DIR}/include/internal/filesystem.h
105
- ${PROJECT_SOURCE_DIR}/include/internal/stack_line_reader.h
106
- ${PROJECT_SOURCE_DIR}/include/internal/string_view.h
107
- ${PROJECT_SOURCE_DIR}/src/filesystem.c
108
- ${PROJECT_SOURCE_DIR}/src/stack_line_reader.c
109
- ${PROJECT_SOURCE_DIR}/src/string_view.c
110
- )
111
- setup_include_and_definitions(utils)
112
-
113
- #
114
- # library : unix_based_hardware_detection
115
- #
116
-
117
- if(UNIX)
118
- add_library(unix_based_hardware_detection OBJECT
119
- ${PROJECT_SOURCE_DIR}/include/internal/hwcaps.h
120
- ${PROJECT_SOURCE_DIR}/src/hwcaps.c
121
- )
122
- setup_include_and_definitions(unix_based_hardware_detection)
123
- check_include_file(dlfcn.h HAVE_DLFCN_H)
124
- if(HAVE_DLFCN_H)
125
- target_compile_definitions(unix_based_hardware_detection PRIVATE HAVE_DLFCN_H)
126
- endif()
127
- check_symbol_exists(getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL)
128
- if(HAVE_STRONG_GETAUXVAL)
129
- target_compile_definitions(unix_based_hardware_detection PRIVATE HAVE_STRONG_GETAUXVAL)
130
- endif()
131
- endif()
132
-
133
- #
134
- # library : cpu_features
135
- #
136
- set (CPU_FEATURES_HDRS)
137
- set (CPU_FEATURES_SRCS)
138
- add_cpu_features_headers_and_sources(CPU_FEATURES_HDRS CPU_FEATURES_SRCS)
139
- list(APPEND CPU_FEATURES_SRCS $<TARGET_OBJECTS:utils>)
140
- if(NOT PROCESSOR_IS_X86 AND UNIX)
141
- list(APPEND CPU_FEATURES_SRCS $<TARGET_OBJECTS:unix_based_hardware_detection>)
142
- endif()
143
- add_library(cpu_features ${CPU_FEATURES_HDRS} ${CPU_FEATURES_SRCS})
144
- set_target_properties(cpu_features PROPERTIES PUBLIC_HEADER "${CPU_FEATURES_HDRS}")
145
- setup_include_and_definitions(cpu_features)
146
- target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS})
147
- target_include_directories(cpu_features
148
- PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/cpu_features>
149
- )
150
- if(PROCESSOR_IS_X86 OR PROCESSOR_IS_AARCH64)
151
- if(APPLE)
152
- target_compile_definitions(cpu_features PRIVATE HAVE_SYSCTLBYNAME)
153
- endif()
154
- endif()
155
- add_library(CpuFeature::cpu_features ALIAS cpu_features)
156
-
157
- #
158
- # program : list_cpu_features
159
- #
160
-
161
- add_executable(list_cpu_features ${PROJECT_SOURCE_DIR}/src/utils/list_cpu_features.c)
162
- target_link_libraries(list_cpu_features PRIVATE cpu_features)
163
- add_executable(CpuFeature::list_cpu_features ALIAS list_cpu_features)
164
-
165
- #
166
- # ndk_compat
167
- #
168
-
169
- if(ANDROID)
170
- add_subdirectory(ndk_compat)
171
- endif()
172
-
173
- #
174
- # tests
175
- #
176
-
177
- include(CTest)
178
- if(BUILD_TESTING)
179
- # Automatically incorporate googletest into the CMake Project if target not
180
- # found.
181
- enable_language(CXX)
182
-
183
- set(CMAKE_CXX_STANDARD 14)
184
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
185
- set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std14 instead of -gnustd14
186
-
187
- if(NOT TARGET gtest OR NOT TARGET gmock_main)
188
- # Download and unpack googletest at configure time.
189
- configure_file(
190
- cmake/googletest.CMakeLists.txt.in
191
- googletest-download/CMakeLists.txt
192
- )
193
-
194
- execute_process(
195
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
196
- RESULT_VARIABLE result
197
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
198
-
199
- if(result)
200
- message(FATAL_ERROR "CMake step for googletest failed: ${result}")
201
- endif()
202
-
203
- execute_process(
204
- COMMAND ${CMAKE_COMMAND} --build .
205
- RESULT_VARIABLE result
206
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
207
-
208
- if(result)
209
- message(FATAL_ERROR "Build step for googletest failed: ${result}")
210
- endif()
211
-
212
- # Prevent overriding the parent project's compiler/linker settings on
213
- # Windows.
214
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
215
-
216
- # Add googletest directly to our build. This defines the gtest and
217
- # gtest_main targets.
218
- add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
219
- ${CMAKE_BINARY_DIR}/googletest-build
220
- EXCLUDE_FROM_ALL)
221
- endif()
222
-
223
- add_subdirectory(test)
224
- endif()
225
-
226
- #
227
- # Install cpu_features and list_cpu_features
228
- #
229
-
230
- include(GNUInstallDirs)
231
- install(TARGETS cpu_features list_cpu_features
232
- EXPORT CpuFeaturesTargets
233
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cpu_features
234
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
235
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
236
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
237
- BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
238
- )
239
- install(EXPORT CpuFeaturesTargets
240
- NAMESPACE CpuFeatures::
241
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures
242
- COMPONENT Devel
243
- )
244
- include(CMakePackageConfigHelpers)
245
- configure_package_config_file(cmake/CpuFeaturesConfig.cmake.in
246
- "${PROJECT_BINARY_DIR}/CpuFeaturesConfig.cmake"
247
- INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures"
248
- NO_SET_AND_CHECK_MACRO
249
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
250
- )
251
- write_basic_package_version_file(
252
- "${PROJECT_BINARY_DIR}/CpuFeaturesConfigVersion.cmake"
253
- COMPATIBILITY SameMajorVersion
254
- )
255
- install(
256
- FILES
257
- "${PROJECT_BINARY_DIR}/CpuFeaturesConfig.cmake"
258
- "${PROJECT_BINARY_DIR}/CpuFeaturesConfigVersion.cmake"
259
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures"
260
- COMPONENT Devel
261
- )
@@ -1,23 +0,0 @@
1
- # How to Contribute
2
-
3
- We'd love to accept your patches and contributions to this project. There are
4
- just a few small guidelines you need to follow.
5
-
6
- ## Contributor License Agreement
7
-
8
- Contributions to this project must be accompanied by a Contributor License
9
- Agreement. You (or your employer) retain the copyright to your contribution;
10
- this simply gives us permission to use and redistribute your contributions as
11
- part of the project. Head over to <https://cla.developers.google.com/> to see
12
- your current agreements on file or to sign a new one.
13
-
14
- You generally only need to submit a CLA once, so if you've already submitted one
15
- (even if it was for a different project), you probably don't need to do it
16
- again.
17
-
18
- ## Code reviews
19
-
20
- All submissions, including submissions by project members, require review. We
21
- use GitHub pull requests for this purpose. Consult
22
- [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23
- information on using pull requests.