Skip to content

Commit 6c7ce49

Browse files
authored
Make datadog-profiling-ffi exportable in external projects. (#1050)
* Add changes to integrate profiling-ffi by source in other projects. * Add "lib" to crate-type. * Fix blazesym version in crashtracker. * Modify builder to explicitely pass the "crate-type" during compilation. * Modify build script to explicitely pass the crate-type so to avoid LTO issues. * Modify window's build scripts to use rustc to avoid LTO issues.
1 parent 7dfc1e2 commit 6c7ce49

File tree

9 files changed

+323
-41
lines changed

9 files changed

+323
-41
lines changed

Cargo.lock

Lines changed: 23 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE-3rdparty.yml

Lines changed: 236 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24747,7 +24747,7 @@ third_party_libraries:
2474724747
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2474824748

2474924749
- package_name: serde
24750-
package_version: 1.0.214
24750+
package_version: 1.0.219
2475124751
repository: https://github.com/serde-rs/serde
2475224752
license: MIT OR Apache-2.0
2475324753
licenses:
@@ -25163,7 +25163,7 @@ third_party_libraries:
2516325163

2516425164
END OF TERMS AND CONDITIONS
2516525165
- package_name: serde_derive
25166-
package_version: 1.0.214
25166+
package_version: 1.0.219
2516725167
repository: https://github.com/serde-rs/serde
2516825168
license: MIT OR Apache-2.0
2516925169
licenses:
@@ -31088,7 +31088,7 @@ third_party_libraries:
3108831088
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3108931089
SOFTWARE.
3109031090
- package_name: toml
31091-
package_version: 0.8.19
31091+
package_version: 0.8.22
3109231092
repository: https://github.com/toml-rs/toml
3109331093
license: MIT OR Apache-2.0
3109431094
licenses:
@@ -31318,7 +31318,7 @@ third_party_libraries:
3131831318
limitations under the License.
3131931319

3132031320
- package_name: toml_datetime
31321-
package_version: 0.6.8
31321+
package_version: 0.6.9
3132231322
repository: https://github.com/toml-rs/toml
3132331323
license: MIT OR Apache-2.0
3132431324
licenses:
@@ -31548,7 +31548,237 @@ third_party_libraries:
3154831548
limitations under the License.
3154931549

3155031550
- package_name: toml_edit
31551-
package_version: 0.22.22
31551+
package_version: 0.22.26
31552+
repository: https://github.com/toml-rs/toml
31553+
license: MIT OR Apache-2.0
31554+
licenses:
31555+
- license: MIT
31556+
text: |
31557+
Copyright (c) Individual contributors
31558+
31559+
Permission is hereby granted, free of charge, to any person obtaining a copy
31560+
of this software and associated documentation files (the "Software"), to deal
31561+
in the Software without restriction, including without limitation the rights
31562+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31563+
copies of the Software, and to permit persons to whom the Software is
31564+
furnished to do so, subject to the following conditions:
31565+
31566+
The above copyright notice and this permission notice shall be included in all
31567+
copies or substantial portions of the Software.
31568+
31569+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31570+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31571+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31572+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31573+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31574+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31575+
SOFTWARE.
31576+
- license: Apache-2.0
31577+
text: |2+
31578+
Apache License
31579+
Version 2.0, January 2004
31580+
http://www.apache.org/licenses/
31581+
31582+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
31583+
31584+
1. Definitions.
31585+
31586+
"License" shall mean the terms and conditions for use, reproduction,
31587+
and distribution as defined by Sections 1 through 9 of this document.
31588+
31589+
"Licensor" shall mean the copyright owner or entity authorized by
31590+
the copyright owner that is granting the License.
31591+
31592+
"Legal Entity" shall mean the union of the acting entity and all
31593+
other entities that control, are controlled by, or are under common
31594+
control with that entity. For the purposes of this definition,
31595+
"control" means (i) the power, direct or indirect, to cause the
31596+
direction or management of such entity, whether by contract or
31597+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
31598+
outstanding shares, or (iii) beneficial ownership of such entity.
31599+
31600+
"You" (or "Your") shall mean an individual or Legal Entity
31601+
exercising permissions granted by this License.
31602+
31603+
"Source" form shall mean the preferred form for making modifications,
31604+
including but not limited to software source code, documentation
31605+
source, and configuration files.
31606+
31607+
"Object" form shall mean any form resulting from mechanical
31608+
transformation or translation of a Source form, including but
31609+
not limited to compiled object code, generated documentation,
31610+
and conversions to other media types.
31611+
31612+
"Work" shall mean the work of authorship, whether in Source or
31613+
Object form, made available under the License, as indicated by a
31614+
copyright notice that is included in or attached to the work
31615+
(an example is provided in the Appendix below).
31616+
31617+
"Derivative Works" shall mean any work, whether in Source or Object
31618+
form, that is based on (or derived from) the Work and for which the
31619+
editorial revisions, annotations, elaborations, or other modifications
31620+
represent, as a whole, an original work of authorship. For the purposes
31621+
of this License, Derivative Works shall not include works that remain
31622+
separable from, or merely link (or bind by name) to the interfaces of,
31623+
the Work and Derivative Works thereof.
31624+
31625+
"Contribution" shall mean any work of authorship, including
31626+
the original version of the Work and any modifications or additions
31627+
to that Work or Derivative Works thereof, that is intentionally
31628+
submitted to Licensor for inclusion in the Work by the copyright owner
31629+
or by an individual or Legal Entity authorized to submit on behalf of
31630+
the copyright owner. For the purposes of this definition, "submitted"
31631+
means any form of electronic, verbal, or written communication sent
31632+
to the Licensor or its representatives, including but not limited to
31633+
communication on electronic mailing lists, source code control systems,
31634+
and issue tracking systems that are managed by, or on behalf of, the
31635+
Licensor for the purpose of discussing and improving the Work, but
31636+
excluding communication that is conspicuously marked or otherwise
31637+
designated in writing by the copyright owner as "Not a Contribution."
31638+
31639+
"Contributor" shall mean Licensor and any individual or Legal Entity
31640+
on behalf of whom a Contribution has been received by Licensor and
31641+
subsequently incorporated within the Work.
31642+
31643+
2. Grant of Copyright License. Subject to the terms and conditions of
31644+
this License, each Contributor hereby grants to You a perpetual,
31645+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
31646+
copyright license to reproduce, prepare Derivative Works of,
31647+
publicly display, publicly perform, sublicense, and distribute the
31648+
Work and such Derivative Works in Source or Object form.
31649+
31650+
3. Grant of Patent License. Subject to the terms and conditions of
31651+
this License, each Contributor hereby grants to You a perpetual,
31652+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
31653+
(except as stated in this section) patent license to make, have made,
31654+
use, offer to sell, sell, import, and otherwise transfer the Work,
31655+
where such license applies only to those patent claims licensable
31656+
by such Contributor that are necessarily infringed by their
31657+
Contribution(s) alone or by combination of their Contribution(s)
31658+
with the Work to which such Contribution(s) was submitted. If You
31659+
institute patent litigation against any entity (including a
31660+
cross-claim or counterclaim in a lawsuit) alleging that the Work
31661+
or a Contribution incorporated within the Work constitutes direct
31662+
or contributory patent infringement, then any patent licenses
31663+
granted to You under this License for that Work shall terminate
31664+
as of the date such litigation is filed.
31665+
31666+
4. Redistribution. You may reproduce and distribute copies of the
31667+
Work or Derivative Works thereof in any medium, with or without
31668+
modifications, and in Source or Object form, provided that You
31669+
meet the following conditions:
31670+
31671+
(a) You must give any other recipients of the Work or
31672+
Derivative Works a copy of this License; and
31673+
31674+
(b) You must cause any modified files to carry prominent notices
31675+
stating that You changed the files; and
31676+
31677+
(c) You must retain, in the Source form of any Derivative Works
31678+
that You distribute, all copyright, patent, trademark, and
31679+
attribution notices from the Source form of the Work,
31680+
excluding those notices that do not pertain to any part of
31681+
the Derivative Works; and
31682+
31683+
(d) If the Work includes a "NOTICE" text file as part of its
31684+
distribution, then any Derivative Works that You distribute must
31685+
include a readable copy of the attribution notices contained
31686+
within such NOTICE file, excluding those notices that do not
31687+
pertain to any part of the Derivative Works, in at least one
31688+
of the following places: within a NOTICE text file distributed
31689+
as part of the Derivative Works; within the Source form or
31690+
documentation, if provided along with the Derivative Works; or,
31691+
within a display generated by the Derivative Works, if and
31692+
wherever such third-party notices normally appear. The contents
31693+
of the NOTICE file are for informational purposes only and
31694+
do not modify the License. You may add Your own attribution
31695+
notices within Derivative Works that You distribute, alongside
31696+
or as an addendum to the NOTICE text from the Work, provided
31697+
that such additional attribution notices cannot be construed
31698+
as modifying the License.
31699+
31700+
You may add Your own copyright statement to Your modifications and
31701+
may provide additional or different license terms and conditions
31702+
for use, reproduction, or distribution of Your modifications, or
31703+
for any such Derivative Works as a whole, provided Your use,
31704+
reproduction, and distribution of the Work otherwise complies with
31705+
the conditions stated in this License.
31706+
31707+
5. Submission of Contributions. Unless You explicitly state otherwise,
31708+
any Contribution intentionally submitted for inclusion in the Work
31709+
by You to the Licensor shall be under the terms and conditions of
31710+
this License, without any additional terms or conditions.
31711+
Notwithstanding the above, nothing herein shall supersede or modify
31712+
the terms of any separate license agreement you may have executed
31713+
with Licensor regarding such Contributions.
31714+
31715+
6. Trademarks. This License does not grant permission to use the trade
31716+
names, trademarks, service marks, or product names of the Licensor,
31717+
except as required for reasonable and customary use in describing the
31718+
origin of the Work and reproducing the content of the NOTICE file.
31719+
31720+
7. Disclaimer of Warranty. Unless required by applicable law or
31721+
agreed to in writing, Licensor provides the Work (and each
31722+
Contributor provides its Contributions) on an "AS IS" BASIS,
31723+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
31724+
implied, including, without limitation, any warranties or conditions
31725+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
31726+
PARTICULAR PURPOSE. You are solely responsible for determining the
31727+
appropriateness of using or redistributing the Work and assume any
31728+
risks associated with Your exercise of permissions under this License.
31729+
31730+
8. Limitation of Liability. In no event and under no legal theory,
31731+
whether in tort (including negligence), contract, or otherwise,
31732+
unless required by applicable law (such as deliberate and grossly
31733+
negligent acts) or agreed to in writing, shall any Contributor be
31734+
liable to You for damages, including any direct, indirect, special,
31735+
incidental, or consequential damages of any character arising as a
31736+
result of this License or out of the use or inability to use the
31737+
Work (including but not limited to damages for loss of goodwill,
31738+
work stoppage, computer failure or malfunction, or any and all
31739+
other commercial damages or losses), even if such Contributor
31740+
has been advised of the possibility of such damages.
31741+
31742+
9. Accepting Warranty or Additional Liability. While redistributing
31743+
the Work or Derivative Works thereof, You may choose to offer,
31744+
and charge a fee for, acceptance of support, warranty, indemnity,
31745+
or other liability obligations and/or rights consistent with this
31746+
License. However, in accepting such obligations, You may act only
31747+
on Your own behalf and on Your sole responsibility, not on behalf
31748+
of any other Contributor, and only if You agree to indemnify,
31749+
defend, and hold each Contributor harmless for any liability
31750+
incurred by, or claims asserted against, such Contributor by reason
31751+
of your accepting any such warranty or additional liability.
31752+
31753+
END OF TERMS AND CONDITIONS
31754+
31755+
APPENDIX: How to apply the Apache License to your work.
31756+
31757+
To apply the Apache License to your work, attach the following
31758+
boilerplate notice, with the fields enclosed by brackets "{}"
31759+
replaced with your own identifying information. (Don't include
31760+
the brackets!) The text should be enclosed in the appropriate
31761+
comment syntax for the file format. We also recommend that a
31762+
file or class name and description of purpose be included on the
31763+
same "printed page" as the copyright notice for easier
31764+
identification within third-party archives.
31765+
31766+
Copyright {yyyy} {name of copyright owner}
31767+
31768+
Licensed under the Apache License, Version 2.0 (the "License");
31769+
you may not use this file except in compliance with the License.
31770+
You may obtain a copy of the License at
31771+
31772+
http://www.apache.org/licenses/LICENSE-2.0
31773+
31774+
Unless required by applicable law or agreed to in writing, software
31775+
distributed under the License is distributed on an "AS IS" BASIS,
31776+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31777+
See the License for the specific language governing permissions and
31778+
limitations under the License.
31779+
31780+
- package_name: toml_write
31781+
package_version: 0.1.1
3155231782
repository: https://github.com/toml-rs/toml
3155331783
license: MIT OR Apache-2.0
3155431784
licenses:
@@ -46027,7 +46257,7 @@ third_party_libraries:
4602746257
See the License for the specific language governing permissions and
4602846258
limitations under the License.
4602946259
- package_name: winnow
46030-
package_version: 0.6.20
46260+
package_version: 0.7.9
4603146261
repository: https://github.com/winnow-rs/winnow
4603246262
license: MIT
4603346263
licenses:

build-profiling-ffi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ FEATURES=$(IFS=, ; echo "${FEATURES[*]}")
165165
echo "Building for features: $FEATURES"
166166

167167
# build inside the crate to use the config.toml file
168-
( cd datadog-profiling-ffi && DESTDIR="$destdir" cargo build --features $FEATURES --release --target "${target}" )
168+
( cd datadog-profiling-ffi && DESTDIR="$destdir" cargo rustc --features $FEATURES --release --target "${target}" --crate-type cdylib && DESTDIR="$destdir" cargo rustc --features $FEATURES --release --target "${target}" --crate-type staticlib)
169169

170170
# Remove _ffi suffix when copying
171171
shared_library_name="${library_prefix}datadog_profiling_ffi${shared_library_suffix}"

0 commit comments

Comments
 (0)