Skip to content

Commit 541c0e5

Browse files
committed
add readme
1 parent 404d1f0 commit 541c0e5

File tree

5 files changed

+84
-15
lines changed

5 files changed

+84
-15
lines changed

.github/workflows/dotnet.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: .NET
12
on:
23
push:
34
branches:
@@ -6,7 +7,8 @@ on:
67
branches:
78
- main
89

9-
name: .NET
10+
permissions:
11+
contents: read
1012

1113
env:
1214
OUTPUT_DIR: bin
@@ -26,7 +28,7 @@ jobs:
2628
# TODO: add more targets
2729
steps:
2830
- name: Checkout
29-
uses: actions/checkout@v4
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4
3032

3133
- name: Install rustup
3234
if: matrix.os == 'windows-latest'
@@ -43,7 +45,7 @@ jobs:
4345
shell: pwsh
4446

4547
- name: Upload artifacts
46-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4
4749
with:
4850
name: ${{ env.OUTPUT_DIR }}-${{ matrix.target }}
4951
path: |
@@ -63,16 +65,16 @@ jobs:
6365
NUGET_VERSION: ${{ steps.dotnet-pack.outputs.NUGET_VERSION }}
6466
steps:
6567
- name: Checkout code
66-
uses: actions/checkout@v4
68+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4
6769

6870
- name: Download x86_64-pc-windows-msvc
69-
uses: actions/download-artifact@v4
71+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4
7072
with:
7173
name: ${{ env.OUTPUT_DIR }}-x86_64-pc-windows-msvc
7274
path: bin
7375

7476
- name: Download i686-pc-windows-msvc
75-
uses: actions/download-artifact@v4
77+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4
7678
with:
7779
name: ${{ env.OUTPUT_DIR }}-i686-pc-windows-msvc
7880
path: bin
@@ -89,7 +91,7 @@ jobs:
8991
dotnet pack windows/libdatadog.csproj -p:LibDatadogBinariesOutputDir=../${{ env.OUTPUT_DIR }} -p:LibDatadogVersion=$version -o ${{ env.PACKAGES_DIR }}
9092
9193
- name: Upload package
92-
uses: actions/upload-artifact@v4
94+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
9395
with:
9496
name: ${{ env.PACKAGES_DIR }}
9597
path: ${{ env.PACKAGES_DIR }}
@@ -108,21 +110,21 @@ jobs:
108110

109111
steps:
110112
- name: Checkout code
111-
uses: actions/checkout@v4
113+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4
112114

113115
- name: Download package
114-
uses: actions/download-artifact@v4
116+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4
115117
with:
116118
name: ${{ env.PACKAGES_DIR }}
117119
path: ${{ env.PACKAGES_DIR }}
118120

119121
- name: Install .NET SDK
120-
uses: actions/setup-dotnet@v4
122+
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 #v4
121123
with:
122124
dotnet-version: 7.0.X
123125

124126
- name: Run
125127
run: |
126128
cd tests/nuget_package
127129
dotnet add nuget_package.csproj package libdatadog --version ${{ needs.pack.outputs.NUGET_VERSION }}
128-
dotnet run
130+
dotnet run

tests/nuget_package/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ internal struct MaybeError
124124
{
125125
internal ErrorTag Tag;
126126
internal CharSlice Message;
127-
}
127+
}

windows/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# libdatadog
2+
3+
## About
4+
5+
This package is binary distribution of [libdatadog](https://github.com/DataDog/libdatadog). It supports both native (C/C++) and .NET projects.
6+
7+
## Getting started
8+
9+
### Native (C/C++) projects
10+
11+
For Native projects, `libdatadog` supports both static and dynamic linking. The dynamic linking is the default option. To use the static linking, you need to disable the dynamic linking by setting the msbuild property `LibDatadogDynamicLink` to `false`. Both `debug` and `release` congfiguration libraries are provided to allow better debugging experience.
12+
13+
Depending on the target platform, binaries are compied to project output directory.
14+
15+
### .NET projects
16+
17+
For .NET projects, `libdatadog` supports only dynamic linking targetting .NET Standard 2.0.
18+
19+
Depending on the target platform, binaries are copied to project output directory under `runtimes` directory as per [.NET conventions](https://learn.microsoft.com/en-us/nuget/create-packages/native-files-in-net-packages#native-assets) (`runtimes/{RID}/native`).
20+
21+
> [!IMPORTANT]
22+
> `nuget` fails to resolve the shared library if same directory is not used in the nuget package and the project output directory. Hence, only `release` configuration is supported for .NET projects.
23+
24+
## Package content
25+
26+
```
27+
libdatadog.14.3.1-ci.771.90/
28+
├── build
29+
│   ├── native
30+
│   │   ├── lib
31+
│   │   │   ├── x64
32+
│   │   │   │   ├── debug
33+
│   │   │   │   │   ├── libdatadog win-x64 shared library and pdb (debug)
34+
│   │   │   │   │   └── static
35+
│   │   │   │   │   └── libdatadog win-x64 static library (debug)
36+
│   │   │   │   └── release
37+
│   │   │   │   ├── libdatadog win-x64 shared library and pdb (release)
38+
│   │   │   │   └── static
39+
│   │   │   │   └── libdatadog win-x64 static library (release)
40+
│   │   │   └── x86
41+
│   │   │   ├── debug
42+
│   │   │   │   ├── libdatadog win-x86 shared library and pdb (debug)
43+
│   │   │   │   └── static
44+
│   │   │   │   └── libdatadog win-x86 static library (debug)
45+
│   │   │   └── release
46+
│   │   │   ├── libdatadog win-x86 shared library and pdb (release)
47+
│   │   │   └── static
48+
│   │   │   └── libdatadog win-x86 static library (release)
49+
│   │   └── libdatadog.props
50+
│   └── netstandard2.0
51+
│   └── libdatadog.props
52+
├── include
53+
│   └── native
54+
│   └── datadog
55+
│   ├── C headers
56+
└── runtimes
57+
├── win-x64
58+
│   └── native
59+
│   └── libdatadog win-x64 shared library and pdb
60+
└── win-x86
61+
└── native
62+
└── libdatadog win-x86 shared library and pdb
63+
```
64+
65+
## License
66+
67+
Apache-2.0

windows/libdatadog.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<IsPackable>true</IsPackable>
2424
</PropertyGroup>
2525
<ItemGroup>
26-
<None Include="..\README.md" Pack="true" PackagePath="\" />
26+
<None Include="README.md" Pack="true" PackagePath="\" />
2727
<None Include="..\LICENSE" Pack="true" PackagePath="\" />
2828
<None Include="libdatadog.props" Pack="true" PackagePath="build\native\libdatadog.props" />
2929

@@ -91,4 +91,4 @@
9191
Pack="true" PackagePath="runtimes\win-x86\native\datadog_profiling_ffi.pdb" />
9292
</ItemGroup>
9393

94-
</Project>
94+
</Project>

windows/libdatadog.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
Importance="high"
5151
Condition="'@(FilesToDelete)' != ''" />
5252
</Target>
53-
</Project>
53+
</Project>

0 commit comments

Comments
 (0)