Skip to content

Commit 089f2b7

Browse files
committed
Merge commit '0f10a05d2e1043dcc178736b82277223a76eacc9'
2 parents 6e5fe0f + 0f10a05 commit 089f2b7

File tree

12 files changed

+91
-40
lines changed

12 files changed

+91
-40
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include:
22
- component: "gitlab.gnome.org/GNOME/citemplates/release-service@master"
33
inputs:
44
dist-job-name: "dist"
5-
tarball-artifact-path: "libxml2-dist/libxml2-2.14.0.tar.xz"
5+
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
66

77
.test:
88
image: registry.gitlab.gnome.org/gnome/libxml2
@@ -300,9 +300,12 @@ dist:
300300
image: registry.gitlab.gnome.org/gnome/libxml2
301301
script:
302302
- sh .gitlab-ci/dist.sh
303+
- echo "TARBALL_ARTIFACT_PATH=$(ls libxml2-dist/*.tar.xz)" >> build.env
303304
artifacts:
304305
paths:
305306
- libxml2-dist/*.tar.xz
307+
reports:
308+
dotenv: build.env
306309

307310
pages:
308311
script:

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,15 @@ endif()
410410

411411
set(LIBXML_MINOR_COMPAT 14)
412412
math(EXPR LIBXML_SOVERSION "${LIBXML_MAJOR_VERSION} + ${LIBXML_MINOR_COMPAT}")
413+
math(EXPR LIBXML_AGE "${LIBXML_MINOR_VERSION} - ${LIBXML_MINOR_COMPAT}")
413414
set_target_properties(
414415
LibXml2
415416
PROPERTIES
416417
IMPORT_PREFIX lib
417418
OUTPUT_NAME xml2
418419
POSITION_INDEPENDENT_CODE ON
419420
PREFIX lib
420-
VERSION ${PROJECT_VERSION}
421+
VERSION "${LIBXML_SOVERSION}.${LIBXML_AGE}.${LIBXML_MICRO_VERSION}"
421422
SOVERSION ${LIBXML_SOVERSION}
422423
)
423424

MAINTAINERS.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ You can get started by running
5252

5353
Update the version number in `VERSION` if you haven't done so already.
5454

55-
IMPORTANT: Update the version number of `tarball-artifact-path` in
56-
`.gitlab-ci.yml`. This must be done manually for now.
57-
5855
### Commit and verify tarball
5956

6057
Release tarballs are generated with a CI job and the `.gitlab-ci/dist.sh`

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ EXTRA_DIST = Copyright libxml2-config.cmake.in autogen.sh \
215215
timsort.h \
216216
README.zOS README.md \
217217
CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \
218-
meson.build meson_options.txt
218+
meson.build meson_options.txt xml2-config-meson
219219

220220

221221
pkgconfigdir = $(libdir)/pkgconfig

NEWS

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
NEWS file for libxml2
22

3+
v2.14.1: Apr 3 2025
4+
5+
### Regressions
6+
7+
- parser: Fix XML_PARSE_NOBLANKS dropping non-whitespace text
8+
9+
### Build systems
10+
11+
- win32-legacy: Fix build (ThomasK)
12+
- meson: Fix build from tarball
13+
- cmake, meson: Change library filename to libxml2.so.16.0.0
14+
15+
316
v2.14.0: Mar 27 2025
417

518
### Major changes
@@ -38,6 +51,14 @@ Overflow checks before reallocations were hardenend.
3851

3952
Some unprefixed symbols were renamed to avoid namespace pollution.
4053

54+
### Other potentially incompatible changes
55+
56+
Strings passed to the "characters" callback of the HTML SAX parser
57+
aren't null-terminated anymore, matching the behavior of the XML
58+
parser. Custom SAX parsers must use the "len" argument.
59+
60+
xmlIOParseDTD doesn't allow null bytes at the end of the input anymore.
61+
4162
### New features
4263

4364
Input callbacks can now be set on a parser context and an improved API

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.14.0
1+
2.14.1

meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,15 +478,17 @@ foreach file : xml_opt_src
478478
endforeach
479479

480480
v_min_compat = 14
481+
so_version = v_maj + v_min_compat
482+
age = v_min - v_min_compat
481483
xml_lib = library(
482484
'xml2',
483485
files(xml_src),
484486
c_args: libxml2_cflags,
485487
dependencies: xml_deps,
486488
include_directories: config_dir,
487489
install: true,
488-
version: meson.project_version(),
489-
soversion: v_maj + v_min_compat,
490+
version: f'@so_version@.@age@.@v_mic@',
491+
soversion: so_version,
490492
)
491493

492494
dep_inc = include_directories('include')

parser.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4778,7 +4778,8 @@ static const unsigned char test_char_data[256] = {
47784778
};
47794779

47804780
static void
4781-
xmlCharacters(xmlParserCtxtPtr ctxt, const xmlChar *buf, int size) {
4781+
xmlCharacters(xmlParserCtxtPtr ctxt, const xmlChar *buf, int size,
4782+
int isBlank) {
47824783
int checkBlanks;
47834784

47844785
if ((ctxt->sax == NULL) || (ctxt->disableSAX))
@@ -4793,7 +4794,7 @@ xmlCharacters(xmlParserCtxtPtr ctxt, const xmlChar *buf, int size) {
47934794
* essentially unusable.
47944795
*/
47954796
if ((checkBlanks) &&
4796-
(areBlanks(ctxt, buf, size, 1))) {
4797+
(areBlanks(ctxt, buf, size, isBlank))) {
47974798
if ((ctxt->sax->ignorableWhitespace != NULL) &&
47984799
(ctxt->keepBlanks))
47994800
ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
@@ -4855,7 +4856,7 @@ xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
48554856
const xmlChar *tmp = ctxt->input->cur;
48564857
ctxt->input->cur = in;
48574858

4858-
xmlCharacters(ctxt, tmp, nbchar);
4859+
xmlCharacters(ctxt, tmp, nbchar, 1);
48594860
}
48604861
return;
48614862
}
@@ -4891,7 +4892,7 @@ xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
48914892
const xmlChar *tmp = ctxt->input->cur;
48924893
ctxt->input->cur = in;
48934894

4894-
xmlCharacters(ctxt, tmp, nbchar);
4895+
xmlCharacters(ctxt, tmp, nbchar, 0);
48954896

48964897
line = ctxt->input->line;
48974898
col = ctxt->input->col;
@@ -4958,7 +4959,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
49584959
if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
49594960
buf[nbchar] = 0;
49604961

4961-
xmlCharacters(ctxt, buf, nbchar);
4962+
xmlCharacters(ctxt, buf, nbchar, 0);
49624963
nbchar = 0;
49634964
SHRINK;
49644965
}
@@ -4967,7 +4968,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
49674968
if (nbchar != 0) {
49684969
buf[nbchar] = 0;
49694970

4970-
xmlCharacters(ctxt, buf, nbchar);
4971+
xmlCharacters(ctxt, buf, nbchar, 0);
49714972
}
49724973
/*
49734974
* cur == 0 can mean

testparser.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,39 @@ testCtxtParseContent(void) {
255255

256256
return err;
257257
}
258+
259+
static int
260+
testNoBlanks(void) {
261+
const xmlChar xml[] =
262+
"<refentry>\n"
263+
" <refsect1>\n"
264+
" <para>\n"
265+
" Run <command>tester --help</command> for more options.\n"
266+
" </para>\n"
267+
" </refsect1>\n"
268+
"</refentry>\n";
269+
const xmlChar expect[] =
270+
"<?xml version=\"1.0\"?>\n"
271+
"<refentry><refsect1><para>\n"
272+
" Run <command>tester --help</command> for more options.\n"
273+
" </para></refsect1></refentry>\n";
274+
xmlDocPtr doc;
275+
xmlChar *out;
276+
int size;
277+
int err = 0;
278+
279+
doc = xmlReadDoc(xml, NULL, NULL, XML_PARSE_NOBLANKS);
280+
xmlDocDumpMemory(doc, &out, &size);
281+
xmlFreeDoc(doc);
282+
283+
if (!xmlStrEqual(out, expect)) {
284+
fprintf(stderr, "parsing with XML_PARSE_NOBLANKS failed\n");
285+
err = 1;
286+
}
287+
xmlFree(out);
288+
289+
return err;
290+
}
258291
#endif /* LIBXML_OUTPUT_ENABLED */
259292

260293
#ifdef LIBXML_SAX1_ENABLED
@@ -1123,6 +1156,7 @@ main(void) {
11231156
#endif
11241157
#ifdef LIBXML_OUTPUT_ENABLED
11251158
err |= testCtxtParseContent();
1159+
err |= testNoBlanks();
11261160
#endif
11271161
#ifdef LIBXML_SAX1_ENABLED
11281162
err |= testBalancedChunk();

win32/Makefile.bcb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,12 @@ XML_OBJS = $(XML_INTDIR)\buf.obj\
121121
$(XML_INTDIR)\hash.obj\
122122
$(XML_INTDIR)\HTMLparser.obj\
123123
$(XML_INTDIR)\HTMLtree.obj\
124-
$(XML_INTDIR)\legacy.obj\
125124
$(XML_INTDIR)\list.obj\
126125
$(XML_INTDIR)\nanohttp.obj\
127126
$(XML_INTDIR)\parser.obj\
128127
$(XML_INTDIR)\parserInternals.obj\
129128
$(XML_INTDIR)\pattern.obj\
130129
$(XML_INTDIR)\relaxng.obj\
131-
$(XML_INTDIR)\SAX.obj\
132130
$(XML_INTDIR)\SAX2.obj\
133131
$(XML_INTDIR)\schematron.obj\
134132
$(XML_INTDIR)\threads.obj\
@@ -165,14 +163,12 @@ XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
165163
$(XML_INTDIR_A)\hash.obj\
166164
$(XML_INTDIR_A)\HTMLparser.obj\
167165
$(XML_INTDIR_A)\HTMLtree.obj\
168-
$(XML_INTDIR_A)\legacy.obj\
169166
$(XML_INTDIR_A)\list.obj\
170167
$(XML_INTDIR_A)\nanohttp.obj\
171168
$(XML_INTDIR_A)\parser.obj\
172169
$(XML_INTDIR_A)\parserInternals.obj\
173170
$(XML_INTDIR_A)\pattern.obj\
174171
$(XML_INTDIR_A)\relaxng.obj\
175-
$(XML_INTDIR_A)\SAX.obj\
176172
$(XML_INTDIR_A)\SAX2.obj\
177173
$(XML_INTDIR_A)\schematron.obj\
178174
$(XML_INTDIR_A)\threads.obj\

win32/Makefile.msvc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,13 @@ XML_OBJS = $(XML_INTDIR)\buf.obj\
115115
$(XML_INTDIR)\hash.obj\
116116
$(XML_INTDIR)\HTMLparser.obj\
117117
$(XML_INTDIR)\HTMLtree.obj\
118-
$(XML_INTDIR)\legacy.obj\
119118
$(XML_INTDIR)\list.obj\
120119
$(XML_INTDIR)\nanohttp.obj\
121120
$(XML_INTDIR)\parser.obj\
122121
$(XML_INTDIR)\parserInternals.obj\
123122
$(XML_INTDIR)\pattern.obj\
124123
$(XML_INTDIR)\relaxng.obj\
125124
$(XML_INTDIR)\SAX2.obj\
126-
$(XML_INTDIR)\SAX.obj\
127125
$(XML_INTDIR)\schematron.obj\
128126
$(XML_INTDIR)\threads.obj\
129127
$(XML_INTDIR)\tree.obj\
@@ -159,15 +157,13 @@ XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
159157
$(XML_INTDIR_A)\hash.obj\
160158
$(XML_INTDIR_A)\HTMLparser.obj\
161159
$(XML_INTDIR_A)\HTMLtree.obj\
162-
$(XML_INTDIR_A)\legacy.obj\
163160
$(XML_INTDIR_A)\list.obj\
164161
$(XML_INTDIR_A)\nanohttp.obj\
165162
$(XML_INTDIR_A)\parser.obj\
166163
$(XML_INTDIR_A)\parserInternals.obj\
167164
$(XML_INTDIR_A)\pattern.obj\
168165
$(XML_INTDIR_A)\relaxng.obj\
169166
$(XML_INTDIR_A)\SAX2.obj\
170-
$(XML_INTDIR_A)\SAX.obj\
171167
$(XML_INTDIR_A)\schematron.obj\
172168
$(XML_INTDIR_A)\threads.obj\
173169
$(XML_INTDIR_A)\tree.obj\
@@ -203,15 +199,13 @@ XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\
203199
$(XML_INTDIR_A_DLL)\hash.obj\
204200
$(XML_INTDIR_A_DLL)\HTMLparser.obj\
205201
$(XML_INTDIR_A_DLL)\HTMLtree.obj\
206-
$(XML_INTDIR_A_DLL)\legacy.obj\
207202
$(XML_INTDIR_A_DLL)\list.obj\
208203
$(XML_INTDIR_A_DLL)\nanohttp.obj\
209204
$(XML_INTDIR_A_DLL)\parser.obj\
210205
$(XML_INTDIR_A_DLL)\parserInternals.obj\
211206
$(XML_INTDIR_A_DLL)\pattern.obj\
212207
$(XML_INTDIR_A_DLL)\relaxng.obj\
213208
$(XML_INTDIR_A_DLL)\SAX2.obj\
214-
$(XML_INTDIR_A_DLL)\SAX.obj\
215209
$(XML_INTDIR_A_DLL)\schematron.obj\
216210
$(XML_INTDIR_A_DLL)\threads.obj\
217211
$(XML_INTDIR_A_DLL)\tree.obj\

win32/configure.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var srcDirUtils = "..";
1414
var baseName = "libxml2";
1515
/* Configure file which contains the version and the output file where
1616
we can store our build configuration. */
17-
var configFile = srcDirXml + "\\configure.ac";
17+
var libxmlVersionFile = srcDirXml + "\\VERSION";
1818
var versionFile = ".\\config.msvc";
1919
/* Input and output files regarding the libxml features. */
2020
var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in";
@@ -45,6 +45,7 @@ var withDebug = true;
4545
var withSchemas = true;
4646
var withSchematron = true;
4747
var withRegExps = true;
48+
var withRelaxNg = true;
4849
var withModules = true;
4950
var withTree = true;
5051
var withReader = true;
@@ -124,6 +125,7 @@ function usage()
124125
txt += " lzma: Enable lzma support (" + (withLzma? "yes" : "no") + ")\n";
125126
txt += " xml_debug: Enable XML debbugging module (" + (withDebug? "yes" : "no") + ")\n";
126127
txt += " regexps: Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
128+
txt += " relaxng: Enable RELAX NG support (" + (withRelaxNg ? "yes" : "no") + ")\n";
127129
txt += " modules: Enable module support (" + (withModules? "yes" : "no") + ")\n";
128130
txt += " tree: Enable tree api (" + (withTree? "yes" : "no") + ")\n";
129131
txt += " reader: Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n";
@@ -170,7 +172,7 @@ function discoverVersion()
170172
var fso, cf, vf, ln, s, iDot, iSlash;
171173
fso = new ActiveXObject("Scripting.FileSystemObject");
172174
verCvs = "";
173-
cf = fso.OpenTextFile(configFile, 1);
175+
cf = fso.OpenTextFile(libxmlVersionFile, 1);
174176
if (compiler == "msvc")
175177
versionFile = ".\\config.msvc";
176178
else if (compiler == "mingw")
@@ -184,19 +186,13 @@ function discoverVersion()
184186
while (cf.AtEndOfStream != true) {
185187
ln = cf.ReadLine();
186188
s = new String(ln);
187-
if (m = s.match(/^m4_define\(\[MAJOR_VERSION\], (\w+)\)/)) {
188-
vf.WriteLine("LIBXML_MAJOR_VERSION=" + m[1]);
189-
verMajor = m[1];
190-
} else if(m = s.match(/^m4_define\(\[MINOR_VERSION\], (\w+)\)/)) {
191-
vf.WriteLine("LIBXML_MINOR_VERSION=" + m[1]);
192-
verMinor = m[1];
193-
} else if(m = s.match(/^m4_define\(\[MICRO_VERSION\], (\w+)\)/)) {
194-
vf.WriteLine("LIBXML_MICRO_VERSION=" + m[1]);
195-
verMicro = m[1];
196-
} else if(s.search(/^LIBXML_MICRO_VERSION_SUFFIX=/) != -1) {
197-
vf.WriteLine(s);
198-
verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length);
199-
}
189+
versionSplit = s.split(".");
190+
verMajor = versionSplit[0];
191+
vf.WriteLine("LIBXML_MAJOR_VERSION=" + verMajor);
192+
verMinor = versionSplit[1];
193+
vf.WriteLine("LIBXML_MINOR_VERSION=" + verMinor);
194+
verMicro = versionSplit[2];
195+
vf.WriteLine("LIBXML_MICRO_VERSION=" + verMicro);
200196
}
201197
cf.Close();
202198
vf.WriteLine("XML_SRCDIR=" + srcDirXml);
@@ -218,6 +214,7 @@ function discoverVersion()
218214
vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
219215
vf.WriteLine("WITH_SCHEMATRON=" + (withSchematron? "1" : "0"));
220216
vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
217+
vf.WriteLine("WITH_RELAXNG=" + (withRelaxNg ? "1" : "0"));
221218
vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
222219
vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0"));
223220
vf.WriteLine("WITH_READER=" + (withReader? "1" : "0"));
@@ -320,6 +317,8 @@ function configureLibxml()
320317
of.WriteLine(s.replace(/\@WITH_SCHEMATRON\@/, withSchematron? "1" : "0"));
321318
} else if (s.search(/\@WITH_REGEXPS\@/) != -1) {
322319
of.WriteLine(s.replace(/\@WITH_REGEXPS\@/, withRegExps? "1" : "0"));
320+
} else if (s.search(/\@WITH_RELAXNG\@/) != -1) {
321+
of.WriteLine(s.replace(/\@WITH_RELAXNG\@/, withRelaxNg? "1" : "0"));
323322
} else if (s.search(/\@WITH_MODULES\@/) != -1) {
324323
of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
325324
} else if (s.search(/\@MODULE_EXTENSION\@/) != -1) {
@@ -465,6 +464,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
465464
withSchematron = strToBool(arg.substring(opt.length + 1, arg.length));
466465
else if (opt == "regexps")
467466
withRegExps = strToBool(arg.substring(opt.length + 1, arg.length));
467+
else if (opt == "relaxng")
468+
withRelaxNg = strToBool(arg.substring(opt.length + 1, arg.length));
468469
else if (opt == "modules")
469470
withModules = strToBool(arg.substring(opt.length + 1, arg.length));
470471
else if (opt == "tree")
@@ -634,6 +635,7 @@ txtOut += " zlib support: " + boolToStr(withZlib) + "\n";
634635
txtOut += " lzma support: " + boolToStr(withLzma) + "\n";
635636
txtOut += " Debugging module: " + boolToStr(withDebug) + "\n";
636637
txtOut += " Regexp support: " + boolToStr(withRegExps) + "\n";
638+
txtOut += " Relax NG support: " + boolToStr(withRelaxNg) + "\n";
637639
txtOut += " Module support: " + boolToStr(withModules) + "\n";
638640
txtOut += " Tree support: " + boolToStr(withTree) + "\n";
639641
txtOut += " Reader support: " + boolToStr(withReader) + "\n";

0 commit comments

Comments
 (0)