diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f01df0dc..365080eeb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,7 +141,7 @@ jobs: env: RUSTFLAGS: "${{ matrix.flags }}" run: | - cargo build -p builder --features profiling,telemetry,data-pipeline,symbolizer,crashtracker --release -vv + cargo run --bin release --features profiling,telemetry,data-pipeline,symbolizer,crashtracker --release -- --out $LIBDD_OUTPUT_FOLDER - name: 'Publish libdatadog' uses: actions/upload-artifact@v4 @@ -202,7 +202,7 @@ jobs: - name: Free Disk Space uses: jlumbroso/free-disk-space@v1.3.1 with: - tool-cache: false + tool-cache: true android: true dotnet: true haskell: true diff --git a/Cargo.lock b/Cargo.lock index 358a8a408..b61b6e297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -759,8 +759,7 @@ dependencies = [ "anyhow", "build_common", "cmake", - "datadog-profiling-ffi", - "ddcommon-ffi", + "pico-args", "tar", "tools", ] diff --git a/LICENSE-3rdparty.yml b/LICENSE-3rdparty.yml index 0733f20a0..d556e516f 100644 --- a/LICENSE-3rdparty.yml +++ b/LICENSE-3rdparty.yml @@ -1,4 +1,4 @@ -root_name: datadog-alloc, builder, build_common, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-ddsketch, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, ddcommon, tinybytes, dogstatsd-client, ddcommon-ffi, datadog-crashtracker-ffi, datadog-crashtracker, ddtelemetry, datadog-profiling, ddtelemetry-ffi, symbolizer-ffi, tools, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-live-debugger, datadog-live-debugger-ffi, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent +root_name: datadog-alloc, builder, build_common, tools, datadog-crashtracker, ddcommon, ddtelemetry, datadog-ddsketch, datadog-crashtracker-ffi, ddcommon-ffi, datadog-profiling, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, tinybytes, dogstatsd-client, ddtelemetry-ffi, symbolizer-ffi, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-live-debugger, datadog-live-debugger-ffi, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent third_party_libraries: - package_name: addr2line package_version: 0.24.2 @@ -6741,6 +6741,40 @@ third_party_libraries: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +- package_name: cmake + package_version: 0.1.51 + repository: https://github.com/rust-lang/cmake-rs + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + Copyright (c) 2014 Alex Crichton + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: colorchoice package_version: 1.0.3 repository: https://github.com/rust-cli/anstyle.git @@ -10825,6 +10859,40 @@ third_party_libraries: OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- package_name: filetime + package_version: 0.2.25 + repository: https://github.com/alexcrichton/filetime + license: MIT/Apache-2.0 + licenses: + - license: MIT + text: | + Copyright (c) 2014 Alex Crichton + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: flate2 package_version: 1.0.34 repository: https://github.com/rust-lang/flate2-rs @@ -18219,6 +18287,33 @@ third_party_libraries: DEALINGS IN THE SOFTWARE. - license: Apache-2.0 text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" +- package_name: pico-args + package_version: 0.5.0 + repository: https://github.com/RazrFalcon/pico-args + license: MIT + licenses: + - license: MIT + text: |+ + Copyright (c) 2019 Yevhenii Reizner + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + - package_name: pin-project package_version: 1.1.7 repository: https://github.com/taiki-e/pin-project @@ -27877,6 +27972,40 @@ third_party_libraries: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- package_name: tar + package_version: 0.4.43 + repository: https://github.com/alexcrichton/tar-rs + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + Copyright (c) 2014 Alex Crichton + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: tempfile package_version: 3.13.0 repository: https://github.com/Stebalien/tempfile @@ -41525,6 +41654,40 @@ third_party_libraries: Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. +- package_name: xattr + package_version: 1.3.1 + repository: https://github.com/Stebalien/xattr + license: MIT/Apache-2.0 + licenses: + - license: MIT + text: | + Copyright (c) 2015 Steven Allen + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: yoke package_version: 0.7.4 repository: https://github.com/unicode-org/icu4x diff --git a/builder/Cargo.toml b/builder/Cargo.toml index 526d71310..218389f28 100644 --- a/builder/Cargo.toml +++ b/builder/Cargo.toml @@ -8,22 +8,28 @@ license.workspace = true [features] default = [] -crashtracker = ["datadog-profiling-ffi?/crashtracker-receiver", "datadog-profiling-ffi?/crashtracker-collector", "datadog-profiling-ffi?/demangler"] -profiling = ["dep:datadog-profiling-ffi"] -telemetry = ["profiling", "datadog-profiling-ffi?/ddtelemetry-ffi"] -data-pipeline = ["telemetry", "datadog-profiling-ffi?/data-pipeline-ffi"] -symbolizer = ["profiling", "datadog-profiling-ffi?/symbolizer"] +crashtracker = [] +profiling = [] +telemetry = [] +data-pipeline = [] +symbolizer = [] -[build-dependencies] +[lib] +bench = false +test = false +doctest = false + + +[dependencies] anyhow = { version = "1.0" } build_common = { path = "../build-common", features = ["cbindgen"] } cmake = "0.1.50" -tools = { path = "../tools" } -ddcommon-ffi = { path = "../ddcommon-ffi" } -datadog-profiling-ffi = { path = "../profiling-ffi", optional = true, features = ["cbindgen"] } +pico-args = "0.5.0" tar = "0.4.41" +tools = { path = "../tools" } [[bin]] -name = "dummy" +name = "release" +path = "src/bin/release.rs" test = false bench = false diff --git a/builder/build/data_pipeline.rs b/builder/build/data_pipeline.rs deleted file mode 100644 index 9c3e8ad7b..000000000 --- a/builder/build/data_pipeline.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ -// SPDX-License-Identifier: Apache-2.0 - -use crate::module::Module; -use anyhow::Result; -use std::fs; -use std::path::PathBuf; -use std::rc::Rc; - -pub struct DataPipeline { - pub source_include: Rc, - pub target_include: Rc, -} - -impl Module for DataPipeline { - fn install(&self) -> Result<()> { - let origin_path: PathBuf = [&self.source_include, "data-pipeline.h"].iter().collect(); - let target_path: PathBuf = [&self.target_include, "data-pipeline.h"].iter().collect(); - - fs::copy(origin_path, target_path).expect("Failed to copy data pipeline header"); - Ok(()) - } -} diff --git a/builder/build/main.rs b/builder/build/main.rs index aeb2696fd..7e8ded92b 100644 --- a/builder/build/main.rs +++ b/builder/build/main.rs @@ -1,256 +1,28 @@ // Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 -pub mod arch; -mod common; -#[cfg(feature = "crashtracker")] -mod crashtracker; -mod module; - -#[cfg(feature = "data-pipeline")] -mod data_pipeline; - -#[cfg(feature = "profiling")] -mod profiling; - -#[cfg(feature = "symbolizer")] -mod symbolizer; - -use anyhow::Result; -use std::path::{Path, PathBuf}; -use std::process::Command; -use std::rc::Rc; -use std::{env, fs}; - -use build_common::{determine_paths, HEADER_PATH}; -use tools::headers::dedup_headers; - -use crate::common::Common; -#[cfg(feature = "crashtracker")] -use crate::crashtracker::CrashTracker; -#[cfg(feature = "data-pipeline")] -use crate::data_pipeline::DataPipeline; -#[cfg(feature = "profiling")] -use crate::profiling::Profiling; -#[cfg(feature = "symbolizer")] -use crate::symbolizer::Symbolizer; -use module::Module; - -/// [`Builder`] is a structure that holds all the information required to assemble the final -/// workspace artifact. It will manage the different modules which will be in charge of producing -/// the different binaries and source files that will be part of the artifact. The builder will -/// provide the needed information: paths, version, etc, to the different modules so they can -/// install their sub-artifacts on the target folder. -/// The target folder is set through `LIBDD_OUTPUT_FOLDER` environment variable if it is not -/// provided the default target folder will be the builder output directory. -/// -/// # Example -/// -/// ```rust -/// use crate::core::Core; -/// -/// let mut builder = Builder::new(&path, &profile, &version); -/// let core = Box::new(Core { -/// version: builder.version.clone(), -/// }); -/// builder.add_module(core); -/// builder.build()?; -/// builder.pack()?; -/// ``` -struct Builder { - modules: Vec>, - main_header: Rc, - source_inc: Rc, - source_lib: Rc, - target_dir: Rc, - target_lib: Rc, - target_include: Rc, - target_bin: Rc, - target_pkconfig: Rc, - version: Rc, -} - -impl Builder { - /// Creates a new Builder instance - /// - /// # Aguments - /// - /// * `target_dir`: artifact folder. - /// * `profile`: Release configuration: debug or release; - /// * `version`: artifact's version. - /// - /// # Returns - /// - /// A new Builder instance. - fn new(source_dir: &str, target_dir: &str, profile: &str, version: &str) -> Self { - Builder { - modules: Vec::new(), - main_header: "common.h".into(), - source_lib: (source_dir.to_string() + "/" + profile + "/deps").into(), - source_inc: (source_dir.to_string() + "/" + HEADER_PATH).into(), - target_dir: target_dir.into(), - target_lib: (target_dir.to_string() + "/lib").into(), - target_include: (target_dir.to_string() + "/" + HEADER_PATH).into(), - target_bin: (target_dir.to_string() + "/bin").into(), - target_pkconfig: (target_dir.to_string() + "/lib/pkgconfig").into(), - version: version.into(), - } - } - - /// Adds a boxed object which implements Module trait. - fn add_module(&mut self, module: Box) { - self.modules.push(module); - } - - fn create_dir_structure(&self) { - let target = Path::new(self.target_dir.as_ref()); - if fs::metadata(target).is_ok() { - fs::remove_dir_all(Path::new(self.target_dir.as_ref())) - .expect("Failed to clean preexisting target folder"); - } - fs::create_dir_all(Path::new(self.target_dir.as_ref())) - .expect("Failed to create target directory"); - fs::create_dir_all(Path::new(self.target_include.as_ref())) - .expect("Failed to create include directory"); - fs::create_dir_all(Path::new(self.target_lib.as_ref())) - .expect("Failed to create include directory"); - fs::create_dir_all(Path::new(self.target_bin.as_ref())) - .expect("Failed to create include directory"); - fs::create_dir_all(Path::new(self.target_pkconfig.as_ref())) - .expect("Failed to create include directory"); - } - - fn deduplicate_headers(&self) { - let datadog_inc_dir = Path::new(self.source_inc.as_ref()); - - let mut headers: Vec = Vec::new(); - let inc_files = fs::read_dir(datadog_inc_dir).unwrap(); - for file in inc_files.flatten() { - let name = file.file_name().into_string().unwrap(); - if name.ends_with(".h") && !name.eq("common.h") && !name.eq("blazesym.h") { - headers.push(file.path().to_string_lossy().to_string()); - } - } - - let base_header = self.source_inc.to_string() + "/" + self.main_header.as_ref(); - dedup_headers(&base_header, &headers); - } - - // TODO: maybe do this in module's build.rs - fn sanitize_libraries(&self) { - let datadog_lib_dir = Path::new(self.source_lib.as_ref()); - - let libs = fs::read_dir(datadog_lib_dir).unwrap(); - for lib in libs.flatten() { - let name = lib.file_name().into_string().unwrap(); - if name.ends_with(".so") { - arch::fix_rpath(lib.path().to_str().unwrap()); - } - } - } - - fn add_cmake(&self) { - let libs = arch::NATIVE_LIBS.to_owned(); - let output = Command::new("sed") - .arg("s/@Datadog_LIBRARIES@/".to_string() + libs.trim() + "/g") - .arg("../cmake/DatadogConfig.cmake.in") - .output() - .expect("Failed to modify cmake"); - - let cmake_path: PathBuf = [&self.target_dir, "DatadogConfig.cmake"].iter().collect(); - fs::write(cmake_path, output.stdout).expect("writing cmake file failed"); - } - - /// Builds the final artifact by going through all modules and instancing their install method. - /// - /// #Returns - /// - /// Ok(()) if success Err(_) if failure. - fn build(&self) -> Result<()> { - for module in &self.modules { - module.install()?; - } - Ok(()) - } - - /// Generate a tar file with all the intermediate artifacts generated by all the modules.k - /// - /// #Returns - /// - /// Ok(()) if success Err(_) if failure. - fn pack(&self) -> Result<()> { - let tarname = "libdatadog".to_string() + "_v" + &self.version + ".tar"; - let path: PathBuf = [self.target_dir.as_ref(), &tarname].iter().collect(); - let artifact = fs::File::create(path).expect("Failed to create tarfile"); - let mut ar = tar::Builder::new(artifact); - ar.append_dir_all("lib", self.target_lib.as_ref())?; - ar.append_dir("bin", self.target_bin.as_ref())?; - ar.append_dir_all("include/datadog", self.target_include.as_ref())?; - - ar.finish().expect("Failed to write the tarfile"); - Ok(()) - } -} - fn main() { // Rerun build script if any of the env vars change. - println!("cargo:rerun-if-env-changed=LIBDD_OUTPUT_FOLDER"); - println!("cargo:rerun-if-env-changed=PROFILE"); - - let (_, source_path) = determine_paths(); - let mut path = env::var("OUT_DIR").unwrap(); - if let Ok(libdd_path) = env::var("LIBDD_OUTPUT_FOLDER") { - path = libdd_path; - } - - let profile = env::var("PROFILE").unwrap(); - let version = env::var("CARGO_PKG_VERSION").unwrap(); - let mut builder = Builder::new(source_path.to_str().unwrap(), &path, &profile, &version); - - builder.create_dir_structure(); - builder.deduplicate_headers(); - builder.sanitize_libraries(); - builder.add_cmake(); - - // add modules based on features - builder.add_module(Box::new(Common { - source_include: builder.source_inc.clone(), - target_include: builder.target_include.clone(), - })); - - #[cfg(feature = "profiling")] - builder.add_module(Box::new(Profiling { - source_include: builder.source_inc.clone(), - source_lib: builder.source_lib.clone(), - target_include: builder.target_include.clone(), - target_lib: builder.target_lib.clone(), - target_pkconfig: builder.target_pkconfig.clone(), - version: builder.version.clone(), - })); - - #[cfg(feature = "data-pipeline")] - builder.add_module(Box::new(DataPipeline { - source_include: builder.source_inc.clone(), - target_include: builder.target_include.clone(), - })); - - #[cfg(feature = "symbolizer")] - builder.add_module(Box::new(Symbolizer { - source_include: builder.source_inc.clone(), - target_include: builder.target_include.clone(), - })); - - #[cfg(feature = "crashtracker")] - builder.add_module(Box::new(CrashTracker { - source_include: builder.source_inc.clone(), - target_include: builder.target_include.clone(), - target_dir: builder.target_dir.clone(), - })); - - // Build artifacts. - let res = builder.build(); - match res { - Ok(_) => builder.pack().unwrap(), - Err(err) => panic!("{}", format!("Building failed: {}", err)), - } + println!( + "cargo:rustc-env=TARGET={}", + std::env::var("TARGET").unwrap() + ); + println!( + "cargo:rustc-env=PROFILE={}", + std::env::var("PROFILE").unwrap() + ); + println!( + "cargo:rustc-env=OPT_LEVEL={}", + std::env::var("OPT_LEVEL").unwrap() + ); + println!("cargo:rustc-env=DEBUG={}", std::env::var("DEBUG").unwrap()); + println!( + "cargo:rustc-env=CARGO_PKG_VERSION={}", + std::env::var("CARGO_PKG_VERSION").unwrap() + ); + println!("cargo:rustc-env=HOST={}", std::env::var("HOST").unwrap()); + println!( + "cargo:rustc-env=OUT_DIR={}", + std::env::var("OUT_DIR").unwrap() + ); } diff --git a/builder/build/symbolizer.rs b/builder/build/symbolizer.rs deleted file mode 100644 index e176c0ca0..000000000 --- a/builder/build/symbolizer.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ -// SPDX-License-Identifier: Apache-2.0 - -use crate::module::Module; -use anyhow::Result; -use std::fs; -use std::path::PathBuf; -use std::rc::Rc; - -pub struct Symbolizer { - pub source_include: Rc, - pub target_include: Rc, -} - -impl Module for Symbolizer { - fn install(&self) -> Result<()> { - let origin_path: PathBuf = [&self.source_include, "blazesym.h"].iter().collect(); - let target_path: PathBuf = [&self.target_include, "blazesym.h"].iter().collect(); - - fs::copy(origin_path, target_path).expect("Failed to copy data pipeline header"); - Ok(()) - } -} diff --git a/builder/build/arch/apple.rs b/builder/src/arch/apple.rs similarity index 89% rename from builder/build/arch/apple.rs rename to builder/src/arch/apple.rs index 294411ea0..6b409aa80 100644 --- a/builder/build/arch/apple.rs +++ b/builder/src/arch/apple.rs @@ -3,6 +3,8 @@ use std::process::Command; +use std::ffi::OsStr; + pub const NATIVE_LIBS: &str = " -framework Security -framework CoreFoundation -liconv -lSystem -lresolv -lc -lm -liconv"; pub const PROF_DYNAMIC_LIB: &str = "libdatadog_profiling.dylib"; @@ -11,6 +13,7 @@ pub const PROF_DYNAMIC_LIB_FFI: &str = "libdatadog_profiling_ffi.dylib"; pub const PROF_STATIC_LIB_FFI: &str = "libdatadog_profiling_ffi.a"; pub const REMOVE_RPATH: bool = true; pub const BUILD_CRASHTRACKER: bool = true; +pub const RUSTFLAGS: [&str; 2] = ["-C", "relocation-model=pic"]; #[allow(clippy::zombie_processes)] pub fn fix_rpath(lib_path: &str) { @@ -38,3 +41,5 @@ pub fn strip_libraries(lib_path: &str) { } pub fn fix_soname(_lib_path: &str) {} + +pub fn add_additional_files(_lib_path: &str, _target_path: &OsStr) {} diff --git a/builder/build/arch/linux.rs b/builder/src/arch/linux.rs similarity index 87% rename from builder/build/arch/linux.rs rename to builder/src/arch/linux.rs index 91d9c5b20..4ad39445e 100644 --- a/builder/build/arch/linux.rs +++ b/builder/src/arch/linux.rs @@ -3,6 +3,8 @@ use std::process::Command; +use std::ffi::OsStr; + pub const NATIVE_LIBS: &str = " -ldl -lrt -lpthread -lc -lm -lrt -lpthread -lutil -ldl -lutil"; pub const PROF_DYNAMIC_LIB: &str = "libdatadog_profiling.so"; pub const PROF_STATIC_LIB: &str = "libdatadog_profiling.a"; @@ -10,15 +12,17 @@ pub const PROF_DYNAMIC_LIB_FFI: &str = "libdatadog_profiling_ffi.so"; pub const PROF_STATIC_LIB_FFI: &str = "libdatadog_profiling_ffi.a"; pub const REMOVE_RPATH: bool = false; pub const BUILD_CRASHTRACKER: bool = true; +pub const RUSTFLAGS: [&str; 2] = ["-C", "relocation-model=pic"]; -#[allow(clippy::zombie_processes)] pub fn fix_rpath(lib_path: &str) { if REMOVE_RPATH { - Command::new("patchelf") + let mut patchelf = Command::new("patchelf") .arg("--remove-rpath") .arg(lib_path) .spawn() - .expect("failed to remove rpath"); + .expect("failed to spawn patchelf"); + + patchelf.wait().expect("failed to remove rpath"); } } @@ -68,3 +72,5 @@ pub fn fix_soname(lib_path: &str) { patch_soname.wait().expect("failed to change the soname"); } + +pub fn add_additional_files(_lib_path: &str, _target_path: &OsStr) {} diff --git a/builder/build/arch/mod.rs b/builder/src/arch/mod.rs similarity index 84% rename from builder/build/arch/mod.rs rename to builder/src/arch/mod.rs index 0b903a9fb..948ffc79a 100644 --- a/builder/build/arch/mod.rs +++ b/builder/src/arch/mod.rs @@ -22,7 +22,9 @@ pub mod apple; #[cfg(target_os = "macos")] pub use crate::arch::apple::*; -#[cfg(all(target_arch = "x86_64", target_os = "windows"))] +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] +#[cfg(target_os = "windows")] pub mod windows; -#[cfg(all(target_arch = "x86_64", target_os = "windows"))] +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] +#[cfg(target_os = "windows")] pub use crate::arch::windows::*; diff --git a/builder/build/arch/musl.rs b/builder/src/arch/musl.rs similarity index 93% rename from builder/build/arch/musl.rs rename to builder/src/arch/musl.rs index 74734bf6d..fee6c00cd 100644 --- a/builder/build/arch/musl.rs +++ b/builder/src/arch/musl.rs @@ -3,6 +3,8 @@ use std::process::Command; +use std::ffi::OsStr; + pub const NATIVE_LIBS: &str = " -lssp_nonshared -lc"; pub const PROF_DYNAMIC_LIB: &str = "libdatadog_profiling.so"; pub const PROF_STATIC_LIB: &str = "libdatadog_profiling.a"; @@ -10,6 +12,7 @@ pub const PROF_DYNAMIC_LIB_FFI: &str = "libdatadog_profiling_ffi.so"; pub const PROF_STATIC_LIB_FFI: &str = "libdatadog_profiling_ffi.a"; pub const REMOVE_RPATH: bool = false; pub const BUILD_CRASHTRACKER: bool = true; +pub const RUSTFLAGS: [&str; 2] = ["-C", "relocation-model=pic"]; pub fn fix_rpath(lib_path: &str) { if REMOVE_RPATH { @@ -67,3 +70,5 @@ pub fn fix_soname(lib_path: &str) { patch_soname.wait().expect("failed to change the soname"); } + +pub fn add_additional_files(_lib_path: &str, _target_path: &OsStr) {} diff --git a/builder/build/arch/windows.rs b/builder/src/arch/windows.rs similarity index 50% rename from builder/build/arch/windows.rs rename to builder/src/arch/windows.rs index 0121f1568..c06a5368d 100644 --- a/builder/build/arch/windows.rs +++ b/builder/src/arch/windows.rs @@ -1,14 +1,33 @@ // Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 +use std::ffi::OsStr; +use std::fs; +use std::path::PathBuf; + pub const NATIVE_LIBS: &str = ""; pub const PROF_DYNAMIC_LIB: &str = "datadog_profiling.dll"; pub const PROF_STATIC_LIB: &str = "datadog_profiling.lib"; +pub const PROF_PDB: &str = "datadog_profiling.pdb"; pub const PROF_DYNAMIC_LIB_FFI: &str = "datadog_profiling_ffi.dll"; pub const PROF_STATIC_LIB_FFI: &str = "datadog_profiling_ffi.lib"; +pub const PROF_PDB_FFI: &str = "datadog_profiling_ffi.pdb"; pub const REMOVE_RPATH: bool = false; pub const BUILD_CRASHTRACKER: bool = false; +pub const RUSTFLAGS: [&str; 4] = [ + "-C", + "relocation-model=pic", + "-C", + "target-feature=+crt-static", +]; pub fn fix_rpath(_lib_path: &str) {} pub fn strip_libraries(_lib_path: &str) {} pub fn fix_soname(_lib_path: &str) {} + +pub fn add_additional_files(lib_path: &str, target_path: &OsStr) { + let from_pdb: PathBuf = [lib_path, PROF_PDB_FFI].iter().collect(); + let to_pdb: PathBuf = [target_path, OsStr::new(PROF_PDB)].iter().collect(); + + fs::copy(from_pdb, to_pdb).expect("unable to copy pdb file"); +} diff --git a/builder/src/bin/dummy.rs b/builder/src/bin/dummy.rs deleted file mode 100644 index 15e274398..000000000 --- a/builder/src/bin/dummy.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ -// SPDX-License-Identifier: Apache-2.0 - -pub fn main() {} diff --git a/builder/src/bin/release.rs b/builder/src/bin/release.rs new file mode 100644 index 000000000..03388c858 --- /dev/null +++ b/builder/src/bin/release.rs @@ -0,0 +1,127 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +use std::env; + +use build_common::determine_paths; + +use builder::builder::Builder; +use builder::common::Common; +#[cfg(feature = "crashtracker")] +use builder::crashtracker::CrashTracker; +#[cfg(feature = "profiling")] +use builder::profiling::Profiling; +use builder::utils::project_root; + +#[derive(Debug)] +struct ReleaseArgs { + pub out_dir: Option, + pub target: Option, +} + +impl From for ReleaseArgs { + fn from(mut args: pico_args::Arguments) -> Self { + let release_args = ReleaseArgs { + out_dir: match args.value_from_str("--out") { + Ok(v) => Some(v), + Err(_) => None, + }, + target: match args.value_from_str("--target") { + Ok(v) => Some(v), + Err(_) => None, + }, + }; + + args.finish(); + release_args + } +} + +pub fn main() { + let args: ReleaseArgs = pico_args::Arguments::from_env().into(); + + let (_, source_path) = determine_paths(); + + let profile = env::var("PROFILE").unwrap(); + let version = env::var("CARGO_PKG_VERSION").unwrap(); + let host = env::var("TARGET").unwrap(); + let out_dir = if let Some(out) = args.out_dir { + out + } else { + project_root().to_string_lossy().to_string() + "/" + "release" + }; + + let target = if let Some(target) = args.target { + target + } else { + host.clone() + }; + + #[allow(clippy::vec_init_then_push)] + let features = { + #[allow(unused_mut)] + let mut f: Vec = vec![]; + #[cfg(feature = "telemetry")] + f.push("ddtelemetry-ffi".to_string()); + #[cfg(feature = "data-pipeline")] + f.push("data-pipeline-ffi".to_string()); + #[cfg(feature = "crashtracker")] + f.push("crashtracker-ffi".to_string()); + #[cfg(feature = "symbolizer")] + f.push("symbolizer".to_string()); + f + }; + + let mut builder = Builder::new( + source_path.to_str().unwrap(), + &out_dir, + &target, + &profile, + &features.join(","), + &version, + ); + + builder.create_dir_structure(); + builder.add_cmake(); + + // add modules based on features + builder.add_module(Box::new(Common { + arch: builder.arch.clone(), + source_include: builder.source_inc.clone(), + target_include: builder.target_include.clone(), + })); + + #[cfg(feature = "profiling")] + builder.add_module(Box::new(Profiling { + arch: builder.arch.clone(), + base_header: builder.main_header.clone(), + features: builder.features.clone(), + profile: builder.profile.clone(), + source_include: builder.source_inc.clone(), + source_lib: builder.source_lib.clone(), + target_include: builder.target_include.clone(), + target_lib: builder.target_lib.clone(), + target_pkconfig: builder.target_pkconfig.clone(), + version: builder.version.clone(), + })); + + #[cfg(feature = "crashtracker")] + builder.add_module(Box::new(CrashTracker { + arch: builder.arch.clone(), + base_header: builder.main_header.clone(), + profile: builder.profile.clone(), + source_include: builder.source_inc.clone(), + target_include: builder.target_include.clone(), + target_dir: builder.target_dir.clone(), + })); + + // Build artifacts. + let res = builder.build(); + match res { + Ok(_) => { + builder.sanitize_libraries(); + builder.pack().unwrap() + } + Err(err) => panic!("{}", format!("Building failed: {}", err)), + } +} diff --git a/builder/src/builder.rs b/builder/src/builder.rs new file mode 100644 index 000000000..92672adc6 --- /dev/null +++ b/builder/src/builder.rs @@ -0,0 +1,186 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +use std::fs; +use std::path::{Path, PathBuf}; +use std::rc::Rc; + +use anyhow::Result; +use build_common::HEADER_PATH; +use tar; + +use crate::arch; +use crate::module::Module; +use crate::utils::{file_replace, project_root}; + +/// [`Builder`] is a structure that holds all the information required to assemble the final +/// workspace artifact. It will manage the different modules which will be in charge of producing +/// the different binaries and source files that will be part of the artifact. The builder will +/// provide the needed information: paths, version, etc, to the different modules so they can +/// install their sub-artifacts on the target folder. +/// The target folder is set through `LIBDD_OUTPUT_FOLDER` environment variable if it is not +/// provided the default target folder will be the builder output directory. +/// +/// # Example +/// +/// ```rust +/// use anyhow::Result; +/// use builder::builder::Builder; +/// use builder::module::Module; +/// use std::rc::Rc; +/// struct Core { +/// version: Rc, +/// } +/// +/// impl Module for Core { +/// fn build(&self) -> Result<()> { +/// Ok(()) +/// } +/// fn install(&self) -> Result<()> { +/// Ok(()) +/// } +/// } +/// let mut builder = Builder::new("source", "target", "arch", "features", "profile", "version"); +/// let core = Box::new(Core { +/// version: builder.version.clone(), +/// }); +/// builder.add_module(core); +/// builder.build(); +/// ``` +pub struct Builder { + modules: Vec>, + pub arch: Rc, + pub features: Rc, + pub main_header: Rc, + pub profile: Rc, + pub source_inc: Rc, + pub source_lib: Rc, + pub target_dir: Rc, + pub target_lib: Rc, + pub target_include: Rc, + pub target_bin: Rc, + pub target_pkconfig: Rc, + pub version: Rc, +} + +impl Builder { + /// Creates a new Builder instance + /// + /// # Aguments + /// + /// * `target_dir`: artifact folder. + /// * `profile`: Release configuration: debug or release; + /// * `version`: artifact's version. + /// + /// # Returns + /// + /// A new Builder instance. + pub fn new( + source_dir: &str, + target_dir: &str, + target_arch: &str, + profile: &str, + features: &str, + version: &str, + ) -> Self { + Builder { + modules: Vec::new(), + arch: target_arch.into(), + features: features.into(), + main_header: (target_dir.to_string() + "/" + HEADER_PATH + "/" + "common.h").into(), + profile: profile.into(), + source_lib: (source_dir.to_string() + "/" + target_arch + "/" + profile + "/deps") + .into(), + source_inc: (source_dir.to_string() + "/" + HEADER_PATH).into(), + target_dir: target_dir.into(), + target_lib: (target_dir.to_string() + "/" + "/lib").into(), + target_include: (target_dir.to_string() + "/" + HEADER_PATH).into(), + target_bin: (target_dir.to_string() + "/bin").into(), + target_pkconfig: (target_dir.to_string() + "/lib/pkgconfig").into(), + version: version.into(), + } + } + + /// Adds a boxed object which implements Module trait. + pub fn add_module(&mut self, module: Box) { + self.modules.push(module); + } + + pub fn create_dir_structure(&self) { + let target = Path::new(self.target_dir.as_ref()); + if fs::metadata(target).is_ok() { + fs::remove_dir_all(Path::new(self.target_dir.as_ref())) + .expect("Failed to clean preexisting target folder"); + } + fs::create_dir_all(Path::new(self.target_dir.as_ref())) + .expect("Failed to create target directory"); + fs::create_dir_all(Path::new(self.target_include.as_ref())) + .expect("Failed to create include directory"); + fs::create_dir_all(Path::new(self.target_lib.as_ref())) + .expect("Failed to create include directory"); + fs::create_dir_all(Path::new(self.target_bin.as_ref())) + .expect("Failed to create include directory"); + fs::create_dir_all(Path::new(self.target_pkconfig.as_ref())) + .expect("Failed to create include directory"); + } + + // TODO: maybe do this in module's build.rs + pub fn sanitize_libraries(&self) { + let datadog_lib_dir = Path::new(self.source_lib.as_ref()); + + let libs = fs::read_dir(datadog_lib_dir).unwrap(); + for lib in libs.flatten() { + let name = lib.file_name().into_string().unwrap(); + if name.ends_with(".so") { + arch::fix_rpath(lib.path().to_str().unwrap()); + } + } + } + + pub fn add_cmake(&self) { + let libs = arch::NATIVE_LIBS.to_owned(); + let cmake_path: PathBuf = [&self.target_dir, "DatadogConfig.cmake"].iter().collect(); + let mut origin = project_root(); + origin.push("cmake"); + origin.push("DatadogConfig.cmake.in"); + + file_replace( + origin.to_str().unwrap(), + cmake_path.to_str().unwrap(), + "@Datadog_LIBRARIES@", + libs.trim(), + ) + .expect("Failed to modify the cmake"); + } + + /// Builds the final artifact by going through all modules and instancing their install method. + /// + /// #Returns + /// + /// Ok(()) if success Err(_) if failure. + pub fn build(&self) -> Result<()> { + for module in &self.modules { + module.build()?; + module.install()?; + } + Ok(()) + } + + /// Generate a tar file with all the intermediate artifacts generated by all the modules.k + /// + /// #Returns + /// + /// Ok(()) if success Err(_) if failure. + pub fn pack(&self) -> Result<()> { + let tarname = "libdatadog".to_string() + "_v" + &self.version + ".tar"; + let path: PathBuf = [self.target_dir.as_ref(), &tarname].iter().collect(); + let artifact = fs::File::create(path).expect("Failed to create tarfile"); + let mut ar = tar::Builder::new(artifact); + ar.append_dir_all("lib", self.target_lib.as_ref())?; + ar.append_dir("bin", self.target_bin.as_ref())?; + ar.append_dir_all("include/datadog", self.target_include.as_ref())?; + + ar.finish().expect("Failed to write the tarfile"); + Ok(()) + } +} diff --git a/builder/build/common.rs b/builder/src/common.rs similarity index 50% rename from builder/build/common.rs rename to builder/src/common.rs index b9f8d9750..a5cfd8f31 100644 --- a/builder/build/common.rs +++ b/builder/src/common.rs @@ -1,18 +1,42 @@ // Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 +use crate::arch; use crate::module::Module; +use crate::utils::project_root; use anyhow::Result; use std::fs; use std::path::PathBuf; +use std::process::Command; use std::rc::Rc; pub struct Common { + pub arch: Rc, pub source_include: Rc, pub target_include: Rc, } impl Module for Common { + fn build(&self) -> Result<()> { + let mut cargo = Command::new("cargo") + .env("RUSTFLAGS", arch::RUSTFLAGS.join(" ")) + .current_dir(project_root()) + .args([ + "build", + "-p", + "ddcommon-ffi", + "--features", + "cbindgen", + "--target", + &self.arch, + ]) + .spawn() + .expect("failed to spawn cargo"); + + cargo.wait().expect("Cargo failed"); + Ok(()) + } + fn install(&self) -> Result<()> { let target_path: PathBuf = [self.target_include.as_ref(), "common.h"].iter().collect(); diff --git a/builder/build/crashtracker.rs b/builder/src/crashtracker.rs similarity index 51% rename from builder/build/crashtracker.rs rename to builder/src/crashtracker.rs index 6de4dbfc2..be2c7603b 100644 --- a/builder/build/crashtracker.rs +++ b/builder/src/crashtracker.rs @@ -3,27 +3,35 @@ use crate::arch; use crate::module::Module; +use crate::utils::project_root; use anyhow::Result; use std::fs; use std::path::PathBuf; use std::rc::Rc; +use tools::headers::dedup_headers; pub struct CrashTracker { + pub arch: Rc, + pub base_header: Rc, + pub profile: Rc, pub source_include: Rc, pub target_dir: Rc, pub target_include: Rc, } impl CrashTracker { - fn add_binaries(&self) -> Result<()> { - let _dst = cmake::Config::new("../crashtracker") - .define("Datadog_ROOT", self.target_dir.as_ref()) - .define("CMAKE_INSTALL_PREFIX", self.target_dir.as_ref()) - .build(); + fn gen_binaries(&self) -> Result<()> { + if arch::BUILD_CRASHTRACKER { + let mut crashtracker_dir = project_root(); + crashtracker_dir.push("crashtracker"); + let _dst = cmake::Config::new(crashtracker_dir.to_str().unwrap()) + .define("Datadog_ROOT", self.target_dir.as_ref()) + .define("CMAKE_INSTALL_PREFIX", self.target_dir.as_ref()) + .build(); + } Ok(()) } - fn add_headers(&self) -> Result<()> { let origin_path: PathBuf = [self.source_include.as_ref(), "crashtracker.h"] .iter() @@ -31,18 +39,24 @@ impl CrashTracker { let target_path: PathBuf = [self.target_include.as_ref(), "crashtracker.h"] .iter() .collect(); - fs::copy(origin_path, target_path).expect("Failed to copy crashtracker.h"); + + let headers = vec![target_path.to_str().unwrap()]; + fs::copy(origin_path, &target_path).expect("Failed to copy crashtracker.h"); + + dedup_headers(self.base_header.as_ref(), &headers); Ok(()) } } impl Module for CrashTracker { + fn build(&self) -> Result<()> { + Ok(()) + } + fn install(&self) -> Result<()> { self.add_headers()?; - if arch::BUILD_CRASHTRACKER { - self.add_binaries()?; - } + self.gen_binaries()?; Ok(()) } } diff --git a/builder/src/lib.rs b/builder/src/lib.rs new file mode 100644 index 000000000..3151e7c40 --- /dev/null +++ b/builder/src/lib.rs @@ -0,0 +1,13 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +pub mod arch; +pub mod builder; +pub mod common; +#[cfg(feature = "crashtracker")] +pub mod crashtracker; +pub mod module; +pub mod utils; + +#[cfg(feature = "profiling")] +pub mod profiling; diff --git a/builder/build/module.rs b/builder/src/module.rs similarity index 86% rename from builder/build/module.rs rename to builder/src/module.rs index c7fd5ff22..6f434c5c1 100644 --- a/builder/build/module.rs +++ b/builder/src/module.rs @@ -12,6 +12,12 @@ use anyhow::Result; /// Assuming there is a crate inside the workspace named core-ffi and this crate produces a library /// `libcore_ffi.so` and a header file `core-ffi.h`: /// ``` +/// use anyhow::Result; +/// use builder::module::Module; +/// use std::fs; +/// use std::path::{Path, PathBuf}; +/// use std::rc::Rc; +/// /// struct Core { /// pub source_include: Rc, /// pub source_lib: Rc, @@ -31,10 +37,14 @@ use anyhow::Result; /// let mut origin_path: PathBuf = [&self.source_lib, "libcore_ffi.so"].iter().collect(); /// let mut target_path: PathBuf = [&self.target_lib, "libcore_ffi.so"].iter().collect(); /// fs::copy(&origin_path, &target_path).expect("Failed to copy the library"); +/// Ok(()) /// } /// } /// /// impl Module for Core { +/// fn build(&self) -> Result<()> { +/// Ok(()) +/// } /// fn install(&self) -> Result<()> { /// self.add_header()?; /// self.add_lib()?; @@ -43,5 +53,6 @@ use anyhow::Result; /// } /// ``` pub trait Module { + fn build(&self) -> Result<()>; fn install(&self) -> Result<()>; } diff --git a/builder/build/profiling.rs b/builder/src/profiling.rs similarity index 53% rename from builder/build/profiling.rs rename to builder/src/profiling.rs index 9eef7f784..2aebe7bf5 100644 --- a/builder/build/profiling.rs +++ b/builder/src/profiling.rs @@ -3,14 +3,21 @@ use crate::arch; use crate::module::Module; +use crate::utils::{file_replace, project_root}; use anyhow::Result; use std::ffi::OsStr; use std::fs; +use std::ops::Add; use std::path::{Path, PathBuf}; use std::process::Command; use std::rc::Rc; +use tools::headers::dedup_headers; pub struct Profiling { + pub arch: Rc, + pub base_header: Rc, + pub features: Rc, + pub profile: Rc, pub source_include: Rc, pub source_lib: Rc, pub target_include: Rc, @@ -26,16 +33,34 @@ impl Profiling { let mut headers = vec!["profiling.h"]; #[cfg(feature = "telemetry")] headers.push("telemetry.h"); + #[cfg(feature = "data-pipeline")] + headers.push("data-pipeline.h"); + #[cfg(feature = "symbolizer")] + headers.push("blazesym.h"); let mut origin_path: PathBuf = [&self.source_include, "dummy.h"].iter().collect(); let mut target_path: PathBuf = [&self.target_include, "dummy.h"].iter().collect(); - for header in headers { + let mut to_dedup = vec![]; + for header in &headers { origin_path.set_file_name(header); target_path.set_file_name(header); fs::copy(&origin_path, &target_path).expect("Failed to copy the header"); + + // Exclude blazesym header from deduplication + if !target_path.to_str().unwrap().contains("blazesym.h") { + to_dedup.push(target_path.clone()); + } } + dedup_headers( + self.base_header.as_ref(), + &(to_dedup + .iter() + .map(|i| i.to_str().unwrap()) + .collect::>()), + ); + Ok(()) } @@ -61,6 +86,8 @@ impl Profiling { .collect(); fs::copy(from_static, to_static).expect("unable to copy static lib"); + arch::add_additional_files(&self.source_lib, lib_dir.as_os_str()); + arch::fix_soname(&self.target_lib); // Generate debug information @@ -76,30 +103,33 @@ impl Profiling { ]; //Create directory - // let pc_dir: PathBuf = [&self, "lib/pkgconfig"].iter().collect(); let pc_dir = Path::new(self.target_pkconfig.as_ref()); fs::create_dir_all(pc_dir).expect("Failed to create pkgconfig directory"); // Create files for file in files.iter() { - let file_in = "../profiling-ffi/".to_string() + file + ".in"; - let output = Command::new("sed") - .arg("s/@Datadog_VERSION@/".to_string() + &self.version + "/g") - .arg(&file_in) - .output() - .expect("sed command failed"); + let file_in = file.to_string() + ".in"; - let pc_file: PathBuf = [pc_dir.as_os_str(), OsStr::new(file)].iter().collect(); - fs::write(&pc_file, &output.stdout).expect("writing pc file failed"); + let mut pc_origin: PathBuf = project_root(); + pc_origin.push("profiling-ffi"); + pc_origin.push(file_in); - if *file == files[2] { - let output = Command::new("sed") - .arg("s/@Datadog_LIBRARIES@/".to_string() + arch::NATIVE_LIBS + "/g") - .arg(&file_in) - .output() - .expect("sed command failed"); + let pc_target: PathBuf = [pc_dir.as_os_str(), OsStr::new(file)].iter().collect(); + + file_replace( + pc_origin.to_str().unwrap(), + pc_target.to_str().unwrap(), + "@Datadog_VERSION@", + &self.version, + )?; - fs::write(&pc_file, &output.stdout).expect("writing pc file failed"); + if *file == files[2] { + file_replace( + pc_origin.to_str().unwrap(), + pc_target.to_str().unwrap(), + "@Datadog_LIBRARIES@", + arch::NATIVE_LIBS, + )?; } } Ok(()) @@ -107,6 +137,36 @@ impl Profiling { } impl Module for Profiling { + fn build(&self) -> Result<()> { + let features = self.features.to_string() + "," + "cbindgen"; + #[cfg(feature = "crashtracker")] + let features = features.add(",crashtracker-collector,crashtracker-receiver,demangler"); + + let mut cargo_args = vec![ + "build", + "-p", + "datadog-profiling-ffi", + "--features", + &features, + "--target", + &self.arch, + "-vv", + ]; + + if self.profile.as_ref() == "release" { + cargo_args.push("--release"); + } + + let mut cargo = Command::new("cargo") + .env("RUSTFLAGS", arch::RUSTFLAGS.join(" ")) + .current_dir(project_root()) + .args(cargo_args) + .spawn() + .expect("failed to spawn cargo"); + + cargo.wait().expect("Cargo failed"); + Ok(()) + } fn install(&self) -> Result<()> { self.add_headers()?; self.add_libs()?; diff --git a/builder/src/utils.rs b/builder/src/utils.rs new file mode 100644 index 000000000..89200fb02 --- /dev/null +++ b/builder/src/utils.rs @@ -0,0 +1,28 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::{anyhow, Result}; +use std::fs::{self, OpenOptions}; +use std::io::Write; +use std::path::{Path, PathBuf}; + +pub fn file_replace(file_in: &str, file_out: &str, target: &str, replace: &str) -> Result<()> { + let content = fs::read_to_string(file_in)?; + let new = content.replace(target, replace); + + let mut file = OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(file_out)?; + file.write_all(new.as_bytes()) + .map_err(|err| anyhow!("failed to write file: {}", err)) +} + +pub fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(1) + .unwrap() + .to_path_buf() +} diff --git a/tools/docker/Dockerfile.build b/tools/docker/Dockerfile.build index e9ce10fd4..b6f744fc7 100644 --- a/tools/docker/Dockerfile.build +++ b/tools/docker/Dockerfile.build @@ -117,7 +117,7 @@ RUN echo \ bin_tests/src/bin/crashtracker_receiver.rs \ bin_tests/src/bin/crashtracker_unix_socket_receiver.rs \ bin_tests/src/bin/test_the_tests.rs \ - builder/src/bin/dummy.rs \ + builder/src/bin/release.rs \ ddtelemetry/examples/tm-worker-test.rs \ ipc/benches/ipc.rs \ ipc/tarpc/tarpc/examples/compression.rs \ @@ -159,7 +159,7 @@ RUN cargo build --lib --workspace --exclude builder RUN cargo build --release --lib --workspace --exclude builder COPY ./ ./ -RUN LIBDD_OUTPUT_FOLDER=/build/output cargo build -p builder --features profiling,telemetry,data-pipeline,symbolizer,crashtracker --release +RUN cargo run --bin release --features profiling,telemetry,data-pipeline,symbolizer,crashtracker --release -- --out /build/output FROM scratch as ffi_build_output diff --git a/tools/src/bin/dedup_headers.rs b/tools/src/bin/dedup_headers.rs index 27c5c9a0b..0660421ef 100644 --- a/tools/src/bin/dedup_headers.rs +++ b/tools/src/bin/dedup_headers.rs @@ -12,5 +12,7 @@ fn main() { let args: Vec<_> = std::env::args_os() .flat_map(|arg| arg.into_string()) .collect(); - dedup_headers(&args[1], &args[2..]); + let headers: Vec<&str> = args[2..].iter().map(|i| i.as_str()).collect(); + + dedup_headers(&args[1], &headers); } diff --git a/tools/src/lib.rs b/tools/src/lib.rs index 480f69c4a..cc5ea7494 100644 --- a/tools/src/lib.rs +++ b/tools/src/lib.rs @@ -45,9 +45,10 @@ pub mod headers { new_content_parts } - pub fn dedup_headers(base: &str, headers: &[String]) { + pub fn dedup_headers(base: &str, headers: &[&str]) { let mut unique_child_defs: Vec = Vec::new(); let mut present = HashSet::new(); + for child_def in headers.iter().flat_map(|p| { let child_header = OpenOptions::new().read(true).write(true).open(p).unwrap(); @@ -69,7 +70,6 @@ pub mod headers { present.insert(child_def); } - println!("base: {:?}", base); let base_header = OpenOptions::new() .read(true) .write(true) diff --git a/windows/build-artifacts.ps1 b/windows/build-artifacts.ps1 index b82e113bf..b1ae15968 100644 --- a/windows/build-artifacts.ps1 +++ b/windows/build-artifacts.ps1 @@ -41,4 +41,4 @@ Invoke-Call -ScriptBlock { cbindgen --crate data-pipeline-ffi --config data-pipe Invoke-Call -ScriptBlock { cbindgen --crate datadog-crashtracker-ffi --config crashtracker-ffi/cbindgen.toml --output $output_dir"\crashtracker.h" } Invoke-Call -ScriptBlock { .\target\release\dedup_headers $output_dir"\common.h" $output_dir"\profiling.h" $output_dir"\telemetry.h" $output_dir"\data-pipeline.h" $output_dir"\crashtracker.h"} -Write-Host "Build finished" -ForegroundColor Magenta \ No newline at end of file +Write-Host "Build finished" -ForegroundColor Magenta diff --git a/windows/libdatadog.csproj b/windows/libdatadog.csproj index f32a91aa4..eb40afbe7 100644 --- a/windows/libdatadog.csproj +++ b/windows/libdatadog.csproj @@ -35,6 +35,8 @@ PackagePath="include\native\datadog\telemetry.h" /> + @@ -48,7 +50,7 @@ + Pack="true" PackagePath="build\native\lib\x64\release\datadog_profiling_ffi.pdb" />