Update On Tue May 28 20:30:13 CEST 2024

This commit is contained in:
github-action[bot]
2024-05-28 20:30:14 +02:00
parent 929efb55e1
commit 55db66563f
35 changed files with 2944 additions and 1102 deletions

1
.github/update.log vendored
View File

@@ -660,3 +660,4 @@ Update On Fri May 24 20:29:24 CEST 2024
Update On Sat May 25 20:28:13 CEST 2024
Update On Sun May 26 20:29:29 CEST 2024
Update On Mon May 27 20:31:35 CEST 2024
Update On Tue May 28 20:30:03 CEST 2024

View File

@@ -6,5 +6,5 @@ func init() {
version := windows.RtlGetVersion()
WindowsMajorVersion = version.MajorVersion
WindowsMinorVersion = version.MinorVersion
WindowsBuildNumber = version.MinorVersion
WindowsBuildNumber = version.BuildNumber
}

View File

@@ -53,12 +53,11 @@
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/react-transition-group": "4.4.10",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"@vitejs/plugin-react": "4.3.0",
"babel-plugin-react-compiler": "0.0.0-experimental-592953e-20240517",
"sass": "1.77.2",
"shiki": "1.6.0",
"shiki": "1.6.1",
"vite": "5.2.11",
"vite-plugin-monaco-editor": "1.1.3",
"vite-plugin-sass-dts": "1.3.22",

View File

@@ -48,17 +48,7 @@ export default defineConfig(({ command }) => {
react({
// jsxImportSource: "@emotion/react",
babel: {
plugins: [
"@emotion/babel-plugin",
[
"babel-plugin-react-compiler",
{
sources: (filename) => {
return filename.indexOf("src") !== -1;
},
},
],
],
plugins: ["@emotion/babel-plugin"],
},
}),
generouted(),

View File

@@ -87,8 +87,8 @@
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.6.2",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-promise": "6.2.0",
"eslint-plugin-react": "7.34.2",
"lint-staged": "15.2.5",
"npm-run-all2": "6.2.0",
"postcss": "8.4.38",

View File

@@ -60,7 +60,7 @@ importers:
version: 9.1.0(eslint@8.57.0)
eslint-config-standard:
specifier: 17.1.0
version: 17.1.0(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0)
version: 17.1.0(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0)
eslint-import-resolver-alias:
specifier: 1.1.2
version: 1.1.2(eslint-plugin-import@2.29.1(eslint@8.57.0))
@@ -77,11 +77,11 @@ importers:
specifier: 5.1.3
version: 5.1.3(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5)
eslint-plugin-promise:
specifier: 6.1.1
version: 6.1.1(eslint@8.57.0)
specifier: 6.2.0
version: 6.2.0(eslint@8.57.0)
eslint-plugin-react:
specifier: 7.34.1
version: 7.34.1(eslint@8.57.0)
specifier: 7.34.2
version: 7.34.2(eslint@8.57.0)
lint-staged:
specifier: 15.2.5
version: 15.2.5
@@ -289,23 +289,20 @@ importers:
specifier: 4.4.10
version: 4.4.10
'@typescript-eslint/eslint-plugin':
specifier: 7.10.0
version: 7.10.0(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)
specifier: 7.11.0
version: 7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/parser':
specifier: 7.10.0
version: 7.10.0(eslint@8.57.0)(typescript@5.4.5)
specifier: 7.11.0
version: 7.11.0(eslint@8.57.0)(typescript@5.4.5)
'@vitejs/plugin-react':
specifier: 4.3.0
version: 4.3.0(vite@5.2.11(@types/node@20.12.12)(less@4.2.0)(sass@1.77.2)(stylus@0.62.0))
babel-plugin-react-compiler:
specifier: 0.0.0-experimental-592953e-20240517
version: 0.0.0-experimental-592953e-20240517
sass:
specifier: 1.77.2
version: 1.77.2
shiki:
specifier: 1.6.0
version: 1.6.0
specifier: 1.6.1
version: 1.6.1
vite:
specifier: 5.2.11
version: 5.2.11(@types/node@20.12.12)(less@4.2.0)(sass@1.77.2)(stylus@0.62.0)
@@ -433,9 +430,6 @@ packages:
resolution: {integrity: sha512-tVQRucExLQ02Boi4vdPp49svNGcfL2GhdTCT9aldhXgCJVAI21EtRfBettiuLUwce/7r6bFdgs6JFkcdTiFttA==}
engines: {node: '>=6.9.0'}
'@babel/generator@7.2.0':
resolution: {integrity: sha512-BA75MVfRlFQG2EZgFYIwyT1r6xSkwfP2bdkY/kLZusEYWiJs4xCowab/alaEaT0wSvmVuXGqiefeBlP+7V1yKg==}
'@babel/generator@7.24.5':
resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==}
engines: {node: '>=6.9.0'}
@@ -1048,10 +1042,6 @@ packages:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
'@jest/types@24.9.0':
resolution: {integrity: sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==}
engines: {node: '>= 6'}
'@jridgewell/gen-mapping@0.3.5':
resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==}
engines: {node: '>=6.0.0'}
@@ -1365,8 +1355,8 @@ packages:
cpu: [x64]
os: [win32]
'@shikijs/core@1.6.0':
resolution: {integrity: sha512-NIEAi5U5R7BLkbW1pG/ZKu3eb1lzc3/+jD0lFsuxMT7zjaf9bbNwdNyMr7zh/Zl8EXQtQ+MYBAt5G+JLu+5DlA==}
'@shikijs/core@1.6.1':
resolution: {integrity: sha512-CqYyepN4SnBopaoXYwng4NO8riB5ask/LTCkhOFq+GNGtr2X+aKeD767eYdqYukeixEUvv4bXdyTYVaogj7KBw==}
'@sindresorhus/is@4.6.0':
resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
@@ -1561,15 +1551,6 @@ packages:
'@types/http-cache-semantics@4.0.4':
resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==}
'@types/istanbul-lib-coverage@2.0.6':
resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==}
'@types/istanbul-lib-report@3.0.3':
resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==}
'@types/istanbul-reports@1.1.2':
resolution: {integrity: sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==}
'@types/js-cookie@3.0.6':
resolution: {integrity: sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==}
@@ -1627,17 +1608,11 @@ packages:
'@types/unist@3.0.2':
resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==}
'@types/yargs-parser@21.0.3':
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
'@types/yargs@13.0.12':
resolution: {integrity: sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==}
'@types/yauzl@2.10.3':
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
'@typescript-eslint/eslint-plugin@7.10.0':
resolution: {integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==}
'@typescript-eslint/eslint-plugin@7.11.0':
resolution: {integrity: sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
'@typescript-eslint/parser': ^7.0.0
@@ -1647,8 +1622,8 @@ packages:
typescript:
optional: true
'@typescript-eslint/parser@7.10.0':
resolution: {integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==}
'@typescript-eslint/parser@7.11.0':
resolution: {integrity: sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
@@ -1657,12 +1632,12 @@ packages:
typescript:
optional: true
'@typescript-eslint/scope-manager@7.10.0':
resolution: {integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==}
'@typescript-eslint/scope-manager@7.11.0':
resolution: {integrity: sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/type-utils@7.10.0':
resolution: {integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==}
'@typescript-eslint/type-utils@7.11.0':
resolution: {integrity: sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
@@ -1671,12 +1646,12 @@ packages:
typescript:
optional: true
'@typescript-eslint/types@7.10.0':
resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==}
'@typescript-eslint/types@7.11.0':
resolution: {integrity: sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/typescript-estree@7.10.0':
resolution: {integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==}
'@typescript-eslint/typescript-estree@7.11.0':
resolution: {integrity: sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
typescript: '*'
@@ -1684,14 +1659,14 @@ packages:
typescript:
optional: true
'@typescript-eslint/utils@7.10.0':
resolution: {integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==}
'@typescript-eslint/utils@7.11.0':
resolution: {integrity: sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
eslint: ^8.56.0
'@typescript-eslint/visitor-keys@7.10.0':
resolution: {integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==}
'@typescript-eslint/visitor-keys@7.11.0':
resolution: {integrity: sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==}
engines: {node: ^18.18.0 || >=20.0.0}
'@ungap/structured-clone@1.2.0':
@@ -1754,10 +1729,6 @@ packages:
resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==}
engines: {node: '>=4'}
ansi-regex@4.1.1:
resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==}
engines: {node: '>=6'}
ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
@@ -1860,9 +1831,6 @@ packages:
resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
engines: {node: '>=10', npm: '>=6'}
babel-plugin-react-compiler@0.0.0-experimental-592953e-20240517:
resolution: {integrity: sha512-OjG1SVaeQZaJrqkMFJatg8W/MTow8Ak5rx2SI0ETQBO1XvOk/XZGMbltNCPdFJLKghBYoBjC+Y3Ap/Xr7B01mA==}
bail@2.0.2:
resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}
@@ -2537,14 +2505,14 @@ packages:
eslint-config-prettier:
optional: true
eslint-plugin-promise@6.1.1:
resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==}
eslint-plugin-promise@6.2.0:
resolution: {integrity: sha512-QmAqwizauvnKOlifxyDj2ObfULpHQawlg/zQdgEixur9vl0CvZGv/LCJV2rtj3210QCoeGBzVMfMXqGAOr/4fA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
eslint-plugin-react@7.34.1:
resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==}
eslint-plugin-react@7.34.2:
resolution: {integrity: sha512-2HCmrU+/JNigDN6tg55cRDKCQWicYAPB38JGSFDQt95jDm8rrvSUo7YPkOIm5l6ts1j1zCvysNcasvfTMQzUOw==}
engines: {node: '>=4'}
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
@@ -3026,9 +2994,6 @@ packages:
intersection-observer@0.12.2:
resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==}
invariant@2.2.4:
resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
ip-address@9.0.5:
resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
engines: {node: '>= 12'}
@@ -4061,10 +4026,6 @@ packages:
engines: {node: '>=14'}
hasBin: true
pretty-format@24.9.0:
resolution: {integrity: sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==}
engines: {node: '>= 6'}
progress@2.0.3:
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
engines: {node: '>=0.4.0'}
@@ -4396,8 +4357,8 @@ packages:
shell-quote@1.8.1:
resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
shiki@1.6.0:
resolution: {integrity: sha512-P31ROeXcVgW/k3Z+vUUErcxoTah7ZRaimctOpzGuqAntqnnSmx1HOsvnbAB8Z2qfXPRhw61yptAzCsuKOhTHwQ==}
shiki@1.6.1:
resolution: {integrity: sha512-1Pu/A1rtsG6HZvQm4W0NExQ45e02og+rPog7PDaFDiMumZgOYnZIu4JtGQeAIfMwdbKSjJQoCUr79vDLKUUxWA==}
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
@@ -4683,10 +4644,6 @@ packages:
trim-lines@3.0.1:
resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
trim-right@1.0.1:
resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==}
engines: {node: '>=0.10.0'}
trough@2.2.0:
resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}
@@ -5082,15 +5039,6 @@ packages:
resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
engines: {node: '>=12.20'}
zod-validation-error@2.1.0:
resolution: {integrity: sha512-VJh93e2wb4c3tWtGgTa0OF/dTt/zoPCPzXq4V11ZjxmEAFaPi/Zss1xIZdEB5RD8GD00U0/iVXgqkF77RV7pdQ==}
engines: {node: '>=18.0.0'}
peerDependencies:
zod: ^3.18.0
zod@3.23.8:
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
@@ -5144,14 +5092,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@babel/generator@7.2.0':
dependencies:
'@babel/types': 7.24.5
jsesc: 2.5.2
lodash: 4.17.21
source-map: 0.5.7
trim-right: 1.0.1
'@babel/generator@7.24.5':
dependencies:
'@babel/types': 7.24.5
@@ -5724,12 +5664,6 @@ snapshots:
wrap-ansi: 8.1.0
wrap-ansi-cjs: wrap-ansi@7.0.0
'@jest/types@24.9.0':
dependencies:
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 1.1.2
'@types/yargs': 13.0.12
'@jridgewell/gen-mapping@0.3.5':
dependencies:
'@jridgewell/set-array': 1.2.1
@@ -6014,7 +5948,7 @@ snapshots:
'@rollup/rollup-win32-x64-msvc@4.17.2':
optional: true
'@shikijs/core@1.6.0': {}
'@shikijs/core@1.6.1': {}
'@sindresorhus/is@4.6.0': {}
@@ -6202,17 +6136,6 @@ snapshots:
'@types/http-cache-semantics@4.0.4': {}
'@types/istanbul-lib-coverage@2.0.6': {}
'@types/istanbul-lib-report@3.0.3':
dependencies:
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports@1.1.2':
dependencies:
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-lib-report': 3.0.3
'@types/js-cookie@3.0.6': {}
'@types/json5@0.0.29': {}
@@ -6271,25 +6194,19 @@ snapshots:
'@types/unist@3.0.2': {}
'@types/yargs-parser@21.0.3': {}
'@types/yargs@13.0.12':
dependencies:
'@types/yargs-parser': 21.0.3
'@types/yauzl@2.10.3':
dependencies:
'@types/node': 20.12.12
optional: true
'@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)':
'@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)':
dependencies:
'@eslint-community/regexpp': 4.10.0
'@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/scope-manager': 7.10.0
'@typescript-eslint/type-utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.10.0
'@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/scope-manager': 7.11.0
'@typescript-eslint/type-utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.11.0
eslint: 8.57.0
graphemer: 1.4.0
ignore: 5.3.1
@@ -6300,12 +6217,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5)':
'@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
dependencies:
'@typescript-eslint/scope-manager': 7.10.0
'@typescript-eslint/types': 7.10.0
'@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.10.0
'@typescript-eslint/scope-manager': 7.11.0
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.11.0
debug: 4.3.4
eslint: 8.57.0
optionalDependencies:
@@ -6313,15 +6230,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/scope-manager@7.10.0':
'@typescript-eslint/scope-manager@7.11.0':
dependencies:
'@typescript-eslint/types': 7.10.0
'@typescript-eslint/visitor-keys': 7.10.0
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/visitor-keys': 7.11.0
'@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.4.5)':
'@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
dependencies:
'@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5)
'@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5)
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
'@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
debug: 4.3.4
eslint: 8.57.0
ts-api-utils: 1.3.0(typescript@5.4.5)
@@ -6330,12 +6247,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/types@7.10.0': {}
'@typescript-eslint/types@7.11.0': {}
'@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5)':
'@typescript-eslint/typescript-estree@7.11.0(typescript@5.4.5)':
dependencies:
'@typescript-eslint/types': 7.10.0
'@typescript-eslint/visitor-keys': 7.10.0
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/visitor-keys': 7.11.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
@@ -6347,20 +6264,20 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.4.5)':
'@typescript-eslint/utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
'@typescript-eslint/scope-manager': 7.10.0
'@typescript-eslint/types': 7.10.0
'@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5)
'@typescript-eslint/scope-manager': 7.11.0
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
eslint: 8.57.0
transitivePeerDependencies:
- supports-color
- typescript
'@typescript-eslint/visitor-keys@7.10.0':
'@typescript-eslint/visitor-keys@7.11.0':
dependencies:
'@typescript-eslint/types': 7.10.0
'@typescript-eslint/types': 7.11.0
eslint-visitor-keys: 3.4.3
'@ungap/structured-clone@1.2.0': {}
@@ -6441,8 +6358,6 @@ snapshots:
ansi-regex@3.0.1: {}
ansi-regex@4.1.1: {}
ansi-regex@5.0.1: {}
ansi-regex@6.0.1: {}
@@ -6580,16 +6495,6 @@ snapshots:
cosmiconfig: 7.1.0
resolve: 1.22.8
babel-plugin-react-compiler@0.0.0-experimental-592953e-20240517:
dependencies:
'@babel/generator': 7.2.0
'@babel/types': 7.24.5
chalk: 4.1.2
invariant: 2.2.4
pretty-format: 24.9.0
zod: 3.23.8
zod-validation-error: 2.1.0(zod@3.23.8)
bail@2.0.2: {}
balanced-match@1.0.2: {}
@@ -7268,12 +7173,12 @@ snapshots:
dependencies:
eslint: 8.57.0
eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.1.1(eslint@8.57.0))(eslint@8.57.0):
eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint-plugin-n@16.6.2(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0):
dependencies:
eslint: 8.57.0
eslint-plugin-import: 2.29.1(eslint@8.57.0)
eslint-plugin-n: 16.6.2(eslint@8.57.0)
eslint-plugin-promise: 6.1.1(eslint@8.57.0)
eslint-plugin-promise: 6.2.0(eslint@8.57.0)
eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.29.1(eslint@8.57.0)):
dependencies:
@@ -7356,11 +7261,11 @@ snapshots:
optionalDependencies:
eslint-config-prettier: 9.1.0(eslint@8.57.0)
eslint-plugin-promise@6.1.1(eslint@8.57.0):
eslint-plugin-promise@6.2.0(eslint@8.57.0):
dependencies:
eslint: 8.57.0
eslint-plugin-react@7.34.1(eslint@8.57.0):
eslint-plugin-react@7.34.2(eslint@8.57.0):
dependencies:
array-includes: 3.1.8
array.prototype.findlast: 1.2.5
@@ -7952,10 +7857,6 @@ snapshots:
intersection-observer@0.12.2: {}
invariant@2.2.4:
dependencies:
loose-envify: 1.4.0
ip-address@9.0.5:
dependencies:
jsbn: 1.1.0
@@ -9007,13 +8908,6 @@ snapshots:
prettier@3.2.5: {}
pretty-format@24.9.0:
dependencies:
'@jest/types': 24.9.0
ansi-regex: 4.1.1
ansi-styles: 3.2.1
react-is: 16.13.1
progress@2.0.3: {}
prop-types@15.8.1:
@@ -9380,9 +9274,9 @@ snapshots:
shell-quote@1.8.1: {}
shiki@1.6.0:
shiki@1.6.1:
dependencies:
'@shikijs/core': 1.6.0
'@shikijs/core': 1.6.1
side-channel@1.0.6:
dependencies:
@@ -9760,8 +9654,6 @@ snapshots:
trim-lines@3.0.1: {}
trim-right@1.0.1: {}
trough@2.2.0: {}
ts-api-utils@1.3.0(typescript@5.4.5):
@@ -10197,10 +10089,4 @@ snapshots:
yocto-queue@1.0.0: {}
zod-validation-error@2.1.0(zod@3.23.8):
dependencies:
zod: 3.23.8
zod@3.23.8: {}
zwitch@2.0.4: {}

7
clash-verge-rev/.babelrc Normal file
View File

@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
]
}

View File

@@ -38,7 +38,6 @@
"meta-json-schema": "1.18.5-alpha",
"monaco-editor": "^0.47.0",
"monaco-yaml": "^5.1.1",
"types-pac": "^1.0.2",
"nanoid": "^5.0.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -51,10 +50,15 @@
"react-virtuoso": "^4.7.10",
"recoil": "^0.7.7",
"swr": "^1.3.0",
"tar": "^6.2.1"
"tar": "^6.2.1",
"types-pac": "^1.0.2"
},
"devDependencies": {
"@actions/github": "^5.1.1",
"@babel/preset-env": "^7.24.6",
"@babel/preset-react": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@rollup/plugin-babel": "^6.0.4",
"@tauri-apps/cli": "^1.5.13",
"@types/fs-extra": "^9.0.13",
"@types/js-cookie": "^3.0.6",
@@ -62,7 +66,7 @@
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/react-transition-group": "^4.4.10",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react": "^4.3.0",
"adm-zip": "^0.5.12",
"cross-env": "^7.0.3",
"fs-extra": "^11.2.0",

File diff suppressed because it is too large Load Diff

View File

@@ -2,15 +2,26 @@ import { defineConfig } from "vite";
import path from "path";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import { babel } from "@rollup/plugin-babel";
import monacoEditor from "vite-plugin-monaco-editor";
// https://vitejs.dev/config/
export default defineConfig({
root: "src",
server: { port: 3000 },
plugins: [
svgr(),
react(),
{
apply: "build", // apply only for build, not for serve
...babel({
babelHelpers: "bundled",
extensions: [".js", ".jsx", ".ts", ".tsx"],
targets: {
edge: "109", // last version to support Windows 7
safari: "13", // macOS 10.15 Catalina
},
}),
},
monacoEditor({
languageWorkers: ["editorWorkerService", "typescript", "css"],
customWorkers: [

View File

@@ -0,0 +1,153 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "openfi,5pro", "mediatek,mt7621-soc";
model = "OpenFi 5Pro";
aliases {
led-boot = &led_system_blue;
led-failsafe = &led_system_blue;
led-running = &led_system_blue;
led-upgrade = &led_system_blue;
};
chosen {
bootargs = "console=ttyS0,115200";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
leds {
compatible = "gpio-leds";
led_system_blue: led-0 {
label = "blue:system";
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
led_internet_blue: led-1 {
label = "blue:internet";
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
led_wifi_blue: led-2 {
label = "blue:wifi";
color = <LED_COLOR_ID_BLUE>;
linux,default-trigger = "phy0tpt";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <45000000>;
broken-flash-reset;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "bootloader";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "config";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x3f00000>;
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
mt76@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
ieee80211-freq-limit = <2400000 2500000>;
};
};
&pcie1 {
wifi1: mt76@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan";
};
};
};
&state_default {
gpio {
groups = "wdt", "i2c", "jtag";
function = "gpio";
};
};

View File

@@ -1401,6 +1401,15 @@ define Device/netis_wf2881
endef
TARGET_DEVICES += netis_wf2881
define Device/openfi_5pro
$(Device/dsa-migration)
IMAGE_SIZE := 63448k
DEVICE_VENDOR := OpenFi
DEVICE_MODEL := 5Pro
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb3
endef
TARGET_DEVICES += openfi_5pro
define Device/oraybox_x3a
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)

View File

@@ -30,6 +30,7 @@ ramips_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
asiarf,ap7621-001|\
openfi,5pro|\
winstars,ws-wn583a6)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;

View File

@@ -6,5 +6,5 @@ func init() {
version := windows.RtlGetVersion()
WindowsMajorVersion = version.MajorVersion
WindowsMinorVersion = version.MinorVersion
WindowsBuildNumber = version.MinorVersion
WindowsBuildNumber = version.BuildNumber
}

View File

@@ -6,7 +6,7 @@ icon: material/alert-decagram
* Add tailing comma support in JSON configuration
* Add simple auto redirect for Android **1**
* Add bittorrent sniffer **2**
* Add BitTorrent sniffer **2**
**1**:
@@ -20,8 +20,6 @@ See [Redirect](/configuration/inbound/redirect/).
**2**:
It doesn't exactly work right now. Do not use it for anything other than blocking bittorrent traffics.
See [Protocol Sniff](/configuration/route/sniff/).
### 1.9.0

View File

@@ -2,7 +2,7 @@
icon: material/new-box
---
!!! quote "Changes in sing-box 1.9.0"
!!! quote "Changes in sing-box 1.10.0"
:material-plus: [auto_redirect](#auto_redirect)

View File

@@ -9,6 +9,7 @@ import (
"github.com/sagernet/sing-box"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/process"
"github.com/sagernet/sing-box/experimental/libbox/platform"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common/control"
@@ -97,6 +98,14 @@ func (s *platformInterfaceStub) FindProcessInfo(ctx context.Context, network str
return nil, os.ErrInvalid
}
func (s *platformInterfaceStub) PerAppProxyList() ([]uint32, error) {
return nil, os.ErrInvalid
}
func (s *platformInterfaceStub) PerAppProxyMode() int32 {
return platform.PerAppProxyModeDisabled
}
type interfaceMonitorStub struct{}
func (s *interfaceMonitorStub) Start() error {

View File

@@ -22,6 +22,8 @@ type PlatformInterface interface {
IncludeAllNetworks() bool
ReadWIFIState() *WIFIState
ClearDNSCache()
PerAppProxyList() (IntegerIterator, error)
PerAppProxyMode() int32
}
type TunInterface interface {
@@ -54,6 +56,11 @@ type NetworkInterfaceIterator interface {
HasNext() bool
}
type IntegerIterator interface {
Next() int32
HasNext() bool
}
type OnDemandRule interface {
Target() int32
DNSSearchDomainMatch() StringIterator

View File

@@ -11,6 +11,12 @@ import (
"github.com/sagernet/sing/common/logger"
)
const (
PerAppProxyModeDisabled int32 = iota
PerAppProxyModeExclude
PerAppProxyModeInclude
)
type Interface interface {
Initialize(ctx context.Context, router adapter.Router) error
UsePlatformAutoDetectInterfaceControl() bool
@@ -24,5 +30,7 @@ type Interface interface {
IncludeAllNetworks() bool
ClearDNSCache()
ReadWIFIState() adapter.WIFIState
PerAppProxyList() ([]uint32, error)
PerAppProxyMode() int32
process.Searcher
}

View File

@@ -229,6 +229,18 @@ func (w *platformInterfaceWrapper) ReadWIFIState() adapter.WIFIState {
return (adapter.WIFIState)(*wifiState)
}
func (w *platformInterfaceWrapper) PerAppProxyList() ([]uint32, error) {
uidIterator, err := w.iif.PerAppProxyList()
if err != nil {
return nil, err
}
return common.Map(iteratorToArray[int32](uidIterator), func(it int32) uint32 { return uint32(it) }), nil
}
func (w *platformInterfaceWrapper) PerAppProxyMode() int32 {
return w.iif.PerAppProxyMode()
}
func (w *platformInterfaceWrapper) DisableColors() bool {
return runtime.GOOS != "android"
}

View File

@@ -19,7 +19,7 @@ func New(ctx context.Context, router adapter.Router, logger log.ContextLogger, o
case C.TypeTun:
return NewTun(ctx, router, logger, options.Tag, options.TunOptions, platformInterface)
case C.TypeRedirect:
return NewRedirect(ctx, router, logger, options.Tag, options.RedirectOptions)
return NewRedirect(ctx, router, logger, options.Tag, options.RedirectOptions, platformInterface)
case C.TypeTProxy:
return NewTProxy(ctx, router, logger, options.Tag, options.TProxyOptions), nil
case C.TypeDirect:

View File

@@ -7,11 +7,13 @@ import (
"net/netip"
"os"
"os/exec"
"sort"
"strings"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/redir"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/experimental/libbox/platform"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common"
@@ -24,12 +26,13 @@ import (
type Redirect struct {
myInboundAdapter
platformInterface platform.Interface
autoRedirect option.AutoRedirectOptions
needSu bool
suPath string
}
func NewRedirect(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.RedirectInboundOptions) (*Redirect, error) {
func NewRedirect(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.RedirectInboundOptions, platformInterface platform.Interface) (*Redirect, error) {
redirect := &Redirect{
myInboundAdapter: myInboundAdapter{
protocol: C.TypeRedirect,
@@ -40,6 +43,7 @@ func NewRedirect(ctx context.Context, router adapter.Router, logger log.ContextL
tag: tag,
listenOptions: options.ListenOptions,
},
platformInterface: platformInterface,
autoRedirect: common.PtrValueOrDefault(options.AutoRedirect),
}
if redirect.autoRedirect.Enabled {
@@ -101,21 +105,73 @@ func (r *Redirect) Close() error {
}
func (r *Redirect) setupRedirect() error {
myUid := os.Getuid()
tcpPort := M.AddrPortFromNet(r.tcpListener.Addr()).Port()
interfaceRules := common.FlatMap(r.router.(adapter.Router).InterfaceFinder().Interfaces(), func(it control.Interface) []string {
return common.Map(common.Filter(it.Addresses, func(it netip.Prefix) bool { return it.Addr().Is4() }), func(it netip.Prefix) string {
return "iptables -t nat -A sing-box -p tcp -j RETURN -d " + it.String()
})
})
return r.runAndroidShell(`
tableName := "sing-box"
rules := `
set -e -o pipefail
iptables -t nat -N sing-box
` + strings.Join(interfaceRules, "\n") + `
iptables -t nat -A sing-box -j RETURN -m owner --uid-owner ` + F.ToString(myUid) + `
iptables -t nat -A sing-box -p tcp -j REDIRECT --to-ports ` + F.ToString(tcpPort) + `
iptables -t nat -A OUTPUT -p tcp -j sing-box
`)
`
rules += strings.Join(common.FlatMap(r.router.(adapter.Router).InterfaceFinder().Interfaces(), func(it control.Interface) []string {
return common.Map(common.Filter(it.Addresses, func(it netip.Prefix) bool { return it.Addr().Is4() }), func(it netip.Prefix) string {
return "iptables -t nat -A " + tableName + " -p tcp -j RETURN -d " + it.String()
})
}), "\n")
var (
myUid = uint32(os.Getuid())
perAppProxyList []uint32
perAppProxyMap = make(map[uint32]bool)
perAppProxyMode int32
err error
)
if r.platformInterface != nil {
perAppProxyMode = r.platformInterface.PerAppProxyMode()
if perAppProxyMode != platform.PerAppProxyModeDisabled {
perAppProxyList, err = r.platformInterface.PerAppProxyList()
if err != nil {
return E.Cause(err, "read per app proxy configuration")
}
}
for _, proxyUID := range perAppProxyList {
perAppProxyMap[proxyUID] = true
}
}
excludeUser := func(userID uint32) {
if perAppProxyMode != platform.PerAppProxyModeInclude {
perAppProxyMap[userID] = false
} else {
delete(perAppProxyMap, userID)
}
}
excludeUser(myUid)
if myUid != 0 && myUid != 2000 {
excludeUser(0)
}
perAppProxyList = perAppProxyList[:0]
for uid := range perAppProxyMap {
perAppProxyList = append(perAppProxyList, uid)
}
sort.SliceStable(perAppProxyList, func(i, j int) bool {
return perAppProxyList[i] < perAppProxyList[j]
})
redirectPortStr := F.ToString(M.AddrPortFromNet(r.tcpListener.Addr()).Port())
if perAppProxyMode != platform.PerAppProxyModeInclude {
rules += "\n" + strings.Join(common.Map(perAppProxyList, func(it uint32) string {
return "iptables -t nat -A " + tableName + " -j RETURN -m owner --uid-owner " + F.ToString(it)
}), "\n")
rules += "\niptables -t nat -A " + tableName + " -p tcp -j REDIRECT --to-ports " + redirectPortStr
} else {
rules += "\n" + strings.Join(common.Map(perAppProxyList, func(it uint32) string {
return "iptables -t nat -A " + tableName + " -p tcp -j REDIRECT --to-ports " + redirectPortStr + " -m owner --uid-owner " + F.ToString(it)
}), "\n")
}
rules += "\niptables -t nat -A OUTPUT -p tcp -j " + tableName
for _, ruleLine := range strings.Split(rules, "\n") {
ruleLine = strings.TrimSpace(ruleLine)
if ruleLine == "" {
continue
}
r.logger.Debug("# ", ruleLine)
}
return r.runAndroidShell(rules)
}
func (r *Redirect) cleanupRedirect() {

View File

@@ -1,3 +1,7 @@
<!--
SPDX-FileCopyrightText: 2024 suyu Emulator Project
SPDX-License-Identifier: GPL-3.0-or-later
-->
# Migrating from yuzu
When coming from yuzu, the migration is as easy as renaming some directories.

View File

@@ -60,4 +60,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 3e6393519555a41d4672846cccbb38ef2c16f21f
COCOAPODS: 1.12.1
COCOAPODS: 1.15.2

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -756,7 +756,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -815,7 +815,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
@@ -833,12 +833,13 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.1.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = RJYEH6TCJD;
DEVELOPMENT_TEAM = "";
ENABLE_ONLY_ACTIVE_RESOURCES = YES;
INFOPLIST_FILE = V2rayU/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = V2rayU;
@@ -846,7 +847,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 4.1.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
@@ -855,7 +856,7 @@
SKIP_INSTALL = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Common/V2rayU-Bridging-header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -866,12 +867,13 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.1.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = RJYEH6TCJD;
DEVELOPMENT_TEAM = "";
ENABLE_ONLY_ACTIVE_RESOURCES = YES;
INFOPLIST_FILE = V2rayU/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = V2rayU;
@@ -879,7 +881,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 4.1.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
@@ -888,7 +890,7 @@
SKIP_INSTALL = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Common/V2rayU-Bridging-header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -899,9 +901,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = RJYEH6TCJD;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
@@ -914,9 +916,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = RJYEH6TCJD;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};

View File

@@ -18,9 +18,7 @@ let second: Double = 1000000
let pingURL = URL(string: "http://www.gstatic.com/generate_204")!
class PingSpeed: NSObject {
let lock = NSLock()
let semaphore = DispatchSemaphore(value: 30) // work pool
var group = DispatchGroup()
func pingAll() {
NSLog("ping start")
@@ -28,6 +26,7 @@ class PingSpeed: NSObject {
NSLog("ping inPing")
return
}
// make sure core file
V2rayLaunch.checkV2rayCore()
// in ping
@@ -51,26 +50,47 @@ class PingSpeed: NSObject {
DispatchQueue.main.async {
menuController.setStatusMenuTip(pingTip: pingTip)
}
let thread = Thread{
self.runTask(items: itemList)
Task {
do {
try await pingTaskGroup(items: itemList)
} catch let error {
NSLog("pingTaskGroup error: \(error)")
}
}
thread.start()
}
func runTask(items: [V2rayItem]) {
self.group = DispatchGroup()
let pingQueue = DispatchQueue(label: "pingQueue", qos: .background, attributes: .concurrent)
func pingTaskGroup(items: [V2rayItem]) async throws {
await withThrowingTaskGroup(of: Int.self) { group in
for item in items {
self.group.enter() // DispatchGroup
pingQueue.async {
// ,
self.semaphore.wait()
// run ping by async queue
self.pingEachServer(item: item)
group.addTask {
do {
await self.semaphore.wait()
defer {
self.semaphore.signal()
}
try await self.pingEachServer(item: item)
} catch let error {
NSLog("pingEachServer error: \(error)")
}
return 1
}
}
self.group.wait() //
print("All tasks finished")
}
print("pingTaskGroup end")
self.pingEnd()
}
func pingEachServer(item: V2rayItem) async throws {
NSLog("ping \(item.name) - \(item.remark)")
if !item.isValid {
return
}
// ping
let t = PingServer(item: item)
try await t.doPing()
}
func pingEnd() {
inPing = false
let langStr = Locale.current.languageCode
var pingTip: String = ""
@@ -79,33 +99,14 @@ class PingSpeed: NSObject {
} else {
pingTip = "Ping"
}
print("pingTaskGroup pingEnd", pingTip)
DispatchQueue.main.async {
menuController.setStatusMenuTip(pingTip: pingTip)
}
DispatchQueue.main.async {
menuController.showServers()
}
// kill
killAllPing()
}
func pingEachServer(item: V2rayItem) {
NSLog("ping \(item.name) - \(item.remark)")
if !item.isValid {
// refresh servers
ping.pingEnd(item: item)
return
}
// ping
PingServer(item: item).doPing()
}
func pingEnd(item: V2rayItem) {
lock.lock()
self.semaphore.signal() //
self.group.leave() // DispatchGroup
lock.unlock()
}
}
class PingServer: NSObject, URLSessionDataDelegate {
@@ -120,7 +121,7 @@ class PingServer: NSObject, URLSessionDataDelegate {
super.init() // can actually be omitted in this example because will happen automatically.
}
func doPing() {
func doPing() async throws {
let (_, _bindPort) = getUsablePort(port: uint16(Int.random(in: 9000 ... 36500)))
NSLog("doPing: \(item.name)-\(item.remark) - \(_bindPort)")
@@ -154,10 +155,13 @@ class PingServer: NSObject, URLSessionDataDelegate {
// sleep for wait v2ray process instanse
usleep(useconds_t(2 * second))
// url request
let session = URLSession(configuration: getProxyUrlSessionConfigure(httpProxyPort: bindPort), delegate: self, delegateQueue: nil)
let task = session.dataTask(with: URLRequest(url: pingURL))
task.resume()
do {
let (_,_) = try await session.data(for: URLRequest(url: pingURL))
} catch let error {
// failed to write file bad permissions, bad filename, missing permissions, or more likely it can't be converted to the encoding
NSLog("session request fail: \(error)")
}
}
func createV2rayJsonFileForPing() {
@@ -226,9 +230,6 @@ class PingServer: NSObject, URLSessionDataDelegate {
} catch let error {
print("remove ping config error: \(error)")
}
// refresh servers
ping.pingEnd(item: item)
}
}
@@ -242,16 +243,33 @@ class PingCurrent: NSObject, URLSessionDataDelegate {
}
func doPing() {
Task {
do {
try await _doPing()
pingCurrentEnd()
} catch let error {
NSLog("doPing error: \(error)")
}
}
}
func _doPing() async throws {
inPingCurrent = true
usleep(useconds_t(1 * second))
NSLog("PingCurrent start: try=\(tryPing),item=\(item.remark)")
// set URLSessionDataDelegate
let config = getProxyUrlSessionConfigure()
config.timeoutIntervalForRequest = 3
// url request
let session = URLSession(configuration: config, delegate: self, delegateQueue: nil)
let task = session.dataTask(with: URLRequest(url: pingURL))
task.resume()
tryPing += 1
do {
let (data, response) = try await session.data(for: URLRequest(url: pingURL))
print("doPing: ", data, response)
} catch let error {
// failed to write file bad permissions, bad filename, missing permissions, or more likely it can't be converted to the encoding
NSLog("save json file fail: \(error)")
}
}
// MARK: - URLSessionDataDelegate
@@ -272,7 +290,6 @@ class PingCurrent: NSObject, URLSessionDataDelegate {
}
// save
item.store()
pingCurrentEnd()
}
func pingCurrentEnd() {

View File

@@ -235,9 +235,8 @@ class V2raySubItem: NSObject, NSCoding {
let NOTIFY_UPDATE_SubSync = Notification.Name(rawValue: "NOTIFY_UPDATE_SubSync")
class V2raySubSync: NSObject {
let lock = NSLock()
var V2raySubSyncing = false
var group = DispatchGroup()
let semaphore = DispatchSemaphore(value: 2) // work pool
static var shared = V2raySubSync()
// Initialization
@@ -255,28 +254,43 @@ class V2raySubSync: NSObject {
self.V2raySubSyncing = true
NSLog("V2raySubSync start")
let thread = Thread {
V2raySubscription.loadConfig()
let list = V2raySubscription.list()
if list.count == 0 {
self.logTip(title: "fail: ", uri: "", informativeText: " please add Subscription Url")
}
// sync queue with DispatchGroup
self.group = DispatchGroup()
let subQueue = DispatchQueue(label: "subQueue", qos: .background)
for item in list {
subQueue.sync {
self.group.enter()
self.dlFromUrl(url: item.url, subscribe: item.name)
Task {
do {
try await self.syncTaskGroup(items: list)
} catch let error {
NSLog("pingTaskGroup error: \(error)")
}
}
self.group.wait()
NSLog("V2raySubSync end")
}
func syncTaskGroup(items: [V2raySubItem]) async throws {
await withThrowingTaskGroup(of: Int.self) { group in
for item in items {
group.addTask {
do {
await self.semaphore.wait()
defer {
self.semaphore.signal()
}
try await self.dlFromUrl(url: item.url, subscribe: item.name)
} catch let error {
NSLog("syncTaskGroup error: \(error)")
}
return 1
}
}
}
print("syncTaskGroup end")
self.refreshMenu()
}
thread.start()
}
func refreshMenu() {
NSLog("V2raySubSync refreshMenu")
@@ -293,41 +307,28 @@ class V2raySubSync: NSObject {
}
}
func importEnd(url: String, subscribe: String) {
self.group.leave()
}
public func dlFromUrl(url: String, subscribe: String) {
public func dlFromUrl(url: String, subscribe: String) async throws {
logTip(title: "loading from : ", uri: "", informativeText: url + "\n\n")
guard let reqUrl = URL(string: url) else {
logTip(title: "loading from : ", uri: "", informativeText: "url is not valid: " + url + "\n\n")
self.importEnd(url: url, subscribe: subscribe)
return
}
// url request with proxy
let session = URLSession(configuration: getProxyUrlSessionConfigure())
let task = session.dataTask(with: URLRequest(url: reqUrl)){(data: Data?, response: URLResponse?, error: Error?) in
defer {
self.importEnd(url: url, subscribe: subscribe)
}
if error != nil {
self.logTip(title: "loading fail: ", uri: url, informativeText: "error: \(String(describing: error))")
} else {
if data != nil {
if let outputStr = String(data: data!, encoding: String.Encoding.utf8) {
do {
let (data, _) = try await session.data(for: URLRequest(url: reqUrl))
if let outputStr = String(data: data, encoding: String.Encoding.utf8) {
self.handle(base64Str: outputStr, subscribe: subscribe, url: url)
} else {
self.logTip(title: "loading fail: ", uri: url, informativeText: "data is nil")
}
} else {
self.logTip(title: "loading fail: ", uri: url, informativeText: "data is nil")
} catch let error {
// failed to write file bad permissions, bad filename, missing permissions, or more likely it can't be converted to the encoding
NSLog("save json file fail: \(error)")
}
}
}
task.resume()
}
func handle(base64Str: String, subscribe: String, url: String) {
guard let strTmp = base64Str.trimmingCharacters(in: .whitespacesAndNewlines).base64Decoded() else {

View File

@@ -23,7 +23,7 @@ ADDITION = go build -o w$(NAME).exe -trimpath -ldflags "-H windowsgui $(LDFLAGS)
else
OUTPUT = $(NAME)
endif
ifeq ($(shell echo "$(GOARCH)" | grep -Pq "(mips|mipsle)" && echo true),true) #
ifeq ($(shell echo "$(GOARCH)" | grep -Eq "(mips|mipsle)" && echo true),true) #
ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN)
endif
.PHONY: clean

View File

@@ -413,38 +413,78 @@ endif()
## Export build compilation database if possible
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
include(CMakeDependentOption)
option(CLI "Build with cli." ON)
option(SERVER "Build with server." ON)
option(GUI "Build against GUI." OFF)
option(BUILD_TESTS "Build with test." OFF)
cmake_dependent_option(USE_GTK4
"Build with gtk4 (GUI)" ON
"GUI AND NOT WIN32 AND NOT APPLE AND NOT OHOS AND NOT ANDROID" OFF)
option(BUILD_BENCHMARKS "Build with benchmark." OFF)
option(BUILD_SHARED_LIBS "Build with shared libraries." OFF)
option(BUILD_TESTS "Build with test." OFF)
option(OPTIMIZED_PROTOC "Force protobuf compiler to be built with optimization" OFF)
option(USE_TCMALLOC "Build with tcmalloc (linux only)" OFF)
option(USE_TCMALLOC "Build with tcmalloc" OFF)
cmake_dependent_option(
USE_SYSTEM_TCMALLOC "Build with system or vendored tcmalloc" OFF
USE_TCMALLOC OFF)
option(USE_LIBCXX "Build with libc++" ON)
option(USE_NGHTTP2 "Build with libnghttp2" ON)
option(USE_MOLD "Build with mold linker" OFF)
option(USE_LLD "Build with lld linker" OFF)
option(USE_GOLD "Build with gold linker" OFF)
cmake_dependent_option(
USE_SYSTEM_NGHTTP2 "Build with system or vendored libnghttp2" OFF
USE_NGHTTP2 OFF)
option(USE_ICF "Build with ICF" OFF)
option(USE_LTO "Build with LTO" OFF)
option(USE_CURL "Build with libcurl (test only)" ON)
option(USE_CARES "Build with c-ares" ON)
option(BUILD_SHARED_LIBS "Build with shared libraries." OFF)
cmake_dependent_option(
USE_SYSTEM_CARES "Build with system or vendored c-ares" OFF
USE_CARES OFF)
option(USE_BUILTIN_CA_BUNDLE_CRT "Build with embedded ca-bundle.crt support" ON)
option(USE_MBEDTLS "Build with mbedtls support" ON)
option(USE_BALSA_HTTP_PARSER "Build with balsa http parser" ON)
option(USE_LEVELDB "Build with leveldb" OFF)
option(USE_SQLITE "Build with sqlite" OFF)
option(USE_OLD_SYSTEMD_SERVICE "Install with old systemd service files" OFF)
cmake_dependent_option(
USE_SYSTEM_MBEDTLS "Build with system or vendored mbedtls" OFF
USE_MBEDTLS OFF)
option(USE_QUICHE "Build with quiche support" ON)
cmake_dependent_option(
USE_BALSA_HTTP_PARSER "Build with balsa http parser" ON
USE_QUICHE OFF)
cmake_dependent_option(
USE_SYSTEM_HTTP_PARSER "Build with system or vendored http parser" OFF
"NOT USE_BALSA_HTTP_PARSER" OFF)
option(USE_LEVELDB "Build with leveldb" OFF)
option(USE_SQLITE "Build with sqlite" OFF)
cmake_dependent_option(
USE_SYSTEM_SQLITE "Build with system or vendored sqlite" OFF
USE_SQLITE OFF)
option(USE_OLD_SYSTEMD_SERVICE "Install with old systemd service files" OFF)
option(USE_IOURING "Build with io uring support" OFF)
option(USE_SYSTEM_ZLIB "Build with system or vendered zlib" OFF)
option(USE_SYSTEM_JSON "Build with system or vendered json library" OFF)
option(ENABLE_FORTIFY "Enable build with Fortify Source (linux only)" OFF)
option(ENABLE_LTO "Enable build with LTO" ON)
option(ENABLE_LLD "Enable build with LLD" ON)
option(ENABLE_GOLD "Enable build with GOLD" ON)
option(USE_GTK4 "Build with gtk4 if possible (GUI)" ON)
option(USE_MOLD "Build with mold linker" OFF)
option(USE_LLD "Build with lld linker" OFF)
option(USE_GOLD "Build with gold linker" OFF)
# Dynamic users are supported from version 235
# see https://0pointer.net/blog/dynamic-users-with-systemd.html
@@ -507,7 +547,7 @@ if (CMAKE_CROSSCOMPILING)
list(APPEND YASS_APP_FEATURES "crosscompile")
endif()
if (${CMAKE_BUILD_TYPE} MATCHES Release OR ${CMAKE_BUILD_TYPE} MATCHES MinSizeRel OR ${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)
if (upper_CMAKE_BUILD_TYPE MATCHES "RELEASE|MINSIZEREL|RELWITHDEBINFO")
message(STATUS "Release Build: ${CMAKE_BUILD_TYPE}")
set(IS_RELEASE_BUILD ON)
else()
@@ -546,6 +586,19 @@ if (ENABLE_LTO AND IS_RELEASE_BUILD)
endif()
endif()
if (NOT MSVC)
if (USE_MOLD)
add_link_options(-fuse-ld=mold -Wl,--gdb-index)
list(APPEND YASS_APP_FEATURES "linker mold")
elseif (USE_LLD)
add_link_options(-fuse-ld=lld)
list(APPEND YASS_APP_FEATURES "linker lld")
elseif (USE_GOLD)
add_link_options(-fuse-ld=gold)
list(APPEND YASS_APP_FEATURES "linker gold")
endif()
endif()
if (COMPILER_MSVC AND USE_LIBCXX)
message(SEND_ERROR "Microsoft Visual C++ Compiler with libc++ support is not supported, please disabling it with -DUSE_LIBCXX=off")
endif()
@@ -720,7 +773,7 @@ if(MSAN)
if (MSVC AND NOT MSVC_C_ARCHITECTURE_ID STREQUAL "arm64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=memory")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=memory")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /fsanitize=memory")
add_link_options(/fsanitize=memory)
else()
message(FATAL_ERROR "Cannot enable MSAN unless using Clang or Vistual Studio 2019 version 16.9")
endif()
@@ -728,7 +781,7 @@ if(MSAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
add_link_options(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
endif()
add_definitions(-DMEMORY_SANITIZER)
list(APPEND YASS_APP_FEATURES "msan")
@@ -741,14 +794,14 @@ if(ASAN)
if (MSVC AND NOT MSVC_C_ARCHITECTURE_ID STREQUAL "arm64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /fsanitize=address")
add_link_options(/fsanitize=address)
else()
message(FATAL_ERROR "Cannot enable ASAN unless using Clang or Vistual Studio 2019 version 16.9")
endif()
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer)
endif()
add_definitions(-DADDRESS_SANITIZER)
list(APPEND YASS_APP_FEATURES "asan")
@@ -775,14 +828,14 @@ if(TSAN)
if (MSVC AND NOT MSVC_C_ARCHITECTURE_ID STREQUAL "arm64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=thread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=thread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /fsanitize=thread")
add_link_options(/fsanitize=thread)
else()
message(FATAL_ERROR "Cannot enable TSAN unless using Clang or Vistual Studio 2019 version 16.9")
endif()
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
add_link_options(-fsanitize=thread)
endif()
add_definitions(-DTHREAD_SANITIZER)
list(APPEND YASS_APP_FEATURES "tsan")
@@ -801,7 +854,7 @@ if(UBSAN)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
add_link_options(-fsanitize=undefined)
endif()
add_definitions(-DUNDEFINED_SANITIZER)
list(APPEND YASS_APP_FEATURES "ubsan")
@@ -829,8 +882,7 @@ endif()
if (NOT MSAN AND NOT ASAN AND NOT TSAN AND NOT UBSAN)
if (NOT APPLE AND NOT MSVC AND NOT MINGW)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs -Wl,--as-needed")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,defs -Wl,--as-needed")
add_link_options(-Wl,-z,defs -Wl,--as-needed)
endif()
endif()
@@ -862,16 +914,13 @@ if (NOT MSVC)
endif()
if (APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
add_link_options(-Wl,-dead_strip)
else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
add_link_options(-Wl,--gc-sections)
endif()
if (APPLE AND NOT USE_MOLD)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,-no_data_in_code_info -Wl,-no_function_starts")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,-no_data_in_code_info -Wl,-no_function_starts")
add_link_options(-Wl,-no_data_in_code_info -Wl,-no_function_starts)
endif()
if (APPLE AND COMPILER_CLANG)
@@ -948,8 +997,7 @@ if (NOT MSVC)
# directly there, not through the compiler driver.
# We don't link on goma, so this change is just for cleaner
# internal linker invocations, for people who work on the build.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -no-canonical-prefixes")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-canonical-prefixes")
add_link_options(-no-canonical-prefixes)
endif()
else()
# Enable function-level linking.
@@ -998,17 +1046,14 @@ else()
## Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions
if (NOT MSVC_CRT_LINKAGE STREQUAL "static" AND NOT COMPILER_CLANG)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /GL")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL")
add_link_options(/LTCG)
endif()
# lld's uac manifest is outdated and incompatible with windows xp
if (USE_LLD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFESTUAC:NO")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFESTUAC:NO")
add_link_options(/MANIFESTUAC:NO)
endif()
## not omit stack frame pointer
@@ -1050,8 +1095,7 @@ else()
if (USE_LLD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gcodeview-ghash")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gcodeview-ghash")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:GHASH")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG:GHASH")
add_link_options(/DEBUG:GHASH)
endif()
else()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
@@ -1059,18 +1103,16 @@ else()
endif()
# Tell linker to include symbol data
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG")
add_link_options(/DEBUG)
## Remove unreferenced data
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /INCREMENTAL:NO /FIXED:NO")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /INCREMENTAL:NO /FIXED:NO")
if (USE_ICF)
add_link_options(/OPT:REF /OPT:ICF /INCREMENTAL:NO /FIXED:NO)
list(APPEND YASS_APP_FEATURES "ldflags icf")
endif()
# Tell linker to include FIXUP information symbol data
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /PROFILE")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /PROFILE")
add_link_options(/PROFILE)
# Use constructor homing for debug info. This option reduces debug info
# by emitting class type info only when constructors are emitted
@@ -1082,18 +1124,18 @@ else()
if (USE_LLD)
# Use a fake fixed base directory for paths in the pdb to make the pdb
# output fully deterministic and independent of the build directory.
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /PDBSourcePath:o:\\fake\\prefix")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /PDBSourcePath:o:\\fake\\prefix")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /PDBSourcePath:o:\\fake\\prefix")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /PDBSourcePath:o:\\fake\\prefix")
# verified via llvm-pdbutil pdb2yaml -modules -module-files -subsections=lines,fc yass.pdb|grep Module
# see https://reviews.llvm.org/D53021 and https://reviews.llvm.org/D48882
if (upper_CMAKE_BUILD_TYPE MATCHES "RELEASE|MINSIZEREL")
add_link_options(/PDBSourcePath:o:\\fake\\prefix)
endif()
# Absolutize source file paths for PDB. Pass the real build directory
# if the pdb contains source-level debug information and if linker
# reproducibility is not critical.
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /PDBSourcePath:${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /PDBSourcePath:${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /PDBSourcePath:${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /PDBSourcePath:${CMAKE_CURRENT_BINARY_DIR}")
if (upper_CMAKE_BUILD_TYPE MATCHES "DEBUG|RELWITHDEBINFO")
add_link_options(/PDBSourcePath:${CMAKE_CURRENT_BINARY_DIR})
endif()
endif()
# Tells the compiler not to use absolute paths when passing the default
@@ -1107,61 +1149,48 @@ endif()
## adopt Thin LTO
if (LTO AND COMPILER_CLANG AND USE_MOLD)
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-flto=thin>)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# TODO(lgrey): Enable unit splitting for Mac when supported.
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fsplit-lto-unit")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fsplit-lto-unit")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fsplit-lto-unit>)
endif()
if (NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_link_options(-flto=thin)
# In ThinLTO builds, we run at most one link process at a time,
# and let it use all cores.
# TODO(thakis): Check if '=0' (that is, number of cores, instead
# of "all" which means number of hardware threads) is faster.
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=all")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=all")
add_link_options(-Wl,--thinlto-jobs=all)
else()
include(ProcessorCount)
ProcessorCount(CPU_NUMBER)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=${CPU_NUMBER}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=${CPU_NUMBER}")
add_link_options(-Wl,--thinlto-jobs=${CPU_NUMBER})
endif()
endif()
if (NOT ANDROID AND NOT OHOS AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR APPLE))
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fwhole-program-vtables>)
if (NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_link_options(-fwhole-program-vtables)
endif()
endif()
endif()
## adopt Thin LTO
if (LTO AND COMPILER_CLANG AND USE_LLD)
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-flto=thin>)
if (NOT APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# TODO(lgrey): Enable unit splitting for Mac when supported.
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fsplit-lto-unit")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fsplit-lto-unit")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fsplit-lto-unit>)
endif()
# Limit the size of the ThinLTO cache to the lesser of 10% of
# available disk space, 40GB and 100000 files.
if (MSVC)
set(cache_policy "cache_size=10%:cache_size_bytes=40g")
else()
set(cache_policy "cache_size=10\\%:cache_size_bytes=40g")
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(cache_policy "${cache_policy}:cache_size_files=100000")
@@ -1173,102 +1202,79 @@ if (LTO AND COMPILER_CLANG AND USE_LLD)
if (MSVC)
# When using lld-link, the -flto option need only be added to the compile step
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} /opt:lldltojobs=all -mllvm:-import-instr-limit=${import_instr_limit} /lldltocache:thinlto-cache /lldltocachepolicy:${cache_policy}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} /opt:lldltojobs=all -mllvm:-import-instr-limit=${import_instr_limit} /lldltocache:thinlto-cache /lldltocachepolicy:${cache_policy}")
add_link_options(/opt:lldltojobs=all -mllvm:-import-instr-limit=${import_instr_limit} /lldltocache:thinlto-cache /lldltocachepolicy:${cache_policy})
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -mllvm:-disable-auto-upgrade-debug-info")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -mllvm:-disable-auto-upgrade-debug-info")
add_link_options(-mllvm:-disable-auto-upgrade-debug-info)
endif()
elseif (NOT MINGW)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_link_options(-flto=thin)
# In ThinLTO builds, we run at most one link process at a time,
# and let it use all cores.
# TODO(thakis): Check if '=0' (that is, number of cores, instead
# of "all" which means number of hardware threads) is faster.
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=all")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=all")
add_link_options(-Wl,--thinlto-jobs=all)
else()
include(ProcessorCount)
ProcessorCount(CPU_NUMBER)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=${CPU_NUMBER}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-jobs=${CPU_NUMBER}")
add_link_options(-Wl,--thinlto-jobs=${CPU_NUMBER})
endif()
if (APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
if (YASS_TARGET_IS_CROSSCOMPILE_HOST)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-cache_path_lto,${CMAKE_CURRENT_BINARY_DIR}/../thinlto-cache")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-cache_path_lto,${CMAKE_CURRENT_BINARY_DIR}/../thinlto-cache")
add_link_options(-Wl,-cache_path_lto,${CMAKE_CURRENT_BINARY_DIR}/../thinlto-cache)
else()
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-cache_path_lto,thinlto-cache")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-cache_path_lto,thinlto-cache")
add_link_options(-Wl,-cache_path_lto,thinlto-cache)
endif()
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wcrl,object_path_lto")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wcrl,object_path_lto")
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-policy=${cache_policy}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-policy=${cache_policy}")
add_link_options(-Wcrl,object_path_lto)
add_link_options(-Wl,--thinlto-cache-policy=${cache_policy})
elseif (NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-dir=thinlto-cache")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-dir=thinlto-cache")
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-policy,${cache_policy}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,--thinlto-cache-policy,${cache_policy}")
add_link_options(-Wl,--thinlto-cache-dir=thinlto-cache)
add_link_options(-Wl,--thinlto-cache-policy,${cache_policy})
endif()
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-import-instr-limit=${import_instr_limit}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-import-instr-limit=${import_instr_limit}")
add_link_options(-Wl,-mllvm,-import-instr-limit=${import_instr_limit})
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-disable-auto-upgrade-debug-info")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-disable-auto-upgrade-debug-info")
add_link_options(-Wl,-mllvm,-disable-auto-upgrade-debug-info)
endif()
endif()
if (NOT ANDROID AND NOT OHOS AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR APPLE))
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fwhole-program-vtables>)
if (NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_link_options(-fwhole-program-vtables)
endif()
endif()
endif()
## adopt Thin LTO
if (LTO AND COMPILER_CLANG AND USE_GOLD)
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-flto=thin>)
# Limit the size of the ThinLTO cache to the lesser of 10% of
# available disk space, 40GB and 100000 files.
set(cache_policy "cache_size=10\\%:cache_size_bytes=40g:cache_size_files=100000")
set(cache_policy "cache_size=10%:cache_size_bytes=40g:cache_size_files=100000")
# TODO(gbiv): We ideally shouldn't need to specify this; ThinLTO
# should be able to better manage binary size increases on its own.
set(import_instr_limit 5)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=thin")
add_link_options(-flto=thin)
# In ThinLTO builds, we run at most one link process at a time,
# and let it use all cores.
# TODO(thakis): Check if '=0' (that is, number of cores, instead
# of "all" which means number of hardware threads) is faster.
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,jobs=all")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,jobs=all")
add_link_options(-Wl,-plugin-opt,jobs=all)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,cache-dir=thinlto-cache")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,cache-dir=thinlto-cache")
add_link_options(-Wl,-plugin-opt,cache-dir=thinlto-cache)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,cache-policy=${cache_policy}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-plugin-opt,cache-policy=${cache_policy}")
add_link_options(-Wl,-plugin-opt,cache-policy=${cache_policy})
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-import-instr-limit=${import_instr_limit}")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wl,-mllvm,-import-instr-limit=${import_instr_limit}")
add_link_options(-Wl,-mllvm,-import-instr-limit=${import_instr_limit})
if (NOT ANDROID AND NOT OHOS AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR APPLE))
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fwhole-program-vtables>)
if (NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -fwhole-program-vtables")
add_link_options(-fwhole-program-vtables)
endif()
endif()
endif()
@@ -1277,27 +1283,21 @@ endif()
## old gcc has regression on c++17 mode
## https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004
if (LTO AND COMPILER_GCC)
set(CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=auto")
set(CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=auto")
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=auto")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -flto=auto")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-flto=auto>)
add_link_options(-flto=auto)
# gcc is known to fails at combining -std=c++14 and -std=c++17 objects (fixed in gcc 8.4)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89358
# and another https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84044 (fixed in gcc 9.1)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-error=odr")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-error=odr")
add_link_options(-Wno-error=odr)
endif()
# silence lto warning on old gcc, fixed in latest gcc
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-error=odr")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-error=odr")
add_link_options(-Wno-error=odr)
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-lto-type-mismatch")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-lto-type-mismatch")
add_link_options(-Wno-lto-type-mismatch)
else()
set(CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_SHARED_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-lto-type-mismatch -Wno-odr -Wno-error=uninitialized")
set(CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE} "${CMAKE_EXE_LINKER_FLAGS_${upper_CMAKE_BUILD_TYPE}} -Wno-lto-type-mismatch -Wno-odr -Wno-error=uninitialized")
add_link_options(-Wno-lto-type-mismatch -Wno-odr -Wno-error=uninitialized)
endif()
endif()
@@ -1365,26 +1365,12 @@ if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector")
endif()
if (USE_MOLD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=mold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=mold")
list(APPEND YASS_APP_FEATURES "linker mold")
endif()
if (USE_LLD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
list(APPEND YASS_APP_FEATURES "linker lld")
endif()
# Linker warnings.
if (FALSE)
if (NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--fatal-warnings")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--fatal-warnings")
add_link_options(-Wl,--fatal-warnings)
else ()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-fatal_warnings")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-fatal_warnings")
add_link_options(-Wl,-fatal_warnings)
endif()
endif()
endif()
@@ -1395,14 +1381,11 @@ if (UNIX AND NOT APPLE)
# Explicitly pass --build-id to ld. Compilers used to always pass this
# implicitly but don't any more (in particular clang when built without
# ENABLE_LINKER_BUILD_ID=ON).
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--build-id=sha1")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--build-id=sha1")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} -Wl,--build-id=sha1")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id=sha1")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id=sha1")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--build-id=sha1")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--build-id")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wl,--build-id")
if (IS_RELEASE_BUILD)
add_link_options(-Wl,--build-id=sha1)
else()
add_link_options(-Wl,--build-id)
endif()
# _FILE_OFFSET_BITS=64 should not be set on Android in order to maintain
# the behavior of the Android NDK from earlier versions.
@@ -1432,11 +1415,8 @@ if ((UNIX AND NOT APPLE) OR ANDROID OR OHOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe")
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,now")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,now")
add_link_options(-Wl,-z,noexecstack -Wl,-z,relro)
add_link_options(-Wl,-z,now)
endif()
# Linux-specific compiler flags setup.
@@ -1446,13 +1426,9 @@ if ((UNIX AND NOT APPLE) AND USE_LLD)
# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=4096")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,max-page-size=4096")
add_link_options(-Wl,-z,max-page-size=4096)
endif()
elseif (USE_GOLD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
list(APPEND YASS_APP_FEATURES "linker gold")
if (NOT ANDROID AND NOT OHOS)
# On Android, this isn't needed. gcc in the NDK knows to look next to
# it with -fuse-ld=gold, and clang gets a --gcc-toolchain flag passed
@@ -1465,8 +1441,7 @@ elseif (USE_GOLD)
# linker might not be gold, but isn't used much anyway.
# FIXME crashing on aarch64 build machine
if (FALSE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--threads -Wl,--thread-count=4")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--threads -Wl,--thread-count=4")
add_link_options(-Wl,--threads -Wl,--thread-count=4)
endif()
endif()
@@ -1480,8 +1455,7 @@ if (USE_ICF AND (NOT APPLE OR COMPILER_CLANG) AND NOT MSVC)
# Gold doesn't respect section alignment and breaks gcc builds with icf
# https://sourceware.org/bugzilla/show_bug.cgi?id=17704
# Landed upstream Fri, 21 Oct 2016 - is in 2.28, such as CentOS 7
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--icf=all")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--icf=all")
add_link_options(-Wl,--icf=all)
list(APPEND YASS_APP_FEATURES "ldflags icf")
endif()
@@ -1524,19 +1498,16 @@ if (USE_LLD)
if (MSVC)
# On Windows, we call the linker directly, instead of calling it through
# the driver.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --color-diagnostics")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --color-diagnostics")
add_link_options(--color-diagnostics)
elseif (NOT MINGW)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--color-diagnostics")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--color-diagnostics")
add_link_options(-Wl,--color-diagnostics)
endif()
endif()
# Enable text section splitting only on linux when using lld for now. Other
# platforms can be added later if needed.
if ((UNIX AND NOT APPLE) AND USE_LLD)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,keep-text-section-prefix")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,keep-text-section-prefix")
add_link_options(-Wl,-z,keep-text-section-prefix)
endif()
if (COMPILER_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
@@ -1546,11 +1517,9 @@ if (COMPILER_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -instcombine-lower-dbg-declare=0")
if (USE_LLD)
if (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mllvm:-instcombine-lower-dbg-declare=0")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mllvm:-instcombine-lower-dbg-declare=0")
add_link_options(-mllvm:-instcombine-lower-dbg-declare=0)
else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-mllvm,-instcombine-lower-dbg-declare=0")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-mllvm,-instcombine-lower-dbg-declare=0")
add_link_options(-Wl,-mllvm,-instcombine-lower-dbg-declare=0)
endif()
endif()
@@ -1601,15 +1570,13 @@ endif()
# Pass flag to LLD so Android builds can allow debuggerd to properly symbolize
# stack crashes (http://crbug.com/919499).
if (USE_LLD AND ANDROID)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-rosegment")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-rosegment")
add_link_options(-Wl,--no-rosegment)
endif()
# TODO(crbug.com/1374347): Cleanup undefined symbol errors caught by
# --no-undefined-version.
if (USE_LLD AND NOT WIN32 AND NOT APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined-version")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--undefined-version")
add_link_options(-Wl,--undefined-version)
endif()
# Apple: pass --strict-auto-link to ld64.lld
@@ -1620,8 +1587,7 @@ endif()
# After https://reviews.llvm.org/D140491, this will only happen if the link fails,
# matching ld64. Passing `--strict-auto-link` restores the old behavior.
if (USE_LLD AND APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--strict-auto-link")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--strict-auto-link")
add_link_options(-Wl,--strict-auto-link)
endif()
# LLD does call-graph-sorted binary layout by default when profile data is
@@ -1630,13 +1596,11 @@ endif()
# beneficial.
if (USE_LLD)
if (MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /call-graph-profile-sort:no")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /call-graph-profile-sort:no")
add_link_options(/call-graph-profile-sort:no)
elseif (NOT APPLE AND NOT MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# TODO(thakis): Once LLD's Mach-O port basically works, implement call
# graph profile sorting for it, add an opt-out flag, and pass it here.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-call-graph-profile-sort")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-call-graph-profile-sort")
add_link_options(-Wl,--no-call-graph-profile-sort)
endif()
endif()
@@ -1758,13 +1722,11 @@ if (WIN32)
# set linker option for x86
if (MSVC_PROCESSOR_ARCHITECTURE STREQUAL "x86")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH /largeaddressaware")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH /largeaddressaware")
add_link_options(/SAFESEH /largeaddressaware)
endif()
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DYNAMICBASE /NXCOMPAT")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE /NXCOMPAT")
add_link_options(/DYNAMICBASE /NXCOMPAT)
endif()
if (MSVC AND ALLOW_XP)
@@ -1837,21 +1799,18 @@ if (ANDROID)
# Don't allow visible symbols from libraries that contain
# assembly code with symbols that aren't hidden properly.
# http://crbug.com/448386
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs=libvpx_assembly_arm.a")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--exclude-libs=libvpx_assembly_arm.a")
add_link_options(-Wl,--exclude-libs=libvpx_assembly_arm.a)
# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm64.*")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=4096")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,max-page-size=4096")
add_link_options(-Wl,-z,max-page-size=4096)
endif()
# Instead of using an unwind lib from the toolchain,
# buildtools/third_party/libunwind will be built and used directly.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --unwindlib=none")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --unwindlib=none")
add_link_options(--unwindlib=none)
list(APPEND YASS_APP_FEATURES "libunwind")
@@ -2035,8 +1994,7 @@ int main() {
include_directories(third_party/lss)
endif()
if (APPLE AND COMPILER_CLANG)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Foundation -framework SystemConfiguration")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework SystemConfiguration")
link_libraries("-framework Foundation" "-framework SystemConfiguration")
endif()
endif()
@@ -2444,12 +2402,10 @@ elseif (USE_TCMALLOC)
# patching manually, see tcmalloc's README_windows.txt
if (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCLUDE:\"__tcmalloc\"")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCLUDE:\"__tcmalloc\"")
add_link_options(/INCLUDE:__tcmalloc)
endif()
if (MINGW)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-u__tcmalloc")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-u__tcmalloc")
add_link_options(-Wl,-u__tcmalloc)
endif()
endif()
@@ -2507,7 +2463,7 @@ if (MSVC AND MSVC_CRT_LINKAGE STREQUAL "dynamic" AND NOT ALLOW_XP AND ${CMAKE_BU
file(COPY "${_CRASHPAD_BINARY_PREFIX}/crashpad_handler.exe" DESTINATION ${CMAKE_BINARY_DIR})
install(FILES "${_CRASHPAD_BINARY_PREFIX}/crashpad_handler.exe" DESTINATION bin)
install(FILES "${_CRASHPAD_BINARY_PREFIX}/crashpad_handler.exe" DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if (IOS)
@@ -3345,7 +3301,28 @@ endif()
# sqlite3 Library
# *****************************************************************************************
if (USE_SQLITE)
if (USE_SYSTEM_SQLITE)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(SQLITE sqlite3)
endif()
if(NOT SQLITE_FOUND)
message(STATUS "System sqlite3 not found, using bundled one")
set(USE_SYSTEM_SQLITE FALSE)
endif()
endif()
if (USE_SYSTEM_SQLITE AND USE_SQLITE)
message(STATUS "Compiling with system sqlite3 library")
list(APPEND YASS_APP_FEATURES "system sqlite3 library")
set(SUPPORT_DEFINITIONS
HAVE_SQLITE
${SUPPORT_DEFINITIONS}
)
include_directories(${SQLITE_INCLUDE_DIRS})
link_directories(${SQLITE_LIBRARY_DIRS})
link_libraries(${SQLITE_LIBRARIES})
elseif (USE_SQLITE)
message(STATUS "Compiling with bundled sqlite3 library")
add_subdirectory(third_party/sqlite)
list(APPEND YASS_APP_FEATURES "sqlite3")
@@ -3522,8 +3499,7 @@ if (COMPILER_GCC OR COMPILER_CLANG)
# this may happens
if (COMPILER_CLANG)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wno-unused-command-line-argument")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wno-unused-command-line-argument")
add_link_options(-Wno-unused-command-line-argument)
endif()
if (COMPILER_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
@@ -3969,8 +3945,8 @@ if (CLI)
)
if (NOT CMAKE_SKIP_INSTALL_RULES AND NOT WIN32 AND NOT IOS)
install(TARGETS yass_cli RUNTIME DESTINATION bin)
install(FILES doc/yass_cli.1 DESTINATION share/man/man1)
install(TARGETS yass_cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES doc/yass_cli.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
# TODO add freebsd rc files
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID AND NOT OHOS)
install(FILES yass.json.sample RENAME config.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/yass)
@@ -4020,8 +3996,8 @@ if (SERVER)
)
if (NOT CMAKE_SKIP_INSTALL_RULES AND NOT WIN32 AND NOT IOS)
install(TARGETS yass_server RUNTIME DESTINATION bin)
install(FILES doc/yass_server.1 DESTINATION share/man/man1)
install(TARGETS yass_server RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES doc/yass_server.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID AND NOT OHOS)
install(FILES yass-server.json.sample RENAME server.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/yass)
install(FILES yass-server${SYSTEMD_SERVICE_SUFFIX}.service RENAME yass-server.service DESTINATION lib/systemd/system)
@@ -4624,7 +4600,7 @@ if (GUI)
if (NOT CMAKE_SKIP_INSTALL_RULES)
# installable, except on macOS when marked as MACOSX_BUNDLE
if (NOT APPLE)
install(TARGETS ${APP_NAME} RUNTIME DESTINATION bin)
install(TARGETS ${APP_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if (GUI_FLAVOUR STREQUAL "gtk3" OR GUI_FLAVOUR STREQUAL "gtk4")

View File

@@ -630,3 +630,4 @@ TuxCoder
voidful
vtexier
WyohKnott
trueauracoral

View File

@@ -4,6 +4,17 @@
# To create a release, dispatch the https://github.com/yt-dlp/yt-dlp/actions/workflows/release.yml workflow on master
-->
### 2024.05.27
#### Extractor changes
- [Fix parsing of base URL in SMIL manifest](https://github.com/yt-dlp/yt-dlp/commit/26603d0b34898818992bee4598e0607c07059511) ([#9225](https://github.com/yt-dlp/yt-dlp/issues/9225)) by [seproDev](https://github.com/seproDev)
- **peertube**: [Support livestreams](https://github.com/yt-dlp/yt-dlp/commit/12b248ce60be1aa1362edd839d915bba70dbee4b) ([#10044](https://github.com/yt-dlp/yt-dlp/issues/10044)) by [bashonly](https://github.com/bashonly), [trueauracoral](https://github.com/trueauracoral)
- **piksel**: [Update domain](https://github.com/yt-dlp/yt-dlp/commit/ae2194e1dd4a99d32eb3cab7c48a0ff03101ef3b) ([#9223](https://github.com/yt-dlp/yt-dlp/issues/9223)) by [seproDev](https://github.com/seproDev)
- **tiktok**: user: [Fix extraction loop](https://github.com/yt-dlp/yt-dlp/commit/c53c2e40fde8f2e15c7c62f8ca1a5d9e90ddc079) ([#10035](https://github.com/yt-dlp/yt-dlp/issues/10035)) by [bashonly](https://github.com/bashonly)
#### Misc. changes
- **cleanup**: Miscellaneous: [5e3e19c](https://github.com/yt-dlp/yt-dlp/commit/5e3e19c93c52830da98d9d1ed84ea7a559efefbd) by [bashonly](https://github.com/bashonly)
### 2024.05.26
#### Core changes

View File

@@ -401,6 +401,9 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git
--impersonate CLIENT[:OS] Client to impersonate for requests. E.g.
chrome, chrome-110, chrome:windows-10. Pass
--impersonate="" to impersonate any client.
Note that forcing impersonation for all
requests may have a detrimental impact on
download speed and stability
--list-impersonate-targets List available clients to impersonate.
-4, --force-ipv4 Make all connections via IPv4
-6, --force-ipv6 Make all connections via IPv6

View File

@@ -1470,11 +1470,15 @@ class PeerTubeIE(InfoExtractor):
title = video['name']
formats = []
formats, is_live = [], False
files = video.get('files') or []
for playlist in (video.get('streamingPlaylists') or []):
if not isinstance(playlist, dict):
continue
if playlist_url := url_or_none(playlist.get('playlistUrl')):
is_live = True
formats.extend(self._extract_m3u8_formats(
playlist_url, video_id, fatal=False, live=True))
playlist_files = playlist.get('files')
if not (playlist_files and isinstance(playlist_files, list)):
continue
@@ -1498,6 +1502,7 @@ class PeerTubeIE(InfoExtractor):
f['vcodec'] = 'none'
else:
f['fps'] = int_or_none(file_.get('fps'))
is_live = False
formats.append(f)
description = video.get('description')
@@ -1555,6 +1560,7 @@ class PeerTubeIE(InfoExtractor):
'categories': categories,
'formats': formats,
'subtitles': subtitles,
'is_live': is_live,
'webpage_url': webpage_url,
}

View File

@@ -520,7 +520,8 @@ def create_parser():
metavar='CLIENT[:OS]', dest='impersonate', default=None,
help=(
'Client to impersonate for requests. E.g. chrome, chrome-110, chrome:windows-10. '
'Pass --impersonate="" to impersonate any client.'),
'Pass --impersonate="" to impersonate any client. Note that forcing impersonation '
'for all requests may have a detrimental impact on download speed and stability'),
)
network.add_option(
'--list-impersonate-targets',

View File

@@ -1,8 +1,8 @@
# Autogenerated by devscripts/update-version.py
__version__ = '2024.05.26'
__version__ = '2024.05.27'
RELEASE_GIT_HEAD = 'ae2af1104f80caf2f47544763a33db2c17a3e1de'
RELEASE_GIT_HEAD = '12b248ce60be1aa1362edd839d915bba70dbee4b'
VARIANT = None
@@ -12,4 +12,4 @@ CHANNEL = 'stable'
ORIGIN = 'yt-dlp/yt-dlp'
_pkg_version = '2024.05.26'
_pkg_version = '2024.05.27'