Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
772 commits
Select commit Hold shift + click to select a range
ef8b997
rename kind to reason
hroederld Mar 21, 2019
5a7d31f
free rule id on detail clear if rule type
hroederld Mar 21, 2019
8f03e9c
ensure sub events correctly skip reasons
hroederld Mar 21, 2019
ba34b2e
check events capacity with >= instead of >
hroederld Mar 21, 2019
0c58aa3
operatorInFn simplification, add LD_SDK_VERSION #define
hroederld Mar 21, 2019
69e74c6
remove duplicate line
hroederld Mar 22, 2019
62c84a5
add mutex support (unused)
hroederld Mar 22, 2019
cf07cee
partial convert to use reference counting
hroederld Mar 22, 2019
ecfd9fc
update streaming tests
hroederld Mar 22, 2019
047085a
fix memoryInit (currently unsafe handling of error state)
hroederld Mar 22, 2019
6d16aca
add uthash dep
hroederld Mar 22, 2019
d9c900b
convert rest of tests to new api
hroederld Mar 22, 2019
0358617
replace segment free with segment rc decrement
hroederld Mar 22, 2019
656c245
convert allFlags store api to use reference counting
hroederld Mar 22, 2019
c98ed20
ensure prequisiteKey gets freed in details cleanup, simplify evaluati…
hroederld Mar 22, 2019
bae2e2e
fix reference count decrement
hroederld Mar 22, 2019
82f80ec
ensure subevents always get freed
hroederld Mar 22, 2019
4553f10
cleanup leaks in error conditions and generally reduce allocations
hroederld Mar 22, 2019
e7c620f
remove allocation from parse path
hroederld Mar 22, 2019
ae83d78
use new detach function instead of duplicate
hroederld Mar 22, 2019
814378b
rename FeatureCollection to FeatureCollectionItem
hroederld Mar 25, 2019
10db64a
convert ldstore interface to use static strings instead of enum
hroederld Mar 25, 2019
c7b70de
update streaming to rename flags to features
hroederld Mar 25, 2019
600733b
replace two instance of free with LDFree
hroederld Mar 25, 2019
88c7ca9
replace two unrelated instances of malloc with LDAlloc
hroederld Mar 25, 2019
3b184f8
rename flags to features in polling update
hroederld Mar 25, 2019
1effcdb
DRY up with featureKindToString
hroederld Mar 25, 2019
f7973c6
more logically organize ldstore
hroederld Mar 25, 2019
b5c88d6
update doxygen header for RC related functions
hroederld Mar 25, 2019
3bee424
correctly return NULL when RC lock construction fails
hroederld Mar 25, 2019
115e145
add sanity check assertion that current reference count is > 0 when d…
hroederld Mar 25, 2019
c686b9a
make some routines static and some parameters const
hroederld Mar 25, 2019
ea51017
replace free with LDFree in store destroy
hroederld Mar 25, 2019
7e50771
add const to ptr for addHidden
hroederld Mar 26, 2019
f64845a
rename and make jsonrc destruction static
hroederld Mar 26, 2019
2ac8b08
makeFeatureCollection -> makeFeatureCollectionItem, replacementcollec…
hroederld Mar 26, 2019
39ca5e3
Merge pull request #7 from launchdarkly/hr/refcount
hroederld Mar 27, 2019
359d26d
1.0.0 beta.1 (#8)
hroederld Mar 27, 2019
a08df4f
Merge github.com:launchdarkly/c-client-server-side
hroederld Mar 28, 2019
aef0203
update readme to refer to better distinguish between server-side and …
bwoskow-ld Mar 28, 2019
0cdb5dd
Merge pull request #10 from launchdarkly/bw/readme-updates
bwoskow-ld Mar 28, 2019
1a7c009
Merge github.com:launchdarkly/c-client-server-side
hroederld Mar 28, 2019
97bac37
Add jitter to networking backoff (#9)
hroederld Mar 28, 2019
ad113ab
Remove GMP dep (#12)
hroederld Apr 1, 2019
9f60af9
Add support for debugEventsUntilDate (#11)
hroederld Apr 2, 2019
5c93f25
Windows C++ compatibility (#13)
hroederld Apr 3, 2019
9cfae31
Window specific time parsing (#14)
hroederld Apr 4, 2019
ac06b3a
Windows CI (#15)
hroederld Apr 5, 2019
9d46358
Dynamic library symbol hygiene (#16)
hroederld Apr 5, 2019
618bb3b
Prepare 1.0.0 beta.2 (#17)
hroederld Apr 5, 2019
584a375
Merge branch 'master' of github.com:launchdarkly/c-client-server-side
hroederld Apr 5, 2019
9924f89
add back ifdef cplusplus (#18)
hroederld Apr 5, 2019
c92c603
Merge branch 'master' of github.com:launchdarkly/c-client-server-side
hroederld Apr 5, 2019
202e531
Extra build documentation (#19)
hroederld Apr 8, 2019
8b47c0c
Merge branch 'master' of github.com:launchdarkly/c-client-server-side
hroederld Apr 8, 2019
8f4e101
reorganize headers (#21)
hroederld Apr 26, 2019
061e5aa
Fix doxygen and add docgen infra (#22)
hroederld Apr 30, 2019
34da394
cmake cleanup (#24)
hroederld May 3, 2019
a68ed94
Complete doxygen coverage (#23)
hroederld May 3, 2019
9d07f90
applying markdown templates (#25)
bwoskow-ld May 13, 2019
3759bc8
bump version and update changelog (#26)
hroederld May 17, 2019
61aed0c
free subevents as append does not transfer ownership (#27)
hroederld Jun 11, 2019
d6fd94e
bump version and add memory leak info to changelog (#28)
hroederld Jun 11, 2019
a6c21b4
merge in public
hroederld Jun 11, 2019
0e73f2a
Merge branch 'master' of github.com:launchdarkly/c-server-sdk
hroederld Jun 11, 2019
e063402
Update to handle index events (#29)
hroederld Jun 25, 2019
7ae5129
switch to using milliseconds everywhere internally (#30)
hroederld Jun 26, 2019
c56eac1
adding a circleci badge to the readme (#31)
bwoskow-ld Jun 27, 2019
8a5f961
switch from checking for header end within size (usually one) to tota…
hroederld Jul 5, 2019
5c793f2
bump version constant, document changes, remove beta warning (#33)
hroederld Jul 5, 2019
c479a06
Merge github.com:launchdarkly/c-server-sdk
hroederld Jul 5, 2019
2fbdbd0
add /usr/local/include for osx (#34)
hroederld Jul 11, 2019
1ec7b98
bump version, append changelog (#35)
hroederld Jul 11, 2019
d1bbf58
Merge github.com:launchdarkly/c-server-sdk
hroederld Jul 11, 2019
0a555ce
Merge branch 'master' of github.com:launchdarkly/c-server-sdk
bwoskow-ld Jul 18, 2019
1f7569a
memset time struct (#36)
hroederld Jul 26, 2019
2616be0
bump version, document changes (#37)
hroederld Jul 26, 2019
b9bbca4
Merge github.com:launchdarkly/c-server-sdk
hroederld Jul 26, 2019
58012df
update type comparison to work with object OR array detection (#38)
hroederld Sep 6, 2019
981412d
Experimention track metric (#40)
hroederld Sep 25, 2019
323fda8
prepare 1.1.0
hroederld Sep 26, 2019
e4ebf0a
bump changelog date before release
hroederld Sep 26, 2019
7abce0b
Fix rule match explanation encoding (#42)
hroederld Sep 26, 2019
bb8773c
Merge github.com:launchdarkly/c-server-sdk
hroederld Sep 26, 2019
2e7c85a
Merge branch 'master' of github.com:launchdarkly/c-server-sdk
bwoskow-ld Oct 11, 2019
6bfe2de
Double to int variation tests, and document behavior. (#43)
hroederld Oct 22, 2019
d1804af
Merge github.com:launchdarkly/c-server-sdk
hroederld Oct 23, 2019
93937e7
Merge branch 'master' of github.com:launchdarkly/c-server-sdk
bwoskow-ld Nov 7, 2019
7228635
[ch49806] redis store (#44)
hroederld Nov 15, 2019
a6db075
[ch58854] Update cJSON to 1.7.12
hroederld Dec 11, 2019
fe02635
[ch57214] Store API v2 (#46)
hroederld Dec 23, 2019
7939622
[ch55939] add Releaser scripts, CircleCI Windows build, use custom Do…
eli-darkly Dec 23, 2019
46c1778
[ch59994] add code coverage flag
hroederld Dec 23, 2019
51fcfbb
[ch43307] put user in last bucket for a bucketing fallthrough
hroederld Dec 26, 2019
7cad004
[ch60038] dont assert on polling put failure
hroederld Dec 26, 2019
74b2f13
[ch54986] old osx clock gettime (#51)
hroederld Dec 26, 2019
e1cf4ee
[ch60053] fix redis race detection
hroederld Dec 30, 2019
79eefbc
[ch61092] Event payload ID. (#54)
hroederld Jan 14, 2020
07bbf01
[ch60589] Cache external store values (#53)
hroederld Jan 16, 2020
1aa97e9
[ch61935] Releaser for redis (#55)
hroederld Jan 17, 2020
575ff0c
merge from public after release
LaunchDarklyCI Jan 22, 2020
81f10f3
Merge github.com:launchdarkly/c-server-sdk
hroederld Feb 26, 2020
5c65559
[ch69694] reconnect consistency (#57)
hroederld Mar 25, 2020
c10b08f
[ch69694] streaming status codes (#58)
hroederld Mar 27, 2020
cdf8fbc
merge from public after release
LaunchDarklyCI Mar 31, 2020
78b1184
[ch71379] create more ideal concurrency h (#59)
hroederld Apr 1, 2020
5fc1f5a
[ch72167] api level assert (#61)
hroederld Apr 3, 2020
1721d82
[ch72078] remove higher stack assertions for system ops (#60)
hroederld Apr 3, 2020
c5a8350
[ch72307] optional asserts compilation (#62)
hroederld Apr 5, 2020
f29d338
[ch72310] cmake cleanup (#63)
hroederld Apr 5, 2020
f29e0e8
[ch72310] cleanup redis cmake
hroederld Apr 5, 2020
75f20be
[ch72763] correct find package (#65)
hroederld Apr 8, 2020
3722ccb
[ch72838] detangle headers (#66)
hroederld Apr 8, 2020
5cf420b
[ch73235] enable mock concurrency (#68)
hroederld Apr 13, 2020
e871222
[ch72863] event processing cleanup and optimization (#67)
hroederld Apr 14, 2020
aad652e
[ch73704] dedup test utils (#69)
hroederld Apr 15, 2020
42d546a
[ch73828] null user key ban (#70)
hroederld Apr 15, 2020
83d00b9
[ch73828] null user key fix (#71)
hroederld Apr 15, 2020
8f706a5
[ch73236] detach sse (#72)
hroederld Apr 17, 2020
d88c3db
[ch73698] mock backend server and polling test (#73)
hroederld Apr 21, 2020
2a27aa5
[ch74213] release bundle (#75)
hroederld Apr 26, 2020
99f0605
[ch73853] start of defensive mode (#74)
hroederld Apr 26, 2020
15826b6
[ch75034] enable and fix more warnings (#76)
hroederld Apr 26, 2020
782d374
[ch73853] add logging to existing defensive checks (#77)
hroederld Apr 26, 2020
df9e6c3
[ch75137] double for large milliseconds (#85)
hroederld Apr 28, 2020
9fffd98
[ch75136] c89 fix for loop initialization
hroederld Apr 28, 2020
f4e0cdd
[ch75131] add time.h on posix
hroederld Apr 28, 2020
ae23499
[ch75126] Fix event generation for NULL fallback
hroederld Apr 28, 2020
16b0e91
[ch73853] remove extra error channels
hroederld Apr 28, 2020
70becd6
[ch73853] Defensive JSON (#78)
hroederld Apr 28, 2020
ac1422e
[ch73853] enable defensive api by default (#81)
hroederld Apr 28, 2020
f4918da
[ch75201] custom bool type for public api (#86)
hroederld Apr 28, 2020
4932e47
[ch74995] null fallback tests (#87)
hroederld Apr 29, 2020
e61e2cb
[ch74995] basic stream mock (#88)
hroederld Apr 29, 2020
4ff7688
undelete docs directory (#91)
hroederld Apr 30, 2020
8c2fd44
Merge github.com:launchdarkly/c-server-sdk
hroederld Apr 30, 2020
3067628
Merge branch 'master' of github.com:launchdarkly/c-server-sdk-private
hroederld Apr 30, 2020
6c0e202
merge from public after release
LaunchDarklyCI Apr 30, 2020
b6aae2a
[ch76282] wrapper metadata config (#92)
hroederld May 12, 2020
77dc800
merge from public after release
LaunchDarklyCI May 12, 2020
d3d0ff4
[ch78853] Add 32 bit linux CI (#93)
hroederld Jun 5, 2020
9d29115
[ch80280] usleep error (#94)
hroederld Jun 18, 2020
2979e35
merge from public after release
LaunchDarklyCI Jun 18, 2020
460b3ed
[ch80280] skip sleep on EINTR
hroederld Jun 19, 2020
236af00
merge from public after release
LaunchDarklyCI Jun 19, 2020
8c1fc5b
[ch80617] c sdk common (#96)
hroederld Jun 22, 2020
3b51258
[ch80617] add common headers to doxygen
hroederld Jun 22, 2020
78de393
[ch81023] accept header (#98)
hroederld Jun 25, 2020
9d43c96
merge from public after release
LaunchDarklyCI Jun 25, 2020
14accbb
[ch81049] add common/include to public header export
hroederld Jun 30, 2020
94dd087
[ch81355] fix experimentation events (#100)
hroederld Jul 1, 2020
038dec6
merge from public after release
LaunchDarklyCI Jul 2, 2020
006b5ce
[ch94759] bump xcode to next circleci supported version
hroederld Nov 17, 2020
28efd98
[ch94757] cleanup staticGetValue after use in test #101
hroederld Nov 17, 2020
b58a9fb
[ch94758] run valgrind memcheck in linux ci (#103)
hroederld Nov 17, 2020
c1a53ad
[ch94776] fix helgrind warning #104
hroederld Nov 18, 2020
c5272e4
[ch94759] releaser upgrade xcode version #105
hroederld Nov 18, 2020
4344aa4
[ch95201] Update to use LDBasicLoggerThreadSafe in tests (#106)
hroederld Nov 23, 2020
fa6e7b0
merge from public after release
LaunchDarklyCI Nov 24, 2020
6bbc2ee
[ch97247] more coverage and bug fixes (#107)
hroederld Jan 8, 2021
57837a6
[ch97472] use Findhiredis (#108)
hroederld Jan 13, 2021
65acae2
merge from public after release
LaunchDarklyCI Jan 14, 2021
6c204a5
[ch99403] Add Alias method (#110)
hroederld Jan 27, 2021
d37fa42
merge from public after release
LaunchDarklyCI Jan 28, 2021
9d13969
[ch99260] Add O3 build and cleanup warnings (#109)
hroederld Jan 29, 2021
77b20b3
Update c-sdk-common (#111)
hroederld Jan 31, 2021
d66fa39
Removed the guides link
bwoskow-ld Feb 3, 2021
1e391f1
[ch100420] Hook in c-sdk-common LDUser (#112)
hroederld Feb 7, 2021
a37819e
run clang format (#113)
hroederld Feb 7, 2021
c97e586
Forgotten clang-format and C standard audit. (#114)
hroederld Feb 8, 2021
f501486
minor merge conflict in public contribution
hroederld May 13, 2021
f17458c
merge from public after release
LaunchDarklyCI May 13, 2021
39cf780
[ch109467] fix bucketBy (#115)
hroederld May 26, 2021
10e6aea
merge from public after release
LaunchDarklyCI May 26, 2021
cc1652f
[ch111014] remove stdbool.h references (#117)
hroederld Jun 9, 2021
a90bd1d
merge from public after release
LaunchDarklyCI Jun 9, 2021
8ac7180
[ch111014] Ensure modern clang passes (#118)
hroederld Jun 11, 2021
eeb6a55
[ch111482] fix OSX CI (#119)
hroederld Jun 14, 2021
4012e9d
[ch111482] fix osx releaser (#120)
hroederld Jun 14, 2021
89d5c4e
merge from public after release
LaunchDarklyCI Jun 14, 2021
c46de88
merge experimentation allocation changes
hroederld Jun 20, 2021
7405cc1
merge from public after release
LaunchDarklyCI Jun 21, 2021
e7dbe0c
[ch114396] improve flag / segment validation (#121)
hroederld Jul 20, 2021
1802b1e
merge from public after release
Jul 21, 2021
5b2497e
ch121458 Ensure that LDAllFlags returns all valid flags in the case w…
kinyoklion Sep 9, 2021
8203b89
ch121458 Handle the case where there are not any flags in the store.
kinyoklion Sep 9, 2021
22616d5
ch121458 Remove unused eval status.
kinyoklion Sep 9, 2021
6f34436
ch121458 Run test before shutting down logger.
kinyoklion Sep 10, 2021
32da843
ch121458 Address style feedback. Space after if.
kinyoklion Sep 10, 2021
20d7666
ch121458 Check that result is empty in malformed fallthrough case.
kinyoklion Sep 10, 2021
dc85aa4
ch121458 Allow for the rollout kind to be empty.
kinyoklion Sep 10, 2021
f7de8f4
ch121458 Summarize events with EVAL_SCHEMA errors.
kinyoklion Sep 13, 2021
0c357be
ch121458 Re-enable tests. Fix formatting.
kinyoklion Sep 13, 2021
4e04b92
ch121458 Remove comment about updating test.
kinyoklion Sep 13, 2021
9b61a57
Remove duplicate line.
kinyoklion Sep 14, 2021
01cb21b
Merge pull request #122 from launchdarkly/rlamb/ch121458/LDAllFlags-s…
kinyoklion Sep 14, 2021
716805f
ch123139 Allow the c-server-sdk to build from any directory on windows.
kinyoklion Sep 17, 2021
f13cc90
Merge pull request #124 from launchdarkly/rlamb/ch123139/Allow-sdk-to…
kinyoklion Sep 17, 2021
bb260be
merge from public after release
Sep 17, 2021
fe3a302
Rlamb/ch122102/add unit testing framework (#123)
kinyoklion Sep 20, 2021
0caf25e
ch123169 Add unit test reporting for circleci. (#125)
kinyoklion Sep 21, 2021
bf8b54a
Updates docs URLs
ember-stevens Sep 26, 2021
d0c2669
Merge pull request #126 from launchdarkly/emberstevens/sc-118589/url-…
ember-stevens Sep 27, 2021
e2924be
ch124211 Make google test makefile not relative. (#127)
kinyoklion Sep 28, 2021
4e9ab6b
update Releaser config and scripts to v2 model (#128)
eli-darkly Oct 12, 2021
0429973
sc-126967 Build for windows in release. (#129)
kinyoklion Oct 18, 2021
4c73636
merge from public after release
Oct 19, 2021
93476bc
SC-130264: Update PCRE download URL [Windows] (#131)
cwaldren-ld Nov 8, 2021
620f658
Remove unused headers from various source files (#130)
cwaldren-ld Nov 9, 2021
2b99d74
Fix batch of spelling issues (#133)
cwaldren-ld Dec 13, 2021
f4da52f
merge from public after release
Dec 14, 2021
625b65c
Add dedicated valgrind & helgrind analysis jobs (#136)
cwaldren-ld Jan 5, 2022
32ee854
Minor updates to language (#140)
cwaldren-ld Jan 8, 2022
2339e93
Fix language 'API Interface' -> 'API' (#141)
cwaldren-ld Jan 8, 2022
6a5fb4d
SC-121933: Add additional JSON helpers (#142)
cwaldren-ld Jan 14, 2022
68ad987
merge from public after release
Jan 20, 2022
d596053
SC-131685: Add LDVersion API (#145)
cwaldren-ld Jan 25, 2022
8353562
SC-121933: Add LDAllFlagsState API (#143)
cwaldren-ld Feb 1, 2022
f1e034a
Use CircleCI macOS Gen2 resource class. (#148)
gwhelanLD Feb 4, 2022
f22abba
SC-138968: SDK Test Harness contract implementation (#146)
cwaldren-ld Feb 14, 2022
862f242
Adds singleton info (#153)
ember-stevens Feb 15, 2022
b44e3f3
Allow LDJSONVariation to accept any type (#149)
cwaldren-ld Feb 17, 2022
0a363b1
Do not return variation index when user requests wrong flag type (#152)
cwaldren-ld Feb 17, 2022
670640e
Don't emit warnings when optional flag data is missing (#150)
cwaldren-ld Feb 17, 2022
02a743f
Remove trailing slash from streaming URI (#151)
cwaldren-ld Feb 17, 2022
b6e8e3b
SC-134551: Fix LDStoreInitialized double-free & add concurrency test …
cwaldren-ld Feb 23, 2022
c5d6e9e
Remove embedded nlohmann/json and replace with FetchContent (#157)
cwaldren-ld Feb 23, 2022
6c8d438
merge from public after release
Feb 23, 2022
048444c
Add new suppressions to handle v1.3 of SDK test harness (#158)
cwaldren-ld Mar 10, 2022
dcdb400
FileData source (#155)
belevy Mar 16, 2022
16f9e35
Fix AllFlagsState behavior when flag evaluation fails (#159)
cwaldren-ld Apr 12, 2022
6e84dad
Update testharness-suppressions to handle latest additions to upstrea…
cwaldren-ld Apr 13, 2022
14891fb
Merge TestData source (#160)
cwaldren-ld Apr 15, 2022
77b8afa
Implement service-endpoints capability for contract tests (#161)
cwaldren-ld Apr 18, 2022
8657396
Increase EventProcessor's encapsulation and add some documentation (#…
cwaldren-ld Apr 18, 2022
0dd2306
Implement config option to disable analytic events (#165)
cwaldren-ld Apr 19, 2022
fe13815
Call floor() on computed milliseconds values (#167)
cwaldren-ld Apr 20, 2022
abda1ca
merge from public after release
Apr 20, 2022
b250914
Do not generate identify events for users with empty keys (#168)
cwaldren-ld Apr 21, 2022
e333b2d
Adds link (#166)
ember-stevens Apr 22, 2022
ec988b3
Update SDK contract test suppressions (#170)
cwaldren-ld Apr 27, 2022
727dcaf
Rename master to main in PR template & update c-sdk-common subtree (#…
cwaldren-ld May 3, 2022
469a247
Set private user attributes in contract-test service (#171)
cwaldren-ld May 4, 2022
3c1fc3b
Redundant index event should not be generated after identify event (#…
cwaldren-ld May 5, 2022
d53f3e0
merge from public after release
May 6, 2022
3752ed5
Rules: null user attributes should never match (#174)
cwaldren-ld May 11, 2022
fb27671
Change debugEventsUntilDate in flag model to double (#180)
cwaldren-ld May 19, 2022
1566b9c
Add file manifest to Releaser configuration (#179)
cwaldren-ld May 19, 2022
1ff1909
merge from public after release
May 26, 2022
6675008
Fetch third-party libraries using FetchContent (#178)
cwaldren-ld Jun 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,20 @@ jobs:
command: |
apt-get update -y
apt-get install -y \
gpg \
wget \
libcurl4-openssl-dev \
libpcre3-dev \
libhiredis-dev \
build-essential \
cmake \
git
- run:
name: Obtain recent 32-bit cmake from Kitware # Ubuntu repositories only contain cmake 3.10; we require >= 3.11.
command: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update -y
apt-get install -y cmake
- run:
name: Build
command: |
Expand Down
2 changes: 1 addition & 1 deletion .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repo:
jobs:
- circleCI:
linux:
image: ldcircleci/ld-c-sdk-ubuntu:2 # defined in sdks-ci-docker project
image: ldcircleci/ld-c-sdk-ubuntu:3 # defined in sdks-ci-docker project
env:
LD_LIBRARY_FILE_PREFIX: linux-gcc-64bit
- circleCI:
Expand Down
96 changes: 96 additions & 0 deletions CMakeFiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
## 3rd Party Dependency Strategy

Dependency management for the `c-server-sdk` is complicated by a few factors:
- The codebase for the SDK is written in C89 style
- Many libraries that could be of use are written in C99
- Libraries may use a variety of build systems, be hosted in a variety of places, using a variety of protocols.

Therefore, a flexible approach is necessary.

## History

The `third-party` directory was previously host to a collection of single-purpose C libraries, with patches
applied directly to source.

Additional system-level packages were found using cmake's `find_package()`, while other libraries were pulled in via
cmake's `FetchContent`.

As of the commit that introduced this README, the dependencies living in `third-party` have been removed
in favor of `FetchContent`. The historical patches made directly to source have been extracted into diffs that can be applied
on top of the downloaded sources.


## Strategy 1: find_package()

See: `FindXXX.cmake`


The `CURL` and `PCRE` packages are found on the host system via cmake Find Modules.

`FindCURL` is [distributed with cmake](https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html),
whereas `FindPCRE` is distributed with this SDK.

## Strategy 2: FetchContent

See: `XXX.cmake`

The SDK utilizes a collection of focused 3rd party C libraries. Some of these need to be patched
to be useful for the SDK.

These libraries are downloaded via cmake's `FetchContent` capability, which was introduced
in cmake 3.11.

The `FetchContent_MakeAvailable` was introduced in cmake 3.14. This command is convenient for use with
projects supporting cmake, as it exposes those projects' targets,
significantly reducing `CMakeLists.txt` boilerplate.

Most of the libraries used by the SDK do not support cmake, so the `XXX.cmake` files
in this repo need to setup the targets manually. If the upstream repos provided such targets, it would be
possible to remove that boilerplate in favor of `FetchContent_MakeAvailable`.

Therefore, cmake 3.11 is sufficient for the time being.

For reference:
- Ubuntu 18.04 ships with cmake 3.10
- Ubuntu 20.04 ships with cmake 3.16

Recent cmake versions can be obtained directly from [Kitware](https://cmake.org/download/).

## Updating dependencies

To upgrade one of the dependencies here, update the `GIT_TAG` hash.

Note: use a hash, not a tag - tags are not immutable.

Problem: cmake errors when changing the `GIT_TAG`.

Solution: remove build directory and rerun cmake. Because the `UPDATE_COMMAND` is set to `""`, cmake
won't be able to update the dependency when you modify the tag, and instead it should be fetched again. See below.

## Patching dependencies

The libraries are patched using diffs found in the `patches` directory.

These patches were extracted from the vendored version of these libraries by comparison with the upstream
upstream repos.

If the upstream repo changes due to an update of `GIT_TAG`, the patch may need to be regenerated.

The `PATCH_COMMAND` step in `FetchContent_Declare` will fail if applied more than once to the downloaded sources
(since the patch has already been applied.)
This command was intended by cmake authors to be used for patching artifacts, rather than git repos, so
this usage is inherently fragile.

To suppress the errors that would otherwise be caused by applying the patches multiple times
whenever cmake reruns, the `UPDATE_COMMAND` is set to `""` - meaning disabled. This in turn should disable
the patch step from running again after its initial run.

A better solution would be to maintain dedicated forks of each repository, such that `FetchContent` can obtain
the source directly without patching.

There are various bugs/race-conditions in the interaction of `FetchContent` and `ExternalProject` (implementation of `FetchContent`)
which may cause spurious failures in CI. It remains to be seen how much of a problem this will be, and it may be solved
by upgrading the cmake version on all hosts.



17 changes: 17 additions & 0 deletions CMakeFiles/hexify.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FetchContent_Declare(hexify
GIT_REPOSITORY https://github.com/pepaslabs/hexify.c
GIT_TAG "f823bd619f73584a75829cc1e44a532f5e09336e"
CONFIGURE_COMMAND ""
UPDATE_COMMAND "" # patching will fail if applied more than once; disable updates.
PATCH_COMMAND git apply "${PROJECT_SOURCE_DIR}/patches/hexify.patch"
)

FetchContent_GetProperties(hexify)
if(NOT hexify_POPULATED)
FetchContent_Populate(hexify)
endif()

add_library(hexify STATIC ${hexify_SOURCE_DIR}/hexify.c)
target_include_directories(hexify PUBLIC ${hexify_SOURCE_DIR})


Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
cmake_minimum_required(VERSION 3.10)

project(httplib-download NONE)

set(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF)
set(HTTPLIB_COMPILE ON)

include(ExternalProject)
ExternalProject_Add(httplib
FetchContent_Declare(httplib
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
GIT_TAG v0.10.2
SOURCE_DIR "${CMAKE_BINARY_DIR}/httplib-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/httplib-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
)

FetchContent_MakeAvailable(httplib)
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ FetchContent_Declare(json
URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz
)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(json)
17 changes: 17 additions & 0 deletions CMakeFiles/semver.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FetchContent_Declare(semver
GIT_REPOSITORY https://github.com/h2non/semver.c
GIT_TAG "bd1db234a68f305ed10268bd023df1ad672061d7"
CONFIGURE_COMMAND ""
UPDATE_COMMAND "" # patching will fail if applied more than once; disable updates.
PATCH_COMMAND git apply "${PROJECT_SOURCE_DIR}/patches/semver.patch"
)

FetchContent_GetProperties(semver)
if(NOT semver_POPULATED)
FetchContent_Populate(semver)
endif()

add_library(semver STATIC ${semver_SOURCE_DIR}/semver.c)
target_include_directories(semver PUBLIC ${semver_SOURCE_DIR})


13 changes: 13 additions & 0 deletions CMakeFiles/sha1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FetchContent_Declare(sha1
GIT_REPOSITORY https://github.com/clibs/sha1
GIT_TAG "fa1d96ec293d2968791603548125e3274bd6b472"
CONFIGURE_COMMAND ""
)

FetchContent_GetProperties(sha1)
if(NOT sha1_POPULATED)
FetchContent_Populate(sha1)
endif()

add_library(sha1 STATIC ${sha1_SOURCE_DIR}/sha1.c)
target_include_directories(sha1 PUBLIC ${sha1_SOURCE_DIR})
20 changes: 20 additions & 0 deletions CMakeFiles/timestamp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FetchContent_Declare(timestamp
GIT_REPOSITORY https://github.com/chansen/c-timestamp
GIT_TAG "b205c407ae6680d23d74359ac00444b80989792f"
CONFIGURE_COMMAND ""
UPDATE_COMMAND "" # patching will fail if applied more than once; disable updates.
PATCH_COMMAND git apply "${PROJECT_SOURCE_DIR}/patches/timestamp.patch"
)

FetchContent_GetProperties(timestamp)
if(NOT timestamp_POPULATED)
FetchContent_Populate(timestamp)
endif()

add_library(timestamp STATIC
${timestamp_SOURCE_DIR}/timestamp_compare.c
${timestamp_SOURCE_DIR}/timestamp_parse.c
)
target_include_directories(timestamp PUBLIC ${timestamp_SOURCE_DIR})


15 changes: 15 additions & 0 deletions CMakeFiles/uthash.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FetchContent_Declare(uthash
URL https://github.com/troydhanson/uthash/archive/v2.3.0.tar.gz
URL_HASH SHA256=e10382ab75518bad8319eb922ad04f907cb20cccb451a3aa980c9d005e661acc
CONFIGURE_COMMAND ""
)

FetchContent_GetProperties(uthash)
if(NOT uthash_POPULATED)
FetchContent_Populate(uthash)
endif()

add_library(uthash INTERFACE)
target_include_directories(uthash INTERFACE ${uthash_SOURCE_DIR}/src)


36 changes: 31 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.11)

project(ldserverapi)


include(FetchContent)

include(CMakeFiles/uthash.cmake)
include(CMakeFiles/hexify.cmake)
include(CMakeFiles/semver.cmake)
include(CMakeFiles/sha1.cmake)
include(CMakeFiles/timestamp.cmake)


include(CTest)



if(BUILD_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
configure_file(external/googletest/CMakeLists.txt.in
Expand Down Expand Up @@ -35,6 +47,7 @@ if (COVERAGE)
setup_target_for_coverage_gcovr_html(NAME coverage)
endif (COVERAGE)


find_package(CURL REQUIRED)
find_package(PCRE REQUIRED)

Expand All @@ -44,7 +57,6 @@ endif()

set(LD_INCLUDE_PATHS
"src"
"third-party/include"
"c-sdk-common/include"
"c-sdk-common/src"
${CURL_INCLUDE_DIR}
Expand Down Expand Up @@ -73,7 +85,16 @@ set(LD_LIBRARIES ${LD_LIBRARIES} ${CURL_LIBRARIES} ${PCRE_LIBRARIES})

add_library(ldserverapi ${SOURCES})

target_link_libraries(ldserverapi PRIVATE ${LD_LIBRARIES})

target_link_libraries(ldserverapi
PRIVATE
uthash
hexify
semver
sha1
timestamp
${LD_LIBRARIES}
)

target_include_directories(ldserverapi
PUBLIC "include"
Expand Down Expand Up @@ -141,12 +162,17 @@ if(BUILD_TESTING)

add_library(test-utils STATIC ${TEST_UTILS_SRC})

target_link_libraries(test-utils ldserverapi)
target_link_libraries(test-utils PRIVATE ldserverapi )

target_include_directories(test-utils
PUBLIC ${LD_INCLUDE_PATHS}
PUBLIC
"test-utils/include"
"c-sdk-common/test-utils/include"
$<TARGET_PROPERTY:ldserverapi,INCLUDE_DIRECTORIES> # Some of the internal headers of ldserverapi
# include 3rd party dependencies, which are not part of the public interface of the SDK. Therefore
# any test code that imports these internal headers, for testing purposes, will need access to those
# 3rd party includes. The INCLUDE_DIRECTORIES property of target ldserverapi includes both the public
# and private headers, so propagate them here.
)

target_compile_definitions(test-utils
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,41 @@ This version of the LaunchDarkly SDK is compatible with POSIX environments (Linu

Download a release archive from the [GitHub Releases](https://github.com/launchdarkly/c-server-sdk/releases) for use in your project. Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/c-c--#getting-started) for complete instructions on getting started with using the SDK.

## CMake Compatability

Currently, the minimum required version of CMake necessary to build the SDK is 3.11.

At configuration time, CMake will download various 3rd party dependencies of the SDK from remote locations.

Other dependencies must be present on the build host:
- `CURL` (`FindPackage(CURL)`)
- `PCRE` (`FindPackage(PCRE)`)

The project uses C++ for unit testing.
To exclude the unit tests from the build, disable via CMake option:
```
-DBUILD_TESTING=OFF
```
To enable the Redis store integration, enable via CMake option:
```
-DREDIS_STORE=ON
```

The SDK may be included in another project via `add_subdirectory`.
For example,
```
add_subdirectory(c-server-sdk)
add_executable(main main.c)
target_link_libraries(main ldserverapi)
```

It is also possible to install the SDK to a desired location, for example:
```
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/desired/install/location
cmake --build . --target install
```

## Learn more

Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/c-server-sdk-reference).
Expand Down
Loading