Skip to content

Commit 015f0e9

Browse files
authored
Component Governance fix: Update libyaml (#4583)
Component governance fix: update libyaml
2 parents c555273 + 2b759cc commit 015f0e9

File tree

21 files changed

+303
-36
lines changed

21 files changed

+303
-36
lines changed

cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"git": {
1717
"repositoryUrl": "https://github.com/yaml/libyaml.git",
18-
"commitHash": "2c891fc7a770e8ba2fec34fc6b545c672beb37e6"
18+
"commitHash": "840b65c40675e2d06bf40405ad3f12dec7f35923"
1919
}
2020
}
2121
},
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: dist
2+
3+
on:
4+
push:
5+
branches: [ release/* ]
6+
7+
jobs:
8+
dist:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- run: env | sort
14+
15+
- name: Get image
16+
run: |
17+
time docker pull yamlio/libyaml-dev
18+
docker images | grep libyaml
19+
20+
- run: |
21+
make -C pkg/docker libyaml-dist-ci
22+
ls -l pkg/docker/output
23+
24+
- uses: actions/upload-artifact@v2
25+
with:
26+
name: release
27+
path: pkg/docker/output/yaml-0*
28+

src/YamlCppLib/libyaml/.github/workflows/main.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010

1111
build:
1212

13+
env:
14+
CC: ${{ matrix.compiler }}
1315
runs-on: ${{ matrix.os }}
1416
strategy:
1517
matrix:
@@ -21,16 +23,15 @@ jobs:
2123
- macOS-latest
2224

2325
steps:
24-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2527

2628
- run: env | sort
2729
- name: Install software
30+
if: ${{ matrix.os == 'macOS-latest' }}
2831
run: |
29-
if [[ '${{ matrix.os }}' == macOS-latest ]]; then
30-
brew install automake bash coreutils make
31-
echo ::add-path::/usr/local/opt/coreutils/libexec/gnubin
32-
echo ::add-path::/usr/local/opt/make/libexec/gnubin
33-
fi
32+
brew install automake bash coreutils make libtool
33+
echo "/usr/local/opt/coreutils/libexec/gnubin" >> $GITHUB_PATH
34+
echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH
3435
- name: Fetch branches
3536
run: |
3637
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
@@ -48,12 +49,6 @@ jobs:
4849
4950
- name: Compiler version
5051
run: ${{ matrix.compiler }} --version
51-
env:
52-
CC: ${{ matrix.compiler }}
5352
- run: cmake .
54-
env:
55-
CC: ${{ matrix.compiler }}
5653
- run: make
57-
env:
58-
CC: ${{ matrix.compiler }}
5954
- run: make test

src/YamlCppLib/libyaml/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ config.h*
2828
/configure
2929
stamp-h1
3030
!config/config.h.in
31-
/packaging/
3231
/tests/run-dumper
3332
/tests/run-emitter
3433
/tests/run-emitter-test-suite

src/YamlCppLib/libyaml/.makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ MAKE_TARGETS := \
2323
all \
2424
all-am \
2525
all-recursive \
26+
docker-build \
27+
docker-dist \
2628
install \
2729
test \
2830
test-all \

src/YamlCppLib/libyaml/Makefile.am

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ maintainer-clean-local:
1717
-find ${builddir} -name Makefile.in -exec rm -f '{}' ';'
1818

1919
distclean-local:
20-
rm -fr tests/run-test-suite packaging
20+
rm -fr tests/run-test-suite
2121
-git worktree prune
2222

2323
.PHONY: bootstrap
@@ -43,12 +43,9 @@ ifeq ($(LIBYAML_TEST_SUITE_RUN_REPO),$(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT))
4343
git clone --branch $(LIBYAML_TEST_SUITE_RUN_BRANCH) $(LIBYAML_TEST_SUITE_RUN_REPO) $@
4444
endif
4545

46-
packaging:
47-
-git branch --track $@ origin/$@
48-
git worktree add --force $@ $@
46+
docker-build:
47+
make -C pkg/docker build
4948

50-
docker-dist: packaging
51-
make -C $</docker libyaml-dist
49+
docker-dist:
50+
make -C pkg/docker libyaml-dist
5251

53-
docker-test-pyyaml: packaging
54-
make -C $</docker test-pyyaml

src/YamlCppLib/libyaml/examples/strings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unqouted: string
1+
unquoted: string
22
literal-block: |
33
This entire block of text will be the value of the 'literal-block' key,
44
with line breaks being preserved.

src/YamlCppLib/libyaml/include/yaml.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ typedef struct yaml_parser_s {
10951095
yaml_error_type_t error;
10961096
/** Error description. */
10971097
const char *problem;
1098-
/** The byte about which the problem occured. */
1098+
/** The byte about which the problem occurred. */
10991099
size_t problem_offset;
11001100
/** The problematic value (@c -1 is none). */
11011101
int problem_value;
@@ -1335,7 +1335,7 @@ yaml_parser_delete(yaml_parser_t *parser);
13351335
* Set a string input.
13361336
*
13371337
* Note that the @a input pointer must be valid while the @a parser object
1338-
* exists. The application is responsible for destroing @a input after
1338+
* exists. The application is responsible for destroying @a input after
13391339
* destroying the @a parser.
13401340
*
13411341
* @param[in,out] parser A parser object.
@@ -1456,6 +1456,20 @@ yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event);
14561456
YAML_DECLARE(int)
14571457
yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document);
14581458

1459+
/**
1460+
* Set the maximum depth of nesting.
1461+
*
1462+
* Default: 1000
1463+
*
1464+
* Each nesting level increases the stack and the number of previous
1465+
* starting events that the parser has to check.
1466+
*
1467+
* @param[in] max The maximum number of allowed nested events
1468+
*/
1469+
1470+
YAML_DECLARE(void)
1471+
yaml_set_max_nest_level(int max);
1472+
14591473
/** @} */
14601474

14611475
/**
@@ -1734,7 +1748,7 @@ typedef struct yaml_emitter_s {
17341748
size_t length;
17351749
/** Does the scalar contain line breaks? */
17361750
int multiline;
1737-
/** Can the scalar be expessed in the flow plain style? */
1751+
/** Can the scalar be expressed in the flow plain style? */
17381752
int flow_plain_allowed;
17391753
/** Can the scalar be expressed in the block plain style? */
17401754
int block_plain_allowed;
@@ -1950,7 +1964,7 @@ yaml_emitter_close(yaml_emitter_t *emitter);
19501964
/**
19511965
* Emit a YAML document.
19521966
*
1953-
* The documen object may be generated using the yaml_parser_load() function
1967+
* The document object may be generated using the yaml_parser_load() function
19541968
* or the yaml_document_initialize() function. The emitter takes the
19551969
* responsibility for the document object and destroys its content after
19561970
* it is emitted. The document object is destroyed even if the function fails.

src/YamlCppLib/libyaml/pkg/ReadMe.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# How to Make a `libyaml` Release
2+
3+
## Versioning
4+
5+
Update libyaml version in:
6+
* announcement.msg
7+
* Changes
8+
* CMakeLists.txt
9+
* `YAML_VERSION_MAJOR`, `YAML_VERSION_MINOR`, `YAML_VERSION_PATCH`
10+
* .appveyor.yml
11+
* configure.ac
12+
* `YAML_MAJOR`, `YAML_MINOR`, `YAML_PATCH`, `YAML_RELEASE`, `YAML_CURRENT`, `YAML_REVISION`
13+
14+
Commit and push everything to `release/0.x.y`.
15+
16+
## Test and Create Release Archives
17+
18+
### GitHub Actions Automation
19+
20+
The github workflow:
21+
22+
.github/workflows/dist.yaml
23+
24+
will do this automatically for you.
25+
26+
#### .github/workflows/dist.yaml
27+
28+
This workflow will create release archives (`tar.gz` and `zip`).
29+
30+
### Manually
31+
32+
Make sure you have a clean git repository (no changed files).
33+
The following process will clone your current git directory.
34+
35+
This will need the docker image `yamlio/libyaml-dev`.
36+
You can either pull it, or create it yourself:
37+
38+
make docker-build
39+
40+
### Create dist archives
41+
42+
Run:
43+
44+
make docker-dist
45+
46+
It will run `make dist` in the container to create a tarball written to
47+
`pkg/docker/output`.
48+
It will also create a zipfile.
49+
50+
## Update master
51+
52+
git merge release/0.x.y
53+
git tag -a 0.x.y
54+
# <Editor opens>
55+
# Paste the corresponding entry from the Changes file
56+
# Look at an earlier release for how it should look like:
57+
# git show 0.2.3
58+
git push origin master 0.x.y
59+
60+
## Create a GitHub release
61+
62+
Go to "Releases" and click on "Draft a new release".
63+
64+
Fill in the tag you just created in the previous step.
65+
66+
Fill in the release title: v0.x.y
67+
68+
Paste the changelog into the description field.
69+
70+
Upload the tar.gz and .zip file.
71+
72+
You can "Save draft" and publish later, or directly click on "Publish release".
73+
74+
## Update pyyaml.org
75+
76+
See <https://github.com/yaml/pyyaml.org/blob/master/ReadMe.md>.
77+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output/*
2+
!Makefile
3+
!output/ReadMe

0 commit comments

Comments
 (0)