Manjaro怎么把安装的程序放到Applications

自己下载安装的程序在Manjaro的Applications搜索不到,每次从opt目录点进去打开太麻烦了。解决需要手动创建一个 .desktop 快捷方式文件

  1. 创建桌面入口文件
    在终端中使用编辑器(如 nano)在用户应用目录中创建一个新文件:
    1
    vi ~/.local/share/applications/软件名.desktop
  2. 编写文件内容
    将以下模板复制并粘贴到文件中,根据实际情况修改路径:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [Desktop Entry]
    Version=1.0
    Name=你的应用名称 (e.g., IntelliJ IDEA)
    Comment=你的应用描述 (e.g., Powerful IDE)
    Exec=/opt/your-app-name/bin/your-executable-file %U # 替换成你的实际路径
    Icon=/opt/your-app-name/icon.png # 替换成你的图标路径 (可选)
    Terminal=false
    Type=Application
    Categories=Development;IDE; # 替换成适合你应用的分类

关键字段说明:
Name: 搜索栏中显示的名称。
Exec: 程序启动文件的绝对路径。 %U 支持一次性打开多个文件或链接。
Icon: 图标文件的路径(通常在 /opt 目录下可以找到 .png 或 .svg 文件)。
Terminal: 如果程序需要打开终端运行,设为 true;普通图形界面程序设为 false。

  1. 设置可执行
    1
    chmod +x ~/.local/share/applications/软件名.desktop

manjaro安装lxml报错解决

OS: Manjaro xfc
Python: 3.13.11
lxml: 4.9.7
通过requirements.txt文件安装报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
[output] Collecting lxml==4.9.4
[output] Using cached lxml-4.9.4.tar.gz (3.6 MB)
[output] Installing build dependencies: started
[output] Installing build dependencies: finished with status 'done'
[output] Getting requirements to build wheel: started
[output] Getting requirements to build wheel: finished with status 'done'
[output] Preparing metadata (pyproject.toml): started
[output] Preparing metadata (pyproject.toml): finished with status 'done'
[output] Collecting openpyxl==2.5.12
[output] Using cached openpyxl-2.5.12-py2.py3-none-any.whl
[output] Collecting requests==2.31.0
[output] Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
[output] Collecting jdcal (from openpyxl==2.5.12)
[output] Using cached jdcal-1.4.1-py2.py3-none-any.whl.metadata (5.0 kB)
[output] Collecting et_xmlfile (from openpyxl==2.5.12)
[output] Using cached et_xmlfile-2.0.0-py3-none-any.whl.metadata (2.7 kB)
[output] Collecting charset-normalizer<4,>=2 (from requests==2.31.0)
[output] Using cached charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (37 kB)
[output] Collecting idna<4,>=2.5 (from requests==2.31.0)
[output] Using cached idna-3.11-py3-none-any.whl.metadata (8.4 kB)
[output] Collecting urllib3<3,>=1.21.1 (from requests==2.31.0)
[output] Using cached urllib3-2.6.3-py3-none-any.whl.metadata (6.9 kB)
[output] Collecting certifi>=2017.4.17 (from requests==2.31.0)
[output] Using cached certifi-2026.1.4-py3-none-any.whl.metadata (2.5 kB)
[output] Using cached requests-2.31.0-py3-none-any.whl (62 kB)
[output] Using cached certifi-2026.1.4-py3-none-any.whl (152 kB)
[output] Using cached charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (153 kB)
[output] Using cached idna-3.11-py3-none-any.whl (71 kB)
[output] Using cached urllib3-2.6.3-py3-none-any.whl (131 kB)
[output] Using cached et_xmlfile-2.0.0-py3-none-any.whl (18 kB)
[output] Using cached jdcal-1.4.1-py2.py3-none-any.whl (9.5 kB)
[output] Building wheels for collected packages: lxml
[output] Building wheel for lxml (pyproject.toml): started
[output] Building wheel for lxml (pyproject.toml): finished with status 'error'
[output] Failed to build lxml
[error] error: subprocess-exited-with-error
[error]
[error] × Building wheel for lxml (pyproject.toml) did not run successfully.
[error] │ exit code: 1
[error] ╰─> [425 lines of output]
[error] <string>:67: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
[error] /tmp/pip-build-env-2w5tteta/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
[error] !!
[error]
[error] ********************************************************************************
[error] Please consider removing the following classifiers in favor of a SPDX license expression:
[error]
[error] License :: OSI Approved :: BSD License
[error]
[error] See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
[error] ********************************************************************************
[error]
[error] !!
[error] self._finalize_license_expression()
[error] Building lxml version 4.9.4.
[error] Building without Cython.
[error] Building against libxml2 2.15.1 and libxslt 1.1.45
[error] running bdist_wheel
[error] running build
[error] running build_py
[error] creating build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/sax.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/cssselect.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/builder.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/__init__.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-cpython-313/lxml
[error] creating build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] creating build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/diff.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/defs.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/clean.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/builder.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-cpython-313/lxml/html
[error] creating build/lib.linux-x86_64-cpython-313/lxml/isoschematron
[error] copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron
[error] copying src/lxml/etree.h -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/etree_api.h -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/objectify.pyx -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/etree.pyx -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xsltext.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xslt.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xpath.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xmlschema.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xmlid.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xmlerror.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/xinclude.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/serializer.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/schematron.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/saxparser.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/relaxng.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/readonlytree.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/public-api.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/proxy.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/parsertarget.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/parser.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/objectpath.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/nsclasses.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/iterparse.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/extensions.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/dtd.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/docloader.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/debug.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/cleanup.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/classlookup.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/apihelpers.pxi -> build/lib.linux-x86_64-cpython-313/lxml
[error] copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/__init__.pxd -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-cpython-313/lxml/includes
[error] creating build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/rng
[error] copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/rng
[error] creating build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl
[error] copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl
[error] copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl
[error] creating build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-cpython-313/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
[error] running build_ext
[error] building 'lxml.etree' extension
[error] creating build/temp.linux-x86_64-cpython-313/src/lxml
[error] gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/home/project/test/.venv/include -I/usr/include/python3.13 -c src/lxml/etree.c -o build/temp.linux-x86_64-cpython-313/src/lxml/etree.o -w
[error] src/lxml/etree.c: In function ‘__Pyx_init_assertions_enabled’:
[error] src/lxml/etree.c:5988:39: error: implicit declaration of function ‘_PyInterpreterState_GetConfig’; did you mean ‘PyInterpreterState_GetID’? [-Wimplicit-function-declaration]
[error] 5988 | __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | PyInterpreterState_GetID
[error] src/lxml/etree.c:5988:105: error: invalid type argument of ‘->’ (have ‘int’)
[error] 5988 | __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
[error] | ^~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_fixThreadDictNamesForDtd’:
[error] src/lxml/etree.c:19193:49: error: passing argument 1 of ‘__pyx_f_4lxml_5etree__fixThreadDictPtr’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 19193 | __pyx_f_4lxml_5etree__fixThreadDictPtr((&__pyx_v_c_attribute->defaultValue), __pyx_v_c_src_dict, __pyx_v_c_dict);
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | xmlChar ** {aka unsigned char **}
[error] src/lxml/etree.c:18536:82: note: expected ‘const xmlChar **’ {aka ‘const unsigned char **’} but argument is of type ‘xmlChar **’ {aka ‘unsigned char **’}
[error] 18536 | static CYTHON_INLINE void __pyx_f_4lxml_5etree__fixThreadDictPtr(const xmlChar **__pyx_v_c_ptr, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
[error] | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_14_ParserContext_prepare’:
[error] src/lxml/etree.c:113221:38: error: assignment to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} from incompatible pointer type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’} [-Wincompatible-pointer-types]
[error] 113221 | __pyx_v_self->_c_ctxt->sax->serror = __pyx_f_4lxml_5etree__receiveParserError;
[error] | ^
[error] src/lxml/etree.c:7472:13: note: ‘__pyx_f_4lxml_5etree__receiveParserError’ declared here
[error] 7472 | static void __pyx_f_4lxml_5etree__receiveParserError(void *, xmlError *); /*proto*/
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] In file included from /usr/include/libxml2/libxml/valid.h:19,
[error] from /usr/include/libxml2/libxml/parser.h:24,
[error] from /usr/include/libxml2/libxml/tree.h:20,
[error] from src/lxml/includes/etree_defs.h:189,
[error] from src/lxml/etree.c:864:
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_11_BaseParser__registerHtmlErrorHandler’:
[error] src/lxml/etree.c:117709:25: error: assignment to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} from incompatible pointer type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’} [-Wincompatible-pointer-types]
[error] 117709 | __pyx_v_sax->serror = __pyx_f_4lxml_5etree__receiveParserError;
[error] | ^
[error] src/lxml/etree.c:113855:13: note: ‘__pyx_f_4lxml_5etree__receiveParserError’ declared here
[error] 113855 | static void __pyx_f_4lxml_5etree__receiveParserError(void *__pyx_v_c_context, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_4data’:
[error] src/lxml/etree.c:137976:66: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 137976 | __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 834, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__SaxParserTarget *
[error] src/lxml/etree.c:137352:105: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
[error] 137352 | static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_data) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_6start’:
[error] src/lxml/etree.c:138137:67: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 138137 | __pyx_t_3 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__SaxParserTarget *
[error] src/lxml/etree.c:136951:112: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
[error] 136951 | static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_8end’:
[error] src/lxml/etree.c:138208:65: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 138208 | __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 850, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__SaxParserTarget *
[error] src/lxml/etree.c:137251:110: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
[error] 137251 | static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_tag) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_10pi’:
[error] src/lxml/etree.c:138409:64: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 138409 | __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 861, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__SaxParserTarget *
[error] src/lxml/etree.c:137401:109: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
[error] 137401 | static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_data) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_12comment’:
[error] src/lxml/etree.c:138472:69: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 138472 | __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 869, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__SaxParserTarget *
[error] src/lxml/etree.c:137607:114: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
[error] 137607 | static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_comment) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context’:
[error] src/lxml/etree.c:181971:28: error: assignment to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} from incompatible pointer type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’} [-Wincompatible-pointer-types]
[error] 181971 | __pyx_v_xpathCtxt->error = __pyx_f_4lxml_5etree__receiveXPathError;
[error] | ^
[error] src/lxml/etree.c:7546:13: note: ‘__pyx_f_4lxml_5etree__receiveXPathError’ declared here
[error] 7546 | static void __pyx_f_4lxml_5etree__receiveXPathError(void *, xmlError *); /*proto*/
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_4XSLT_18__call__’:
[error] src/lxml/etree.c:203486:73: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 203486 | __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L9_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__BaseContext *
[error] src/lxml/etree.c:201169:138: note: expected ‘struct __pyx_obj_4lxml_5etree__XSLTContext *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__BaseContext *’
[error] 201169 | static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree__copyXSLT’:
[error] src/lxml/etree.c:205311:71: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 205311 | __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 691, __pyx_L1_error)
[error] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | struct __pyx_obj_4lxml_5etree__BaseContext *
[error] src/lxml/etree.c:201169:138: note: expected ‘struct __pyx_obj_4lxml_5etree__XSLTContext *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__BaseContext *’
[error] 201169 | static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
[error] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_7RelaxNG_2__init__’:
[error] src/lxml/etree.c:219245:60: error: passing argument 2 of ‘xmlRelaxNGSetParserStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 219245 | xmlRelaxNGSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] In file included from src/lxml/etree.c:905:
[error] /usr/include/libxml2/libxml/relaxng.h:154:65: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 154 | xmlStructuredErrorFunc serror,
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_7RelaxNG_6__call__’:
[error] src/lxml/etree.c:219663:60: error: passing argument 2 of ‘xmlRelaxNGSetValidStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 219663 | xmlRelaxNGSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] /usr/include/libxml2/libxml/relaxng.h:189:66: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 189 | xmlStructuredErrorFunc serror, void *ctx);
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_9XMLSchema_2__init__’:
[error] src/lxml/etree.c:220552:59: error: passing argument 2 of ‘xmlSchemaSetParserStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 220552 | xmlSchemaSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] In file included from src/lxml/etree.c:906:
[error] /usr/include/libxml2/libxml/xmlschemas.h:151:65: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 151 | xmlStructuredErrorFunc serror,
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_9XMLSchema_6__call__’:
[error] src/lxml/etree.c:221095:59: error: passing argument 2 of ‘xmlSchemaSetValidStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 221095 | xmlSchemaSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] /usr/include/libxml2/libxml/xmlschemas.h:184:65: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 184 | xmlStructuredErrorFunc serror,
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect’:
[error] src/lxml/etree.c:221860:66: error: passing argument 2 of ‘xmlSchemaSetValidStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 221860 | xmlSchemaSetValidStructuredErrors(__pyx_v_self->_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] /usr/include/libxml2/libxml/xmlschemas.h:184:65: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 184 | xmlStructuredErrorFunc serror,
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_10Schematron_6__call__’:
[error] src/lxml/etree.c:223037:63: error: passing argument 2 of ‘xmlSchematronSetValidStructuredErrors’ from incompatible pointer type [-Wincompatible-pointer-types]
[error] 223037 | xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | |
[error] | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
[error] In file included from src/lxml/etree.c:907:
[error] /usr/include/libxml2/libxml/schematron.h:114:66: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
[error] 114 | xmlStructuredErrorFunc serror,
[error] | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[error] src/lxml/etree.c:49484:13: note: ‘__pyx_f_4lxml_5etree__receiveError’ declared here
[error] 49484 | static void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] /usr/include/libxml2/libxml/xmlerror.h:953:16: note: ‘xmlStructuredErrorFunc’ declared here
[error] 953 | typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__pyx_pymod_exec_etree’:
[error] src/lxml/etree.c:6652:38: error: implicit declaration of function ‘_PyDict_SetItem_KnownHash’; did you mean ‘_PyDict_GetItem_KnownHash’? [-Wimplicit-function-declaration]
[error] 6652 | (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c:255376:7: note: in expansion of macro ‘__Pyx_SetNameInClass’
[error] 255376 | if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_9) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
[error] | ^~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyUnicode_Join’:
[error] src/lxml/etree.c:264446:13: error: implicit declaration of function ‘_PyUnicode_FastCopyCharacters’; did you mean ‘PyUnicode_CopyCharacters’? [-Wimplicit-function-declaration]
[error] 264446 | _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | PyUnicode_CopyCharacters
[error] src/lxml/etree.c: In function ‘__Pyx_PyIter_Next2’:
[error] src/lxml/etree.c:265182:35: error: ‘_PyObject_NextNotImplemented’ undeclared (first use in this function); did you mean ‘PyObject_HashNotImplemented’?
[error] 265182 | if (unlikely(iternext == &_PyObject_NextNotImplemented))
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c:1096:43: note: in definition of macro ‘unlikely’
[error] 1096 | #define unlikely(x) __builtin_expect(!!(x), 0)
[error] | ^
[error] src/lxml/etree.c:265182:35: note: each undeclared identifier is reported only once for each function it appears in
[error] 265182 | if (unlikely(iternext == &_PyObject_NextNotImplemented))
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c:1096:43: note: in definition of macro ‘unlikely’
[error] 1096 | #define unlikely(x) __builtin_expect(!!(x), 0)
[error] | ^
[error] src/lxml/etree.c: In function ‘__Pyx_PyGen_Send’:
[error] src/lxml/etree.c:265973:13: error: implicit declaration of function ‘_PyGen_SetStopIterationValue’; did you mean ‘__Pyx_PyGen__FetchStopIterationValue’? [-Wimplicit-function-declaration]
[error] 265973 | _PyGen_SetStopIterationValue(result);
[error] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[error] | __Pyx_PyGen__FetchStopIterationValue
[error] src/lxml/etree.c: In function ‘__Pyx_Coroutine_AwaitableIterError’:
[error] src/lxml/etree.c:267806:5: error: implicit declaration of function ‘_PyErr_FormatFromCause’ [-Wimplicit-function-declaration]
[error] 267806 | _PyErr_FormatFromCause(
[error] | ^~~~~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_set_iter_next’:
[error] src/lxml/etree.c:268071:19: error: implicit declaration of function ‘_PySet_NextEntry’ [-Wimplicit-function-declaration]
[error] 268071 | int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
[error] | ^~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_int’:
[error] src/lxml/etree.c:269066:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 269066 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] In file included from /usr/include/python3.13/longobject.h:107,
[error] from /usr/include/python3.13/Python.h:82,
[error] from src/lxml/etree.c:96:
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_size_t’:
[error] src/lxml/etree.c:269375:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 269375 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_unsigned_int’:
[error] src/lxml/etree.c:269571:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 269571 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_signed__char’:
[error] src/lxml/etree.c:269767:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 269767 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_unsigned_short’:
[error] src/lxml/etree.c:270001:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 270001 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_xmlChar’:
[error] src/lxml/etree.c:270235:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 270235 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] src/lxml/etree.c: In function ‘__Pyx_PyInt_As_long’:
[error] src/lxml/etree.c:270438:27: error: too few arguments to function ‘_PyLong_AsByteArray’; expected 6, have 5
[error] 270438 | int ret = _PyLong_AsByteArray((PyLongObject *)v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] /usr/include/python3.13/cpython/longobject.h:111:17: note: declared here
[error] 111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
[error] | ^~~~~~~~~~~~~~~~~~~
[error] Compile failed: command '/usr/bin/gcc' failed with exit code 1
[error] creating tmp
[error] cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInithkbvx1aj.c -o tmp/xmlXPathInithkbvx1aj.o
[error] /tmp/xmlXPathInithkbvx1aj.c: In function ‘main’:
[error] /tmp/xmlXPathInithkbvx1aj.c:3:5: warning: ‘xmlXPathInit’ is deprecated: See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html [-Wdeprecated-declarations]
[error] 3 | xmlXPathInit();
[error] | ^~~~~~~~~~~~
[error] In file included from /tmp/xmlXPathInithkbvx1aj.c:1:
[error] /usr/include/libxml2/libxml/xpath.h:561:21: note: declared here
[error] 561 | xmlXPathInit (void);
[error] | ^~~~~~~~~~~~
[error] cc tmp/xmlXPathInithkbvx1aj.o -lxml2 -o a.out
[error] error: command '/usr/bin/gcc' failed with exit code 1
[error] [end of output]
[error]
[error] note: This error originates from a subprocess, and is likely not a problem with pip.
[error] ERROR: Failed building wheel for lxml
[error]
[error] [notice] A new release of pip is available: 24.3.1 -> 25.3
[error] [notice] To update, run: python -m pip install --upgrade pip
[error] ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (lxml)
[exit] 1

解决,通过pcman安装
1
sudo pacman -S python-lxml

安装后,最新版本大于我的4.9.7,然后把requirements.txt中lxml的版本修改为>=4.9.7即可

安装过程种报timeout,添加国内源

1
python3 -m pip install "lxml>=4.9.4" -i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 120 --retries 10 --no-cache-dir

安装成功

Free Markets Are Intrinsic to Humans(自由市场是人类本性)

我们通过信用与债务体系实现跨基因合作

自由市场是人类与生俱来的属性

纳瓦尔:整体而言,资本主义(即自由市场)内在于人类物种。资本主义并非我们的发明,甚至不是我们的发现——它存在于我们每一次的交换行为中。

当你我交流信息时,我希望从你那里获得信息反馈。我给你信息,你也给我信息。若信息交换不畅,你自然会转向他人。这种交换意识与信用债务的追踪机制,正是我们作为社会化柔性动物与生俱来的本能。

人类是动物界中唯一能跨基因边界合作的物种。多数动物甚至不存在合作行为,即使存在,也仅限于共同进化、血脉相连的族群内部,因利益共享而协作。

人类则不同。我可以与你们合作——你们中一位是塞尔维亚裔,另一位是波斯裔,而我是印度裔。我们基本没有血缘联系,却依然能协作。

是什么让我们实现合作?正是我们记录债务与信用的能力:谁付出了多少劳动?谁贡献了多少价值?这就是自由市场资本主义的全部内涵。

因此我深信,这是人类物种的内在属性。我们将为所有人创造愈来愈多的财富与丰足。

人人皆可富足,人人皆可“退休”,人人皆可成功。这仅是教育与意愿的问题——你必须心向往之。若无意于此,选择退出这场游戏也无妨。

但请不要贬低那些积极参与游戏的人。正是这场游戏让你夜晚安卧温床,头顶有檐遮风挡雨,超市货架充盈,口袋里的iPhone嗡鸣不息。

对人类而言,这是一场值得以伦理、理性、道德与社会责任感投入的美好游戏。它将继续让我们日益富足,直到为所有渴望者创造巨量财富。

索取者过多而创造者不足,社会必将走向崩溃

尼维:不仅有个体暗中鄙视财富,某些国家、团体或政党也公开蔑视财富,至少表面如此。

纳瓦尔:没错。这些国家、政党与团体最终都陷入了地位的零和游戏。在摧毁财富创造的过程中,他们将所有人拖拽至同一低水平线。

这正是美国因”美国梦”而深受移民欢迎的原因——任何人都可以来到这里,从贫穷起步,通过辛勤工作赚钱致富,或至少获得基本生活保障。

显然,财富的定义因人而异。发达国家公民可能认为”必须赚够数百万美元才算圆满”,而对刚入境的第三世界贫困移民而言(我幼时也是来美的贫困移民),财富的标准可能低得多——或许仅仅是”余生不必从事不愿做的体力劳动”。

但那些蔑视财富创造的团体,终将把整个群体拉低至同一水平。当索取者过多而创造者不足时,社会便会分崩离析,最终沦为委内瑞拉般的共产主义国家——人们忙于索取、分配与再分配,导致民众街头饿殍遍野,每年因饥饿消瘦数公斤。

不妨将此想象为寄生生物过多的有机体:少量寄生或能维持健康,但我们需要大量共生体(如细胞中线粒体助我们呼吸耗氧),这些共生伙伴是维持生命不可或缺的财富创造者。但若体内充满纯粹寄生的蠕虫、病毒或细菌,机体必将死亡。任何有机体只能承受少量寄生,当寄生要素失控,毁灭便接踵而至。

再次强调,我探讨的是符合道德的财富创造——而非垄断、裙带资本主义或环境代价误判等行为。我指的是自由意志与自由市场,是人类间自愿进行、不对他人产生过度影响的小规模交换。

我认为,若社会或群体不尊重这种财富创造模式,终将陷入毁灭与黑暗的深渊

install-BCM4331-driver-on-manjaro

现象

2012款MacBook Pro安装Manjaro xfce后使用无线网卡无法上网

查看网卡型号

1
2
3
4
5
lspci -nnk | grep -iA3 'network'
02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4331 802.11a/b/g/n [14e4:4331] (rev 02)
Subsystem: Apple Inc. AirPort Extreme [106b:00f5]
Kernel driver in use: bcma-pci-bridge
Kernel modules: bcma

安装网卡驱动

1
yay -S noconfirm b43-firmware

重启

1
sudo reboot

Make Abundance for the World(为世界创造富足)

创造财富并非从他人处掠夺资源

符合道德规范的财富创造能为世界带来富足

纳瓦尔:有一种观念,认为赚钱是邪恶的。这种观念根植于”金钱是万恶之源”的说法。人们认为银行家窃取我们的钱财。这在某种程度上是事实——世界上很多地方确实持续存在大量掠夺行为。

从某种意义上看,世界历史就是创造者与索取者之间的掠食关系史。有些人外出创造、建设、为此辛勤付出;

而另一些人则带着刀剑枪支、苛捐杂税、裙带资本主义或共产主义等各类手段进行掠夺。

即使在自然界,寄生生物的数量也远超过非寄生生物。你体内就存在大量以你为生的寄生体,其中较优者是互利共生——它们会给予回报,但多数只是索取。这正是任何复杂系统构建的天然模式。

我所关注的是真正的财富创造。这无关攫取金钱,也非从他人处掠夺资源,而是创造富足。

显然,工作岗位数量并非固定不变,财富总量也非恒定值。若非如此,我们现在仍会围坐在洞穴里,盘算如何分配柴火和偶尔猎获的死鹿。

事实上,人类文明中的绝大多数财富——甚至全部财富——都是被创造出来的。它们源于人类的智慧、技术的革新、生产力的提升以及辛勤的劳动。那种将财富视为掠夺产物的观念,正是那些追求地位者所鼓吹的可怕零和游戏。

人人皆可富足

但现实是每个人都能获得富足。我们观察发达国家现状即可印证:如今每个人的生活水准,几乎都超越了200年前的最高水平。

200年前,没有人拥有抗生素、汽车、电力或iPhone。所有这些发明都使我们这个物种变得更加富足。如今我宁愿成为发达国家的穷人,也不愿做路易十四时代法国的富人;我宁愿成为今日的普通人,也不愿成为昔日的贵族——这正是财富创造带来的转变。

技术的引擎是科学,而科学的应用旨在创造富足。因此我认为从根本上说,每个人都能获得富足。

请思考这个思想实验:假设每个人都具备优秀软硬件工程师的知识储备,能够建造机器人、计算机、桥梁并进行编程。如果全人类都掌握这些技能,你认为20年后社会将呈现出什么面貌?

我的推测是:我们将建造能够完成所有工作的机器人、机器、软件和硬件系统。人类将生活在大规模富足之中。从基本需求层面看,我们实质上都将进入”退休”状态——没有人需要为生存必需品工作。我们将拥有机器人护士、自动化医院、自动驾驶汽车、全自动化农场和清洁能源。

届时,我们将通过技术突破获得所需的一切。若仍有人选择工作,那将是他们表达创造力的方式——工作源于内心的贡献渴望,源于建设与设计的本能驱动。

资本主义并非罪恶

我不认为资本主义是邪恶的。资本主义本质是好的,只是常被劫持:被外部性定价不当,腐败垄断所劫持

在manjaro下使用Chrome科学上网

安装完Manjaro之后迫不及待安装上clash-verge、Chrome,然后发现自带的Firefox可以科学上网,Chrome访问不上
原因是这个版本的Chrome中不支持代理设置,需要手动设置
将Clash Verge的代理端口设置给Chrome就可以了

1
2
3
cd ~/.config
vi chrome-configs.flag # 插入内容
-proxy-server=127.0.0.1:port # 替换成你clash代理的端口,保存 重启chrome就可以了

以上方法亲测可用,还有同学说可以如下设置的,没有尝试
1
/opt/google/chrome/chrome --proxy-server="[http://127.0.0.1:7890](http://127.0.0.1:7890/)"

Seek-Wealth-Not-Money-or-Status(去寻找财富,而非金钱和地位)

Seek Wealth, Not Money or Status

去寻找财富,而非金钱和地位
Wealth is assets that earn while you sleep
财富是资产,资产在你你睡觉时也能一直为你赚钱

财富是资产,资产在你你睡觉时也能一直为你赚钱

Nivi: You probably know Naval from his Twitter account.
Nivi: 你可能通过Naval的Twitter账号认识他。

We’re going to talk about his tweetstorm, “How To Get Rich (without getting lucky).” We’ll go through most of the tweets in detail, give Naval a chance to expand on them and generally riff on the topic. He’ll probably throw in ideas he hasn’t published before.
我们将会讨论他的推文“How To Get Rich (without getting lucky)”如何致富(不靠运气)。我们将通过详细讨论大部分推文,让Naval有机会进一步阐述概括这个主题。他也有可能抛出新的想法。

Naval’s the co-founder of AngelList and Epinions. He’s also a prolific tech investor in companies like Twitter, Uber and many more.
Naval是AngelList和Epinions的联合创始人。他是一名丰富的科技投资人,投资过Twitter、Uber等公司。

I’m the co-founder of AngelList with Naval. And I co-authored the Venture Hacks blog with him back in the day.
和Naval共同创立了AngelList。也曾经一起撰写过Venture Hacks博客。

Naval: The “How to Get Rich” tweetstorm definitely hit a nerve and went viral. A lot of people say it was helpful and reached across aisles.
Naval:“How to Get Rich”(如何致富)这篇推文显然戳中了很多人的痛点,并迅速走红。很多人说它非常有帮助,而且打破了圈层,引发了不同群体的共鸣。

People outside of the tech industry—people in all walks of life—want to know how to solve their money problems. Everyone vaguely knows they want to be wealthy, but they don’t have a good set of principles to do it by.
不只是科技圈的人,几乎各行各业的人都想知道怎么解决财务上的困扰。大家都知道自己想变有钱,但很多人其实并没有一套靠谱的方法或原则去实现它。

Wealth is assets that earn while you sleep

财富是资产,资产在你睡觉时也能一直为你赚钱

Nivi: What’s the difference between wealth, money and status?
Nivi: 财富、金钱、地位有什么不同?

Naval: Wealth is the thing you want. Wealth is assets that earn while you sleep; it’s the factory of robots cranking out things. Wealth is the computer program running at night that’s serving other customers. Wealth is money in the bank that is reinvested into other assets and businesses.
Naval: 财富是你想要的。财富是资产,资产在你睡觉时也能一直为你赚钱;它可以是工厂里的机器人为你生产东西。也可以是晚上也能一直服务客户的电脑程序。财富是银行里的钱,可以再投资到其他资产或生意当中。

A house can be a form of wealth, because you can rent it out; although that’s a less productive use of land than running a commercial enterprise.
房子也可以是一种财富,因为你可以将它出租出去。尽管这与经营企业比,是一种生产力较低的一种利用土地的方式。

My definition of wealth is oriented toward businesses and assets that can earn while you sleep.
我对财富的定义是在你睡觉时能为你赚钱的企业和资产。

Wealth buys your freedom

财富买来的是自由

You want wealth because it buys you freedom—so you don’t have to wear a tie like a collar around your neck; so you don’t have to wake up at 7:00 a.m. to rush to work and sit in commute traffic; so you don’t have to waste your life grinding productive hours away into a soulless job that doesn’t fulfill you.
你想要财富,是因为财富能为你买来自由——让你不必每天戴着像狗链一样的领带,不必早上七点起床赶去上班、堵在通勤的车流中,不必把自己最有生产力的人生时光,浪费在一份毫无灵魂、不带来任何满足感的工作上。

The purpose of wealth is freedom; it’s nothing more than that. It’s not to buy fur coats, or to drive Ferraris, or to sail yachts, or to jet around the world in a Gulf Stream. That stuff gets really boring and stupid, really fast. It’s about being your own sovereign individual.
财富的真正目的就是自由,仅此而已。它不是为了买貂皮大衣、法拉利、游艇,也不是为了坐湾流私人飞机环球旅行。那些东西很快就会变得无聊甚至愚蠢。真正重要的是:成为一个完全自主、独立的人。

You’re not going to get that unless you really want it. The entire world wants it, and the entire world is working hard at it.
但你必须真正渴望这种自由,你才可能得到它。全世界的人都想要这种自由,也都在努力争取。

It is competitive to some extent. It’s a positive sum game—but there are competitive elements to it, because there’s a finite amount of resources right now in society. To get the resources to do what you want, you have to stand out.
在某种程度上,这是一场竞争。虽然它是一个正和游戏,但仍然有竞争的部分,因为当前社会的资源是有限的。如果你想获得资源、去实现你想做的事,你就必须脱颖而出。

Money is how we transfer wealth

金钱是如何交换财富的具现

Money is how we transfer wealth. Money is social credits; it’s the ability to have credits and debits of other people’s time.
金钱是社会信用。它代表你拥有他人时间借贷的能力。

If I do my job right and create value for society, society says, “Oh, thank you. We owe you something in the future for the work that you did. Here’s a little IOU. Let’s call that money.”
如果我做好了我的工作并对社会产生了价值,社会会说,“谢谢你!我们欠你一点什么,以后会补偿你过去做的这些事。给你一张欠条,我们把它叫做‘钱’。”

That money gets debased because people steal the IOUs; the government prints extra IOUs; and people renege on their IOUs. But money tries to be a reliable IOU from society that you are owed something for something you did in the past.
这种钱会被稀释,因为有人偷走了这些欠条;政府印了更多的欠条;也有人赖账不还。但钱本质上是在努力成为一个可靠的社会欠条,是社会对你过去行为的回报。

We transfer these IOUs around; money is how we transfer wealth.
我们在人与人之间交换这些欠条;金钱就是我们如何交换财富的具现。

Status is your rank in the social hierarchy

地位是你在社会体系中的排名

There are fundamentally two huge games in life that people play. One is the money game. Money is not going to solve all of your problems; but it’s going to solve all of your money problems. I think people know that. They realize that, so they want to make money.
从根本上说,人们在生活中玩着两种巨大的游戏。一个是金钱游戏。金钱并不能解决你所有的问题;但它却能解决你所有需要钱的问题。我认为人们知道这一点。他们意识到了这一点,所以他们想赚钱。

At the same time, deep down many people believe they can’t make it; so they don’t want any wealth creation to happen. They virtue signal by attacking the whole enterprise, saying, “Well, making money is evil. You shouldn’t do it.”
与此同时,许多人内心深处认为自己赚不到钱,所以他们不希望财富创造发生。他们通过攻击整个行业来发出道德信号,说:”赚钱是邪恶的。你不应该这么做”。

But they’re actually playing the other game, which is the status game. They’re trying to be high status in the eyes of others by saying, “Well, I don’t need money. We don’t want money.”
但实际上,他们在玩另一种游戏,即地位游戏。他们试图通过说 “我不需要钱” ,“我也不想要赚钱 ”来提高自己在别人心目中的地位。

Status is your ranking in the social hierarchy.
地位是你在社会体系中的排名。

Wealth is not a zero-sum game. Everybody in the world can have a house. Because you have a house doesn’t take away from my ability to have a house. If anything, the more houses that are built, the easier it becomes to build houses, the more we know about building houses, and the more people can have houses.
财富不是零和游戏。世界上每个人都可以有房子。你有房子并不会剥夺我有房子的能力。相反,房子建得越多,建房就越容易,我们对建房的了解就越多,就有越多的人可以拥有房子。

Wealth is a very positive-sum game. We create things together. We’re starting this endeavor to create a piece of art that explains what we’re doing. At the end of it, something brand new will be created. It’s a positive-sum game.
财富是一个正和的游戏。我们共同创造财富。我们正在努力创造一件艺术品,来解释我们正在做的事情。最后,我们会创造出全新的东西。这是一个正和游戏。

Status is a very old game

地位是一个非常古老的游戏

Status, on the other hand, is a zero-sum game. It’s a very old game. We’ve been playing it since monkey tribes. It’s hierarchical. Who’s number one? Who’s number two? Who’s number three? And for number three to move to number two, number two has to move out of that slot. So, status is a zero-sum game.
另一方面,地位是一种零和游戏。这是一种非常古老的游戏。从猴群时代开始,我们就一直在玩。它是等级制的:谁是第一?谁是第二?谁是第三?而要从第三升到第二,第二就必须让出那个位置。所以,地位是一种零和游戏。

Politics is an example of a status game. Even sports is an example of a status game. To be the winner, there must be a loser. Fundamentally, I don’t like status games. They play an important role in our society, so we can figure out who’s in charge. But you play them because they’re a necessary evil.
政治就是一种地位游戏的例子。甚至体育比赛也是一种地位游戏。要有赢家,就必须有输家。我本质上不喜欢这种地位游戏。它们在社会中确实扮演着重要角色——帮助我们弄清谁是领导者。但你之所以参与,是因为它们是一种“必要的恶”。

On an evolutionary basis—if you go back thousands of years—status is a much better predictor of survival than wealth. You couldn’t have wealth before the farming age because you couldn’t store things. Hunter-gatherers carried everything on their backs.
从进化的角度来看——如果你回顾几千年前——地位比财富更能预测一个人的生存能力。在农业出现之前,人们是无法拥有财富的,因为他们无法储存东西。狩猎采集者把一切都背在身上生活。

Hunter-gatherers lived in entirely status-based societies. Farmers started going to wealth-based societies. The modern industrial economies are much more heavily wealth-based societies.
狩猎采集者生活在完全基于地位的社会中。而农耕者开始向基于财富的社会转变。现代工业经济体则更多是基于财富的社会。

People creating wealth will always be attacked by people playing status games

创造财富的人,总会受到玩地位游戏的人的攻击

There’s always a subtle competition going on between status and wealth. For example, when journalists attack rich people or the tech industry, they’re really bidding for status. They’re saying, “No, the people are more important. And I, the journalist, represent the people, and therefore I am more important.”
地位和财富之间,总存在着一种微妙的竞争。比如,当记者抨击富人或科技行业时,其实是在争夺地位。他们是在表达:“人民才是最重要的,而我,作为记者,是人民的代表,所以我更重要。”

The problem is, to win at a status game you have to put somebody else down. That’s why you should avoid status games in your life—because they make you into an angry combative person. You’re always fighting to put other people down and elevate yourself and the people you like.
问题在于:想要在地位游戏中获胜,就必须贬低别人。这也是为什么你应该避免参与地位游戏——因为它会让你变得愤怒、好斗。你会不停地打压他人、抬高自己或你所支持的人。

Status games are always going to exist; there’s no way around it. Realize that most of the time when you’re trying to create wealth, you’re getting attacked by someone else and they’re trying to look like a goody-two shoes. They’re trying to up their own status at your expense.
地位游戏永远都会存在,这是无法避免的。你需要明白,大多数时候,当你试图创造财富时,攻击你的人,其实是在假装正义。他们想让自己看起来像是“正人君子”,但本质上是在踩着你来提高自己的地位。

They’re playing a different game. And it’s a worse game. It’s a zero-sum game, instead of a positive-sum game.
他们玩的是另一种游戏——一种更糟糕的游戏。地位游戏是零和游戏,而财富游戏则是正和游戏。

如何排查解决Communications link failure

  • 项目启动运行几小时后数据库连接异常,重启正常使用
  • 偶发数据库连接异常,重启正常使用
  • 偶发事物数据丢失

怎么办,网上搜索,druid issue搜索,一会儿让改一下这个参数,一会儿改一下那个参数。各种改了重启,观察。然后报错依然复现存在。没想到我们也有资格成为调参工程师。

环境

  • MySQL:8.0.32
  • Druid: 1.1.24
  • Driver:mysql-connector 8.0.27

错误异常

通常错误有以下几种

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Caused by: java.net.SocketException: Connection reset

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet successfully received from the server was 1,254,739 milliseconds ago. The last packet sent successfully to the server was 1,254,740 millisecond ago.s ago.

Caused by: java.sql.SQLException: connection disabled
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1169)

org.springframework.jdbc.UncategorizedSQLException:
### Error querying database. Cause: java.sql.SQLException: connection disabled

Cause: java.sql.SQLException: connection disabled
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; connection disabled; nested exception is java.sql.SQLException: connection disabled

2025-02-11 04:46:31.300 ERROR 1 --- [http-nio-8080-exec-7] [c.a.druid.pool.DruidPooledStatement :368] : CommunicationsException, druid version 1.1.24, jdbcUrl : jdbc:mysql://host:3306/db?useUnicode=true&characterEncoding=UTF8&zroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&useSSL=false&connectTimeout=10000&socketTimeout=120000, testWhileIle true, idle millis 6403958, minIdle 5, poolingCount 2, timeBetweenEvictionRunsMillis 60000, lastValidIdleMillis 6403958, driver com.mysql.cj.jdbc.Driver, exeptionSorter com.alibaba.druid.pool.vendor.MySqlExceptionSorter
2025-02-11 04:46:31.302 ERROR 1 --- [http-nio-8080-exec-7] [com.alibaba.druid.util.JdbcUtils :96] : close connection error

java.sql.SQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.

排查步骤

以上所有的错误都是指向连接异常。需要我们抽丝剥茧。杀人是个罪恶的行径,查出真相是我的责任。

  • 网络问题
    作为程序员首先想到的不是程序有问题出,而是环境有问题。是否有防火墙杀死应用到数据库的连接

  • 数据库超时时间设置问题
    查看数据库设置超时时间是否和druid配置不匹配
    查看数据库设置

    1
    show variables like '%timeout%';

MySQL timeout
其中wait_timeout和interactive_timeout是设置MySQL在连接不操作多少秒后断开连接。
如:客户端连接到MySQL超过8小时没有任何操作,则MySQL将主动断开连接。其中wait_timeout为非交互的连接,我们应用程序连接使用的就是这个。
如果wait_timeout过小和druid配置连接检查间隔时间不合理,则有可能出现d以为该连接没关闭,但是MySQL已经主动关闭连接,导致连接异常的问题。但是这种情况较少,因为我们校验连接通常都是多少秒校验一次。
另外MySQL参数中也有事务时间,应用程序有长事务,导致超过MySQL设置事务时间,会导致事务不成功

另外我们可以通过查询MySQL的连接来等待判断时间

1
select * from information_schema.processlist where db = 'mydb'

MySQL processlist

  • druid配置不合理
    外部原因排查完后,就只剩下排查自己问题了。不对,也可以是druid提示不明显。
    我们通常将连接池托管给三方库,我们只需要按其提供建议配置就好。druid就是其中一种。各版本配置有些许变化,
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    shardingsphere:
    props:
    sql-show: true
    query-with-cipher-column: false
    datasource:
    names: salve,master
    master:
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.jdbc.Driver
    url: jdbc:mysql://${db.host}:${db.port}/${db.database}?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&useSSL=false&connectTimeout=10000&socketTimeout=60000
    username: ${db.username}
    password: ${db.password}
    maxActive: ${db.maxActive:100}
    minIdle: ${db.minIdle:5}
    initialSize: ${db.minIdle:5}
    minEvictableIdleTimeMillis: ${db.minEvictableIdleTimeMillis:180000}
    maxEvictableIdleTimeMillis: ${db.maxEvictableIdleTimeMillis:300000}
    maxWait: ${db.maxWait:10000}
    maxWaitThreadCount: ${db.maxWaitThreadCount:1000}
    testOnBorrow: false
    testOnReturn: false
    testWhileIdle: true
    keepAlive: true
    timeBetweenEvictionRunsMillis: 20000
    validationQueryTimeout: 10
    validationQuery: SELECT 1
    ## TRANSACTION_READ_COMMITTED
    default-transaction-isolation: 2

加入配置druid.mysql.usePingMethod=false
在检查有效连接的时候才不会使用ping而使用validationQuery sql来检查
另外可以查看DruidDataSource配置属性列表

  • 事务未正确关闭
    在排除了非程序问题,非配置问题后,还没有找到原因。就要想是不是druid的源码问题,还是MySQL源码问题。或者可能是自己程序哪里有问题。在看了一阵druid的源码和issue后发现有跟程序未正确结束事务(commit or rollback),会导致这个事务持有数据库连接无法正常归还到连接池,从而导致连接池中可用连接变少。
    我的问题就是这个,修改后,解决了这个连接异常问题
    issue

MySQL MGR是什么?

术语

  • MGR:MySQL Group Replication,即MySQL组复制
  • RPO:Recovery Point Objective恢复点目标
  • RTO:Recovery Time Objective恢复时间目标

背景

公司核心应用A为公司核心应用,对数据库RPO、RTO都有较高要求。一次数据库主库磁盘expender背板坏了,影响磁盘IO通道,数据库层面出现大面积超时和错误。由于机器未完全坏掉,数据库可以连接,SQL可以执行,导致主从未能自动切换,手动切换时准备脚本,校验数据同步等问题耗时过长,导致公司业务出现重大损失。(原有方案为MHA高可用,半同步复制)
由此改为MGR集群技术方案,以期降低主从切换时效,降低损失。

MGR

MGR高可用方案中的RPO、RTO
RPO:架构模型保障了数据一致性,无需人为干预和检测
RTO:因其本身RPO的自动保障,无数据差异,准备耗时短,

MGR具备以下几个特点:

基于shared-nothing模式,所有节点都有一份完整数据,发生故障时可以直接切换。
MGR提供了数据一致性保障,默认是最终一致性,可根据业务特征需要自行调整一致性级别。
支持在线添加、删除节点,节点管理更方便。
支持故障自动检测及自动切换,发生故障时能自动切换到新的主节点,再配合MySQL Router中间件,应用层无需干预或调整。
支持单节点、多节点写入两种模式,可根据架构或业务需要选择哪种方案,不过强烈建议选用单主模式。

参考

https://dev.mysql.com/doc/refman/8.4/en/group-replication.html

https://greatsql.cn/blog-10-9.html

如何预估MySQL表空间占用大小

我们经常需要知道表空间大小,在修改表结构的时候需要知道表空间大小以预估影响时间;在设计表的时候需要预估表的数据量,预估磁盘空间等。

查看已存在的表空间大小

MySQL中information_schema有记录

1
2
3
SELECT concat(round(sum((data_length+index_length)/1024/1024),2),'MB' as data
FROM information_schema.tables
WHERE table_schema='mydb' and table_name='mytable';

新建表空间大小测算

从上面可以看到表空间大小由数据大小+索引大小两部分组成
下面通过一个例子来实际测算一下
DDL

1
2
3
4
5
6
7
8
9
10
mysql> desc City;
+-------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| Name | char(35) | NO | | | |
| CountryCode | char(3) | NO | MUL | | |
| District | char(20) | NO | | | |
| Population | int(11) | NO | | 0 | |
+-------------+----------+------+-----+---------+----------------+

  • 数据大小测算
    根据表结构中字段大小来测算
    66 bytes per row of data(4+35+3+20+4)

  • 索引大小测算
    4 bytes per row for the primary key
    7 bytes per row for country code index

    • 3 bytes for the country
    • 4 bytes for Clustered Key attached to the country code

这不考虑BTREE或表空间碎片的内务管理
对于一百万行,这将是77000000字节(73.43 MB)

参考
How to estimate/predict data size and index size of a table in MySQL

更详细的还需要看InnoDB : Tablespace Space Management