Skip to content

Commit 6b028a5

Browse files
committed
chore: conservative .gitattributes + CnPack maintenance doc
1 parent e319181 commit 6b028a5

13 files changed

Lines changed: 14394 additions & 14262 deletions

.gitattributes

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Conservative policy for an upstream-synced fork: do NOT globally normalise
2+
# (that would drift the fork from winddriver on every sync). Only force endings
3+
# where a wrong one breaks the file, and keep vendored/byte-exact files intact.
4+
5+
# Scripts & CI — a wrong ending breaks these
6+
*.sh text eol=lf
7+
*.bat text eol=crlf
8+
*.cmd text eol=crlf
9+
*.ps1 text eol=crlf
10+
*.yml text eol=lf
11+
*.yaml text eol=lf
12+
13+
# Vendored CnPack (GBK-encoded) + patches — never normalise; stay identical to source
14+
CnPack/** -text
15+
*.patch -text
16+
*.diff -text
17+
18+
# Certs / keys — exact bytes
19+
*.crt binary
20+
*.cer binary
21+
*.der binary
22+
*.pem binary
23+
*.key binary
24+
*.pfx binary
25+
*.p12 binary
26+
27+
# Binaries / build artifacts
28+
*.png binary
29+
*.jpg binary
30+
*.gif binary
31+
*.ico binary
32+
*.res binary
33+
*.dcr binary
34+
*.dcu binary
35+
*.dcp binary
36+
*.exe binary
37+
*.dll binary
38+
*.so binary
39+
*.dylib binary
40+
# NOTE: *.pas/.dpr/.inc/.dproj are intentionally NOT listed — left to core.autocrlf
41+
# so the fork stays byte-close to upstream after each sync.

MAINTAINING-CNPACK-SUBSET.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Maintaining the bundled CnPack subset (boss-installability)
2+
3+
**Read this before touching `CnPack/`, releasing a new tag, or running the fork-sync.**
4+
5+
## Why this fork exists
6+
7+
`freitasjca/Delphi-Cross-Socket` is a fork of
8+
[`winddriver/Delphi-Cross-Socket`](https://github.com/winddriver/Delphi-Cross-Socket)
9+
whose **only reason to exist is to be installable with [Boss](https://github.com/HashLoad/boss)**
10+
(the Delphi package manager). Two upstreams block that:
11+
12+
- **`winddriver/Delphi-Cross-Socket`** ships no `boss.json`.
13+
- **CnPack / [`cnpack/cnvcl`](https://github.com/cnpack/cnvcl)** — a *dependency* of
14+
Delphi-Cross-Socket's SSL/crypto layer — also has no `boss.json` and is a huge repo.
15+
16+
So this fork adds (a) a `boss.json`, (b) the **minimal CnPack subset** that
17+
Delphi-Cross-Socket actually needs, vendored under `CnPack/`, and (c) the mTLS additions
18+
(`Net/Net.CrossSslSocket.{Base,OpenSSL}.pas`). A consumer (e.g.
19+
[`horse-provider-crosssocket`](https://github.com/freitasjca/horse-provider-crosssocket))
20+
can then `boss install` this fork and compile **without ever touching cnvcl**.
21+
22+
> The `boss.json` `description` currently says *"adds Boss package manifest only. Zero source
23+
> changes"* — that is **stale**: the fork also vendors the CnPack subset and the mTLS patches.
24+
> Update it when convenient.
25+
26+
## The invariant — what must always hold
27+
28+
The vendored subset **must be a complete, self-contained transitive closure** so the package
29+
compiles standalone:
30+
31+
1. **`CnPack/Common/CnPack.inc` must be present.** Every Cn unit begins with `{$I CnPack.inc}`;
32+
without it nothing compiles.
33+
2. **Every unit named in any `uses` clause of a bundled unit must also be bundled.** If you add
34+
a Crypto unit that pulls in a new `Cn*` dependency, that dependency has to be copied in too.
35+
3. The split mirrors cnvcl's own layout: foundation units in `CnPack/Common/`, crypto in
36+
`CnPack/Crypto/`.
37+
38+
### Current inventory (18 files — keep this list and the fork-sync in step)
39+
40+
```
41+
CnPack/Common/ CnPack.inc CnConsts.pas CnFloat.pas CnStrings.pas CnWideStrings.pas
42+
CnPack/Crypto/ CnAES.pas CnBase64.pas CnDES.pas CnKDF.pas CnMD5.pas CnNative.pas
43+
CnPemUtils.pas CnRandom.pas CnSHA1.pas CnSHA2.pas CnSHA3.pas
44+
CnSM3.pas CnSM4.pas
45+
```
46+
47+
> History: earlier releases kept everything under `CnPack/Crypto/` (14 units). cnvcl later
48+
> moved the foundation units to `Source/Common/` and added `CnStrings`, `CnWideStrings`,
49+
> `CnSM4`; the v1.0.3 re-sync follows that — hence the `Common/` directory.
50+
51+
## Re-syncing the subset when cnvcl updates
52+
53+
1. Update your local cnvcl: `cd cnvcl && git pull --ff-only origin master`.
54+
2. Copy the units above from cnvcl into the fork:
55+
- `cnvcl/Source/Common/{CnPack.inc,CnConsts,CnFloat,CnStrings,CnWideStrings}``CnPack/Common/`
56+
- `cnvcl/Source/Crypto/{the 13 crypto units}.pas``CnPack/Crypto/`
57+
- (verify the cnvcl source-side paths — cnvcl occasionally relocates units between
58+
`Source/Common` and `Source/Crypto`.)
59+
3. **Re-validate the closure** — the only authoritative check (the CnPack sources are
60+
**GBK/ANSI-encoded**, which defeats `grep`-based scans): `boss install` this fork into a
61+
throwaway project, or build `horse-provider-crosssocket` against it, and confirm a clean
62+
compile with **no missing `Cn*` unit**. If the compiler reports a missing unit, copy it in
63+
and repeat.
64+
4. Commit the subset change on its own (`git add -A CnPack/` so renames register), separate
65+
from version bumps and `.gitattributes` changes.
66+
67+
## ⚠️ Keep the fork-sync automation in step — or it reverts the subset
68+
69+
The fork-sync (`crosssocket-fork-sync-action/` → deployed to the fork's `master` as a daily
70+
GitHub Action) **resets `master` to upstream's tip and re-layers the CnPack subset from a
71+
hardcoded list**. If that list doesn't match the inventory above, the next nightly run
72+
**silently restores the wrong subset and breaks the boss build.** Two files must be updated
73+
together with any subset change:
74+
75+
- `.github/workflows/sync-upstream.yml` — the `Clone CnPack (cnvcl) and copy required files`
76+
step (the actual `cp` list + the `mkdir CnPack/Common CnPack/Crypto`).
77+
- `.sync/README.md` — the human-readable manifest table (fork path ← cnvcl source path).
78+
79+
Optionally pin `CNVCL_REF` in `sync-upstream.yml` to a validated cnvcl tag/sha instead of
80+
`master`, so a surprise upstream cnvcl change can't break a nightly sync.
81+
82+
## Consumer-side note
83+
84+
Because the foundation units live in `CnPack/Common/`, any consuming project's search path must
85+
include **both** `CnPack/Common` **and** `CnPack/Crypto` (see the "Required search paths" list
86+
in `horse-provider-crosssocket`'s README). Adding only `Crypto/` will fail to resolve
87+
`CnConsts`/`CnFloat`/`CnStrings`/`CnWideStrings`.
88+
89+
## Don't track build/IDE artifacts
90+
91+
`.dcu`, `.res`, `.dproj.local`, `.dsv`, `__history/` must stay out of the repo (they bloat it
92+
and create false "modified" churn). They are covered by `.gitignore`; if any are already
93+
tracked, `git rm --cached` them.
94+
95+
## Endgame
96+
97+
The mTLS additions are pending an upstream PR. Once upstream merges them **and** a boss-friendly
98+
distribution of Delphi-Cross-Socket + CnPack exists, this fork (and this whole subset-maintenance
99+
burden) can be retired. Until then, every cnvcl bump is a re-sync chore — keep this doc, the
100+
inventory, and the fork-sync manifest aligned.

Net/Demos/Delphi/HttpClient/HttpClient.dproj

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<MainSource>HttpClient.dpr</MainSource>
55
<Base>True</Base>
66
<Config Condition="'$(Config)'==''">Release</Config>
7-
<TargetedPlatforms>693379</TargetedPlatforms>
7+
<TargetedPlatforms>168067</TargetedPlatforms>
88
<AppType>Console</AppType>
99
<FrameworkType>None</FrameworkType>
1010
<ProjectVersion>20.3</ProjectVersion>
@@ -23,11 +23,6 @@
2323
<CfgParent>Base</CfgParent>
2424
<Base>true</Base>
2525
</PropertyGroup>
26-
<PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Base)'=='true') or '$(Base_iOSDevice64)'!=''">
27-
<Base_iOSDevice64>true</Base_iOSDevice64>
28-
<CfgParent>Base</CfgParent>
29-
<Base>true</Base>
30-
</PropertyGroup>
3126
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
3227
<Base_Win32>true</Base_Win32>
3328
<CfgParent>Base</CfgParent>
@@ -49,8 +44,8 @@
4944
<Cfg_1>true</Cfg_1>
5045
<Base>true</Base>
5146
</PropertyGroup>
52-
<PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Cfg_1)'=='true') or '$(Cfg_1_iOSDevice64)'!=''">
53-
<Cfg_1_iOSDevice64>true</Cfg_1_iOSDevice64>
47+
<PropertyGroup Condition="('$(Platform)'=='Linux64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Linux64)'!=''">
48+
<Cfg_1_Linux64>true</Cfg_1_Linux64>
5449
<CfgParent>Cfg_1</CfgParent>
5550
<Cfg_1>true</Cfg_1>
5651
<Base>true</Base>
@@ -90,12 +85,6 @@
9085
<Cfg_2>true</Cfg_2>
9186
<Base>true</Base>
9287
</PropertyGroup>
93-
<PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Cfg_2)'=='true') or '$(Cfg_2_iOSDevice64)'!=''">
94-
<Cfg_2_iOSDevice64>true</Cfg_2_iOSDevice64>
95-
<CfgParent>Cfg_2</CfgParent>
96-
<Cfg_2>true</Cfg_2>
97-
<Base>true</Base>
98-
</PropertyGroup>
9988
<PropertyGroup Condition="('$(Platform)'=='OSX64' and '$(Cfg_2)'=='true') or '$(Cfg_2_OSX64)'!=''">
10089
<Cfg_2_OSX64>true</Cfg_2_OSX64>
10190
<CfgParent>Cfg_2</CfgParent>
@@ -133,9 +122,10 @@
133122
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
134123
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
135124
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
136-
<DCC_ExeOutput>bin\$(Platform)\</DCC_ExeOutput>
137-
<DCC_UnitSearchPath>..\..\..\..\Net;..\..\..\..\Utils;..\..\..\..\DelphiToFPC;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
138-
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
125+
<DCC_ExeOutput>..\..\..\..\..\..\bin\$(Platform)\$(Config)</DCC_ExeOutput>
126+
<DCC_UnitSearchPath>..\..\..\..\Net;..\..\..\..\Utils;..\..\..\..\DelphiToFPC;C:\lang\Repo\Delphi-Cross-Socket;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
127+
<DCC_DcuOutput>..\..\..\..\..\..\temp\$(Platform)\$(Config)</DCC_DcuOutput>
128+
<DCC_DcpOutput>..\..\..\..\..\..\temp\$(Platform)\$(Config)</DCC_DcpOutput>
139129
</PropertyGroup>
140130
<PropertyGroup Condition="'$(Base_Android)'!=''">
141131
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
@@ -171,9 +161,6 @@
171161
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
172162
<EnabledSysJars>activity-1.1.0.dex.jar;annotation-1.2.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;biometric-1.1.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.1.0.dex.jar;core-runtime-2.1.0.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.2.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.2.0.dex.jar;lifecycle-runtime-2.2.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.2.0.dex.jar;lifecycle-viewmodel-savedstate-2.2.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;savedstate-1.0.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar</EnabledSysJars>
173163
</PropertyGroup>
174-
<PropertyGroup Condition="'$(Base_iOSDevice64)'!=''">
175-
<iOS_AppStore1024>$(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png</iOS_AppStore1024>
176-
</PropertyGroup>
177164
<PropertyGroup Condition="'$(Base_Win32)'!=''">
178165
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
179166
<BT_BuildType>Debug</BT_BuildType>
@@ -195,8 +182,10 @@
195182
<PropertyGroup Condition="'$(Cfg_1_Android64)'!=''">
196183
<BT_BuildType>Debug</BT_BuildType>
197184
</PropertyGroup>
198-
<PropertyGroup Condition="'$(Cfg_1_iOSDevice64)'!=''">
199-
<BT_BuildType>Debug</BT_BuildType>
185+
<PropertyGroup Condition="'$(Cfg_1_Linux64)'!=''">
186+
<Debugger_Launcher>/usr/bin/gnome-terminal -- &quot;%debuggee%&quot;</Debugger_Launcher>
187+
<Manifest_File>(None)</Manifest_File>
188+
<AppDPIAwarenessMode>none</AppDPIAwarenessMode>
200189
</PropertyGroup>
201190
<PropertyGroup Condition="'$(Cfg_1_OSX64)'!=''">
202191
<BT_BuildType>Debug</BT_BuildType>
@@ -226,9 +215,6 @@
226215
<PropertyGroup Condition="'$(Cfg_2_Android64)'!=''">
227216
<BT_BuildType>Debug</BT_BuildType>
228217
</PropertyGroup>
229-
<PropertyGroup Condition="'$(Cfg_2_iOSDevice64)'!=''">
230-
<BT_BuildType>Debug</BT_BuildType>
231-
</PropertyGroup>
232218
<PropertyGroup Condition="'$(Cfg_2_OSX64)'!=''">
233219
<BT_BuildType>Debug</BT_BuildType>
234220
</PropertyGroup>
@@ -286,8 +272,6 @@
286272
<Platforms>
287273
<Platform value="Android">False</Platform>
288274
<Platform value="Android64">True</Platform>
289-
<Platform value="iOSDevice64">True</Platform>
290-
<Platform value="iOSSimARM64">True</Platform>
291275
<Platform value="Linux64">True</Platform>
292276
<Platform value="OSX64">True</Platform>
293277
<Platform value="OSXARM64">True</Platform>

0 commit comments

Comments
 (0)