gitlab-ci: fix "msvc-meson" test job succeeding despite test failures

We have recently noticed that the "msvc-meson" test job in GitLab CI
succeeds even if there are failures. This is somewhat puzzling because
we use exactly the same command as we do on GitHub Actions, and there
the jobs fail as exected.

As it turns out, this is another weirdness of the GitLab CI hosted
runner for Windows [1]: by default, even successful commands will not
make the job fail. Interestingly though, this depends on what exactly
the command is that you're running -- the MinGW-based job for example
works alright and does fail as expected.

The root cause here seems to be specific behaviour of PowerShell. The
invocation of `ForEach-Object` does not bubble up any errors in case the
invocation of `meson test` fails, and thus we don't notice the error.
This is specific to executing the command in a loop: other build steps
where we execute commands directly fail as expected.

This is because the specific version of PowerShell that we use in the
runner does not know about `PSNativeCommandUseErrorActionPreference`
yet, which controls whether native commands like "meson.exe" honor the
`ErrorActionPreference` variable. The preference has been introduced
with PowerShell 7.3 and is default-enabled since PowerShell 7.4, but
GitLab's hosted runners still seem to use PowerShell 5.1. Consequently,
when tests fail, we won't bubble up the error at all from the loop and
thus the job doesn't fail. This isn't an issue in other cases though
where we execute native commands directly, as the GitLab runner knows to
check the last error code after every command.

The same thing doesn't seem to be an issue on GitHub Actions, most
likely because it uses PowerShell 7.4. Curiously, the preference for
`PSNativeCommandUseErrorActionPreference` is disabled there, but the
jobs fail as expected regardless of that. It's puzzling, but I do not
have enough PowerShell expertise to give a definitive answer as to why
it works there.

In any case, Meson 1.8 will likely get support for slicing tests [1], so
we can eventually get rid of the whole PowerShell script. For now, work
around the issue by explicitly exiting out of the loop with a non-zero
error code if we see that Meson has failed.

[1]: https://github.com/mesonbuild/meson/pull/14092

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 file changed
tree: 43f08f5eb34abad40522ec7198fe825d42fe58f1
  1. .github/
  2. bin-wrappers/
  3. block-sha1/
  4. builtin/
  5. ci/
  6. compat/
  7. contrib/
  8. Documentation/
  9. ewah/
  10. git-gui/
  11. gitk-git/
  12. gitweb/
  13. mergetools/
  14. negotiator/
  15. oss-fuzz/
  16. perl/
  17. po/
  18. refs/
  19. reftable/
  20. sha1/
  21. sha1dc/
  22. sha256/
  23. subprojects/
  24. t/
  25. templates/
  26. trace2/
  27. xdiff/
  28. .cirrus.yml
  29. .clang-format
  30. .editorconfig
  31. .gitattributes
  32. .gitignore
  33. .gitlab-ci.yml
  34. .gitmodules
  35. .mailmap
  36. .tsan-suppressions
  37. abspath.c
  38. abspath.h
  39. aclocal.m4
  40. add-interactive.c
  41. add-interactive.h
  42. add-patch.c
  43. advice.c
  44. advice.h
  45. alias.c
  46. alias.h
  47. alloc.c
  48. alloc.h
  49. apply.c
  50. apply.h
  51. archive-tar.c
  52. archive-zip.c
  53. archive.c
  54. archive.h
  55. attr.c
  56. attr.h
  57. banned.h
  58. base85.c
  59. base85.h
  60. bisect.c
  61. bisect.h
  62. blame.c
  63. blame.h
  64. blob.c
  65. blob.h
  66. bloom.c
  67. bloom.h
  68. branch.c
  69. branch.h
  70. builtin.h
  71. bulk-checkin.c
  72. bulk-checkin.h
  73. bundle-uri.c
  74. bundle-uri.h
  75. bundle.c
  76. bundle.h
  77. cache-tree.c
  78. cache-tree.h
  79. cbtree.c
  80. cbtree.h
  81. chdir-notify.c
  82. chdir-notify.h
  83. check-builtins.sh
  84. checkout.c
  85. checkout.h
  86. chunk-format.c
  87. chunk-format.h
  88. CODE_OF_CONDUCT.md
  89. color.c
  90. color.h
  91. column.c
  92. column.h
  93. combine-diff.c
  94. command-list.txt
  95. commit-graph.c
  96. commit-graph.h
  97. commit-reach.c
  98. commit-reach.h
  99. commit-slab-decl.h
  100. commit-slab-impl.h
  101. commit-slab.h
  102. commit.c
  103. commit.h
  104. common-main.c
  105. config.c
  106. config.h
  107. config.mak.dev
  108. config.mak.in
  109. config.mak.uname
  110. configure.ac
  111. connect.c
  112. connect.h
  113. connected.c
  114. connected.h
  115. convert.c
  116. convert.h
  117. copy.c
  118. copy.h
  119. COPYING
  120. credential.c
  121. credential.h
  122. csum-file.c
  123. csum-file.h
  124. ctype.c
  125. daemon.c
  126. date.c
  127. date.h
  128. decorate.c
  129. decorate.h
  130. delta-islands.c
  131. delta-islands.h
  132. delta.h
  133. detect-compiler
  134. diagnose.c
  135. diagnose.h
  136. diff-delta.c
  137. diff-lib.c
  138. diff-merges.c
  139. diff-merges.h
  140. diff-no-index.c
  141. diff.c
  142. diff.h
  143. diffcore-break.c
  144. diffcore-delta.c
  145. diffcore-order.c
  146. diffcore-pickaxe.c
  147. diffcore-rename.c
  148. diffcore-rotate.c
  149. diffcore.h
  150. dir-iterator.c
  151. dir-iterator.h
  152. dir.c
  153. dir.h
  154. editor.c
  155. editor.h
  156. entry.c
  157. entry.h
  158. environment.c
  159. environment.h
  160. exec-cmd.c
  161. exec-cmd.h
  162. fetch-negotiator.c
  163. fetch-negotiator.h
  164. fetch-pack.c
  165. fetch-pack.h
  166. fmt-merge-msg.c
  167. fmt-merge-msg.h
  168. fsck.c
  169. fsck.h
  170. fsmonitor--daemon.h
  171. fsmonitor-ipc.c
  172. fsmonitor-ipc.h
  173. fsmonitor-ll.h
  174. fsmonitor-path-utils.h
  175. fsmonitor-settings.c
  176. fsmonitor-settings.h
  177. fsmonitor.c
  178. fsmonitor.h
  179. generate-cmdlist.sh
  180. generate-configlist.sh
  181. generate-hooklist.sh
  182. generate-perl.sh
  183. generate-python.sh
  184. generate-script.sh
  185. gettext.c
  186. gettext.h
  187. git-archimport.perl
  188. GIT-BUILD-OPTIONS.in
  189. git-compat-util.h
  190. git-curl-compat.h
  191. git-cvsexportcommit.perl
  192. git-cvsimport.perl
  193. git-cvsserver.perl
  194. git-difftool--helper.sh
  195. git-filter-branch.sh
  196. git-instaweb.sh
  197. git-merge-octopus.sh
  198. git-merge-one-file.sh
  199. git-merge-resolve.sh
  200. git-mergetool--lib.sh
  201. git-mergetool.sh
  202. git-p4.py
  203. git-quiltimport.sh
  204. git-request-pull.sh
  205. git-send-email.perl
  206. git-sh-i18n.sh
  207. git-sh-setup.sh
  208. git-submodule.sh
  209. git-svn.perl
  210. GIT-VERSION-FILE.in
  211. GIT-VERSION-GEN
  212. git-web--browse.sh
  213. git-zlib.c
  214. git-zlib.h
  215. git.c
  216. git.rc.in
  217. gpg-interface.c
  218. gpg-interface.h
  219. graph.c
  220. graph.h
  221. grep.c
  222. grep.h
  223. hash-lookup.c
  224. hash-lookup.h
  225. hash.h
  226. hashmap.c
  227. hashmap.h
  228. help.c
  229. help.h
  230. hex-ll.c
  231. hex-ll.h
  232. hex.c
  233. hex.h
  234. hook.c
  235. hook.h
  236. http-backend.c
  237. http-fetch.c
  238. http-push.c
  239. http-walker.c
  240. http.c
  241. http.h
  242. ident.c
  243. ident.h
  244. imap-send.c
  245. INSTALL
  246. iterator.h
  247. json-writer.c
  248. json-writer.h
  249. khash.h
  250. kwset.c
  251. kwset.h
  252. levenshtein.c
  253. levenshtein.h
  254. LGPL-2.1
  255. line-log.c
  256. line-log.h
  257. line-range.c
  258. line-range.h
  259. linear-assignment.c
  260. linear-assignment.h
  261. list-objects-filter-options.c
  262. list-objects-filter-options.h
  263. list-objects-filter.c
  264. list-objects-filter.h
  265. list-objects.c
  266. list-objects.h
  267. list.h
  268. lockfile.c
  269. lockfile.h
  270. log-tree.c
  271. log-tree.h
  272. loose.c
  273. loose.h
  274. ls-refs.c
  275. ls-refs.h
  276. mailinfo.c
  277. mailinfo.h
  278. mailmap.c
  279. mailmap.h
  280. Makefile
  281. match-trees.c
  282. match-trees.h
  283. mem-pool.c
  284. mem-pool.h
  285. merge-blobs.c
  286. merge-blobs.h
  287. merge-ll.c
  288. merge-ll.h
  289. merge-ort-wrappers.c
  290. merge-ort-wrappers.h
  291. merge-ort.c
  292. merge-ort.h
  293. merge-recursive.c
  294. merge-recursive.h
  295. merge.c
  296. merge.h
  297. mergesort.h
  298. meson.build
  299. meson_options.txt
  300. midx-write.c
  301. midx.c
  302. midx.h
  303. name-hash.c
  304. name-hash.h
  305. notes-cache.c
  306. notes-cache.h
  307. notes-merge.c
  308. notes-merge.h
  309. notes-utils.c
  310. notes-utils.h
  311. notes.c
  312. notes.h
  313. object-file-convert.c
  314. object-file-convert.h
  315. object-file.c
  316. object-file.h
  317. object-name.c
  318. object-name.h
  319. object-store-ll.h
  320. object-store.h
  321. object.c
  322. object.h
  323. oid-array.c
  324. oid-array.h
  325. oidmap.c
  326. oidmap.h
  327. oidset.c
  328. oidset.h
  329. oidtree.c
  330. oidtree.h
  331. pack-bitmap-write.c
  332. pack-bitmap.c
  333. pack-bitmap.h
  334. pack-check.c
  335. pack-mtimes.c
  336. pack-mtimes.h
  337. pack-objects.c
  338. pack-objects.h
  339. pack-revindex.c
  340. pack-revindex.h
  341. pack-write.c
  342. pack.h
  343. packfile.c
  344. packfile.h
  345. pager.c
  346. pager.h
  347. parallel-checkout.c
  348. parallel-checkout.h
  349. parse-options-cb.c
  350. parse-options.c
  351. parse-options.h
  352. parse.c
  353. parse.h
  354. patch-delta.c
  355. patch-ids.c
  356. patch-ids.h
  357. path.c
  358. path.h
  359. pathspec.c
  360. pathspec.h
  361. pkt-line.c
  362. pkt-line.h
  363. preload-index.c
  364. preload-index.h
  365. pretty.c
  366. pretty.h
  367. prio-queue.c
  368. prio-queue.h
  369. progress.c
  370. progress.h
  371. promisor-remote.c
  372. promisor-remote.h
  373. prompt.c
  374. prompt.h
  375. protocol-caps.c
  376. protocol-caps.h
  377. protocol.c
  378. protocol.h
  379. prune-packed.c
  380. prune-packed.h
  381. pseudo-merge.c
  382. pseudo-merge.h
  383. quote.c
  384. quote.h
  385. range-diff.c
  386. range-diff.h
  387. reachable.c
  388. reachable.h
  389. read-cache-ll.h
  390. read-cache.c
  391. read-cache.h
  392. README.md
  393. rebase-interactive.c
  394. rebase-interactive.h
  395. rebase.c
  396. rebase.h
  397. ref-filter.c
  398. ref-filter.h
  399. reflog-walk.c
  400. reflog-walk.h
  401. reflog.c
  402. reflog.h
  403. refs.c
  404. refs.h
  405. refspec.c
  406. refspec.h
  407. remote-curl.c
  408. remote.c
  409. remote.h
  410. replace-object.c
  411. replace-object.h
  412. repo-settings.c
  413. repo-settings.h
  414. repository.c
  415. repository.h
  416. rerere.c
  417. rerere.h
  418. reset.c
  419. reset.h
  420. resolve-undo.c
  421. resolve-undo.h
  422. revision.c
  423. revision.h
  424. run-command.c
  425. run-command.h
  426. sane-ctype.h
  427. scalar.c
  428. SECURITY.md
  429. send-pack.c
  430. send-pack.h
  431. sequencer.c
  432. sequencer.h
  433. serve.c
  434. serve.h
  435. server-info.c
  436. server-info.h
  437. setup.c
  438. setup.h
  439. sh-i18n--envsubst.c
  440. sha1dc_git.c
  441. sha1dc_git.h
  442. shallow.c
  443. shallow.h
  444. shared.mak
  445. shell.c
  446. shortlog.h
  447. sideband.c
  448. sideband.h
  449. sigchain.c
  450. sigchain.h
  451. simple-ipc.h
  452. sparse-index.c
  453. sparse-index.h
  454. split-index.c
  455. split-index.h
  456. stable-qsort.c
  457. statinfo.c
  458. statinfo.h
  459. strbuf.c
  460. strbuf.h
  461. streaming.c
  462. streaming.h
  463. string-list.c
  464. string-list.h
  465. strmap.c
  466. strmap.h
  467. strvec.c
  468. strvec.h
  469. sub-process.c
  470. sub-process.h
  471. submodule-config.c
  472. submodule-config.h
  473. submodule.c
  474. submodule.h
  475. symlinks.c
  476. symlinks.h
  477. tag.c
  478. tag.h
  479. tar.h
  480. tempfile.c
  481. tempfile.h
  482. thread-utils.c
  483. thread-utils.h
  484. tmp-objdir.c
  485. tmp-objdir.h
  486. trace.c
  487. trace.h
  488. trace2.c
  489. trace2.h
  490. trailer.c
  491. trailer.h
  492. transport-helper.c
  493. transport-internal.h
  494. transport.c
  495. transport.h
  496. tree-diff.c
  497. tree-walk.c
  498. tree-walk.h
  499. tree.c
  500. tree.h
  501. unicode-width.h
  502. unimplemented.sh
  503. unix-socket.c
  504. unix-socket.h
  505. unix-stream-server.c
  506. unix-stream-server.h
  507. unpack-trees.c
  508. unpack-trees.h
  509. upload-pack.c
  510. upload-pack.h
  511. url.c
  512. url.h
  513. urlmatch.c
  514. urlmatch.h
  515. usage.c
  516. userdiff.c
  517. userdiff.h
  518. utf8.c
  519. utf8.h
  520. varint.c
  521. varint.h
  522. version-def.h.in
  523. version.c
  524. version.h
  525. versioncmp.c
  526. versioncmp.h
  527. walker.c
  528. walker.h
  529. wildmatch.c
  530. wildmatch.h
  531. worktree.c
  532. worktree.h
  533. wrapper.c
  534. wrapper.h
  535. write-or-die.c
  536. write-or-die.h
  537. ws.c
  538. ws.h
  539. wt-status.c
  540. wt-status.h
  541. xdiff-interface.c
  542. xdiff-interface.h
README.md

Build status

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-<commandname>.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission and Documentation/CodingGuidelines).

Those wishing to help with error message, usage and informational message string translations (localization l10) should see po/README.md (a po file is a Portable Object file that holds the translations).

To subscribe to the list, send an email to git+subscribe@vger.kernel.org (see https://subspace.kernel.org/subscribing.html for details). The mailing list archives are available at https://lore.kernel.org/git/, https://marc.info/?l=git and other archival sites.

Issues which are security relevant should be disclosed privately to the Git Security mailing list git-security@googlegroups.com.

The maintainer frequently sends the “What's cooking” reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name “git” was given by Linus Torvalds when he wrote the very first version. He described the tool as “the stupid content tracker” and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of “get” may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • “global information tracker”: you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • “goddamn idiotic truckload of sh*t”: when it breaks