diff --git a/.drone/drone.yml b/.drone/drone.yml index b82eb215..0d53b9ef 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -8,7 +8,7 @@ steps: - commands: - uname -a - make test - image: pyroscope/rust_builder_cli:1 + image: pyroscope/rust_builder_cli:2 name: make cli/test trigger: event: @@ -24,7 +24,7 @@ steps: - commands: - uname -a - make test - image: pyroscope/rust_builder_cli:1 + image: pyroscope/rust_builder_cli:2 name: make cli/test trigger: event: @@ -32,6 +32,6 @@ trigger: type: docker --- kind: signature -hmac: afb4cb757c4a553f765b97688bd67b2fe94528e404540d2cbd3c0683e4e0b0a0 +hmac: ae54e4e9f852f94f3f7cd411812430ea96ad7238f1f638753161305d554e55fa ... diff --git a/.drone/pipelines/test.jsonnet b/.drone/pipelines/test.jsonnet index b1a5d4b1..10122941 100644 --- a/.drone/pipelines/test.jsonnet +++ b/.drone/pipelines/test.jsonnet @@ -6,6 +6,7 @@ local pipelines = import '../util/pipelines.jsonnet'; pipelines.linux_amd64('[amd64] make test') { trigger: { event: ['pull_request'], + //ref: ['refs/heads/main'], }, steps: [ { @@ -18,6 +19,7 @@ local pipelines = import '../util/pipelines.jsonnet'; pipelines.linux_arm64('[arm64] make test') { trigger: { event: ['pull_request'], + //ref: ['refs/heads/main'], }, steps: [ { diff --git a/.github/workflows/ci-ffi-python.yml b/.github/workflows/ci-ffi-python.yml index 497e1e21..bca4c334 100644 --- a/.github/workflows/ci-ffi-python.yml +++ b/.github/workflows/ci-ffi-python.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: build-arch: - - manylinux2010_x86_64 + - manylinux2014_x86_64 name: Linux - ${{ matrix.build-arch }} runs-on: ubuntu-latest @@ -23,11 +23,6 @@ jobs: with: submodules: recursive - - if: matrix.build-arch == 'manylinux2014_aarch64' - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - name: Build in Docker run: pyroscope_ffi/python/scripts/docker.sh env: @@ -84,7 +79,6 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - name: Build in Docker run: pyroscope_ffi/python/scripts/docker.sh env: diff --git a/.github/workflows/ci-ffi-ruby.yml b/.github/workflows/ci-ffi-ruby.yml index 31815aab..4fd31a97 100644 --- a/.github/workflows/ci-ffi-ruby.yml +++ b/.github/workflows/ci-ffi-ruby.yml @@ -45,7 +45,7 @@ jobs: working-directory: pyroscope_ffi/ruby - name: Generate extra libraries - run: BUILD_ARCH=manylinux2010_x86_64 ./pyroscope_ffi/ruby/scripts/docker.sh + run: BUILD_ARCH=manylinux2014_x86_64 ./pyroscope_ffi/ruby/scripts/docker.sh - name: Copy generated extra libraries run: mkdir -p lib/rbspy && cp ./elflib/rbspy/wheelhouse/rbspy-1.0.0/rbspy/_native__lib.cpython-37m-x86_64-linux-gnu.so lib/rbspy/rbspy.so diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0570cf9..87e1e36a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,37 @@ jobs: title: "pyroscope-${{ github.ref_name }}" draft: true prerelease: false + clibuilder-release: + name: clibuilder-release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/clibuilder-')" + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: docker/login-action@v2 + name: Login to Docker Hub + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - run: docker buildx create --use + - run: make -C docker push_cli_builder + manylinux-release: + name: manylinux-release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/manylinux-')" + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: docker/login-action@v2 + name: Login to Docker Hub + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - run: docker buildx create --use + - run: make -C docker push_aarch64 push_x86_64 + cli-release: name: pyroscope-cli runs-on: ubuntu-latest @@ -101,7 +132,7 @@ jobs: fail-fast: false matrix: build-arch: - - manylinux2010_x86_64 + - manylinux2014_x86_64 name: Linux - ${{ matrix.build-arch }} runs-on: ubuntu-latest @@ -112,11 +143,6 @@ jobs: with: submodules: recursive - - if: matrix.build-arch == 'manylinux2014_aarch64' - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - name: Build in Docker run: pyroscope_ffi/python/scripts/docker.sh env: @@ -297,7 +323,7 @@ jobs: working-directory: pyroscope_ffi/ruby - name: Generate extra libraries - run: BUILD_ARCH=manylinux2010_x86_64 ./pyroscope_ffi/ruby/scripts/docker.sh + run: BUILD_ARCH=manylinux2014_x86_64 ./pyroscope_ffi/ruby/scripts/docker.sh - name: Copy generated extra libraries run: mkdir -p lib/thread_id && cp ext/thread_id/target/release/libthread_id.so lib/thread_id/thread_id.so diff --git a/Cargo.lock b/Cargo.lock index 08cbafc4..1669b3a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arrayvec" @@ -245,9 +245,12 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" +dependencies = [ + "libc", +] [[package]] name = "cexpr" @@ -441,12 +444,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.0", "lock_api", "once_cell", "parking_lot_core", @@ -484,9 +487,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -555,9 +558,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -582,12 +585,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "findshlibs" @@ -670,7 +670,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -778,6 +778,12 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" version = "0.4.1" @@ -939,7 +945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -978,15 +984,6 @@ dependencies = [ "str_stack", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -1006,12 +1003,12 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.3", + "rustix 0.38.6", "windows-sys 0.48.0", ] @@ -1026,9 +1023,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" @@ -1139,9 +1136,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" @@ -1165,7 +1162,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1322,9 +1319,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -1386,7 +1383,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -1480,9 +1477,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "pprof" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b90f8560ad8bd57b207b8293bc5226e48e89039a6e590c12a297d91b84c7e60" +checksum = "978385d59daf9269189d052ca8a84c1acfd0715c0599a5d5188d4acc078ca46a" dependencies = [ "backtrace", "cfg-if", @@ -1540,9 +1537,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1742,9 +1739,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1838,9 +1835,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", @@ -1850,9 +1847,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" dependencies = [ "aho-corasick", "memchr", @@ -1861,9 +1858,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "remoteprocess" @@ -1979,7 +1976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", - "errno 0.3.1", + "errno 0.3.2", "io-lifetimes", "libc", "linux-raw-sys 0.3.8", @@ -1988,22 +1985,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" dependencies = [ "bitflags 2.3.3", - "errno 0.3.1", + "errno 0.3.2", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.5", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.21.3" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring", @@ -2022,9 +2019,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" dependencies = [ "ring", "untrusted", @@ -2043,9 +2040,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "schannel" @@ -2058,9 +2055,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scroll" @@ -2079,7 +2076,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -2094,9 +2091,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2107,9 +2104,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -2117,32 +2114,32 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.166" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "6d3e73c93c3240c0bda063c239298e633114c69a888c3e37ca8bb33f343e9890" [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "be02f6cb0cd3a5ec20bbcfbcbd749f57daddb1a0882dc2e46a6c236c90b977ed" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", @@ -2290,9 +2287,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -2301,15 +2298,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.23", + "rustix 0.38.6", "windows-sys 0.48.0", ] @@ -2371,22 +2367,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.41" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.41" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -2443,7 +2439,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -2530,9 +2526,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -2568,9 +2564,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" [[package]] name = "vcpkg" @@ -2632,7 +2628,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -2666,7 +2662,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index d5bc63c5..0524a28a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ autobins = false autoexamples = true autotests = true autobenches = true -rust-version = "1.63" +rust-version = "1.64" [workspace] members = [ diff --git a/docker/Dockerfile.cli b/docker/Dockerfile.cli index 03ca8e18..e0184339 100644 --- a/docker/Dockerfile.cli +++ b/docker/Dockerfile.cli @@ -1,4 +1,4 @@ -FROM pyroscope/rust_builder_cli as builder +FROM pyroscope/rust_builder_cli:2 as builder WORKDIR /app ADD pyroscope_backends ./pyroscope_backends diff --git a/docker/Dockerfile.cli_builder b/docker/Dockerfile.cli_builder index bf1be4b2..8ced435f 100644 --- a/docker/Dockerfile.cli_builder +++ b/docker/Dockerfile.cli_builder @@ -20,7 +20,7 @@ RUN case "${TARGETPLATFORM}" in \ RUN source ./.env && \ wget https://static.rust-lang.org/rustup/dist/${RUST_TARGET}/rustup-init && \ chmod +x rustup-init && \ - ./rustup-init -y --default-toolchain=1.63.0 --default-host=${RUST_TARGET} + ./rustup-init -y --default-toolchain=1.64.0 --default-host=${RUST_TARGET} ENV PATH=/root/.cargo/bin:$PATH diff --git a/docker/Dockerfile.manylinux2014_aarch64 b/docker/Dockerfile.manylinux2014_aarch64 index 28f3ca6f..52d42723 100644 --- a/docker/Dockerfile.manylinux2014_aarch64 +++ b/docker/Dockerfile.manylinux2014_aarch64 @@ -1,11 +1,9 @@ FROM --platform=linux/aarch64 quay.io/pypa/manylinux2014_aarch64 -# use musl rustup-init because gnu does not work on manylinux2010 -# https://github.com/pyroscope-io/pyroscope-rs/pull/82#issuecomment-1434466795 -# do same on manylinux2014 for consistency + RUN curl https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-musl/rustup-init -o ./rustup-init \ && chmod +x ./rustup-init \ - && ./rustup-init -y --default-toolchain=1.63.0 --default-host=aarch64-unknown-linux-gnu + && ./rustup-init -y --default-toolchain=1.64.0 --default-host=aarch64-unknown-linux-gnu ENV PATH=/root/.cargo/bin:$PATH RUN yum -y install gcc libffi-devel openssl-devel wget diff --git a/docker/Dockerfile.manylinux2010_x86_64 b/docker/Dockerfile.manylinux2014_x86_64 similarity index 64% rename from docker/Dockerfile.manylinux2010_x86_64 rename to docker/Dockerfile.manylinux2014_x86_64 index f71c5bac..c5ee4892 100644 --- a/docker/Dockerfile.manylinux2010_x86_64 +++ b/docker/Dockerfile.manylinux2014_x86_64 @@ -1,11 +1,9 @@ -FROM --platform=linux/amd64 quay.io/pypa/manylinux2010_x86_64 +FROM --platform=linux/amd64 quay.io/pypa/manylinux2014_x86_64 + -# use musl rustup-init because gnu does not work on manylinux2010 -# https://github.com/pyroscope-io/pyroscope-rs/pull/82#issuecomment-1434466795 -# do same on manylinux2014 for consistency RUN curl https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init -o ./rustup-init \ && chmod +x ./rustup-init \ - && ./rustup-init -y --default-toolchain=1.63.0 --default-host=x86_64-unknown-linux-gnu + && ./rustup-init -y --default-toolchain=1.64.0 --default-host=x86_64-unknown-linux-gnu ENV PATH=/root/.cargo/bin:$PATH RUN yum -y install gcc libffi-devel openssl-devel wget diff --git a/docker/Makefile b/docker/Makefile index d641492c..2b56f731 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,21 +1,14 @@ PREFIX ?= pyroscope/rust_builder -CLI_BUILDER_VERSION ?= 1 -.PHONY: build_x86_64 -build_x86_64: - docker build -t $(PREFIX)_manylinux2010_x86_64 -f Dockerfile.manylinux2010_x86_64 . +CLI_BUILDER_VERSION ?= 2 +MANYLINUX_VERSION ?= 3 .PHONY: push_x86_64 -push_x86_64: build_x86_64 - docker push $(PREFIX)_manylinux2010_x86_64 - - -.PHONY: build_aarch64 -build_aarch64: - docker build -t $(PREFIX)_manylinux2014_aarch64 -f Dockerfile.manylinux2014_aarch64 . +push_x86_64: + docker buildx build --platform linux/amd64 -t $(PREFIX)_manylinux2014_x86_64:$(MANYLINUX_VERSION) -f Dockerfile.manylinux2014_x86_64 --push . .PHONY: push_aarch64 -push_aarch64: build_aarch64 - docker push $(PREFIX)_manylinux2014_aarch64 +push_aarch64: + docker buildx build --platform linux/arm64 -t $(PREFIX)_manylinux2014_aarch64:$(MANYLINUX_VERSION) -f Dockerfile.manylinux2014_aarch64 --push . .PHONY: push_cli_builder diff --git a/docker/Readme.txt b/docker/Readme.txt index f4570d52..74170a49 100644 --- a/docker/Readme.txt +++ b/docker/Readme.txt @@ -1,11 +1,4 @@ -These dockerfile images do few things: +These dockerfile.manylinux* images do few things: -1. rustup now requires glibc >= 2.17 but manylinux2010 has glibc == 2.12 - -To make it work we download statically compiled (musl) rustup-init and then install 1.63 x86_64-unknown-linux-gnu toolchain - -https://github.com/pyroscope-io/pyroscope-rs/pull/82#issuecomment-1434466795 -https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html - -2. rust toolchain, libunwind, deps were downloaded and installed on every build in manylinux.sh +1. rust toolchain, libunwind, deps were downloaded and installed on every build in manylinux.sh now they are installed once at image creation time diff --git a/docker/build-container.mk b/docker/build-container.mk index ee40c652..7d2380b3 100644 --- a/docker/build-container.mk +++ b/docker/build-container.mk @@ -34,7 +34,7 @@ # variable names should be passed through to the container. USE_CONTAINER ?= 0 -BUILD_IMAGE_VERSION ?= 1 +BUILD_IMAGE_VERSION ?= 2 BUILD_IMAGE ?= pyroscope/rust_builder_cli:$(BUILD_IMAGE_VERSION) DOCKER_OPTS ?= diff --git a/pyroscope_cli/Cargo.lock b/pyroscope_cli/Cargo.lock index 16b957f8..d6622626 100644 --- a/pyroscope_cli/Cargo.lock +++ b/pyroscope_cli/Cargo.lock @@ -1682,9 +1682,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "pprof" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196ded5d4be535690899a4631cc9f18cdc41b7ebf24a79400f46f48e49a11059" +checksum = "978385d59daf9269189d052ca8a84c1acfd0715c0599a5d5188d4acc078ca46a" dependencies = [ "backtrace", "cfg-if", @@ -1867,7 +1867,7 @@ dependencies = [ [[package]] name = "pyroscope" -version = "0.5.6" +version = "0.5.7" dependencies = [ "json", "libc", @@ -1883,7 +1883,7 @@ dependencies = [ [[package]] name = "pyroscope-cli" -version = "0.2.8" +version = "0.2.9" dependencies = [ "assert_cmd", "better-panic", @@ -1952,7 +1952,7 @@ dependencies = [ [[package]] name = "pyroscope_pprofrs" -version = "0.2.5" +version = "0.2.7" dependencies = [ "log", "pprof", @@ -2546,9 +2546,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "symbolic-common" -version = "10.2.1" +version = "12.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b55cdc318ede251d0957f07afe5fed912119b8c1bc5a7804151826db999e737" +checksum = "26212dc7aeb75abb4cc84320a50dd482977089402f7b4043b454d6d79d8536e7" dependencies = [ "debugid", "memmap2", @@ -2558,9 +2558,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "10.2.1" +version = "12.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79be897be8a483a81fff6a3a4e195b4ac838ef73ca42d348b3f722da9902e489" +checksum = "76f1b0155f588568b2df0d693b30aeedb59360b647b85fc3c23942e81e8cc97a" dependencies = [ "cpp_demangle 0.4.0", "rustc-demangle", diff --git a/pyroscope_cli/Cargo.toml b/pyroscope_cli/Cargo.toml index 230edec6..3130aea0 100644 --- a/pyroscope_cli/Cargo.toml +++ b/pyroscope_cli/Cargo.toml @@ -5,14 +5,14 @@ Pyroscope Profiler CLI """ keywords = ["pyroscope", "profiler", "cli"] authors = ["Abid Omar "] -version = "0.2.8" +version = "0.2.9" edition = "2021" license = "Apache-2.0" homepage = "https://pyroscope.io" documentation = "https://docs.rs/pyroscope" repository = "https://github.com/pyroscope-io/pyroscope-rs" readme = "README.md" -rust-version = "1.63" +rust-version = "1.64" [dependencies] diff --git a/pyroscope_cli/src/cli/lib.rs b/pyroscope_cli/src/cli/lib.rs index 1c64bcd4..1ae2ed67 100644 --- a/pyroscope_cli/src/cli/lib.rs +++ b/pyroscope_cli/src/cli/lib.rs @@ -99,7 +99,7 @@ enum Commands { short, long = "log-level", value_name = "LOG_LEVEL", - help = "[default: info] log level for the application" + help = "[default: error] log level for the application" )] log_level: Option, #[clap( @@ -246,7 +246,7 @@ enum Commands { short, long = "log-level", value_name = "LOG_LEVEL", - help = "[default: info] log level for the application" + help = "[default: error] log level for the application" )] log_level: Option, #[clap( @@ -368,6 +368,7 @@ pub fn cli_match() -> Result<()> { match &cli.command { Commands::Exec { .. } => { commands::exec()?; + } Commands::Connect { .. } => { commands::connect()?; diff --git a/pyroscope_cli/src/core/commands.rs b/pyroscope_cli/src/core/commands.rs index 84c139a6..33093621 100644 --- a/pyroscope_cli/src/core/commands.rs +++ b/pyroscope_cli/src/core/commands.rs @@ -1,7 +1,11 @@ use ctrlc; +use duct::cmd; +use std::os::unix::process::CommandExt; + use std::sync::mpsc::channel; +use std::thread; -use super::{executor::Executor, profiler::Profiler}; +use super::{profiler::Profiler}; use crate::utils::{ app_config::AppConfig, error::{Error, Result}, @@ -14,47 +18,44 @@ pub fn exec() -> Result<()> { set_application_name()?; set_tags()?; - // Get command to execute let command = AppConfig::get::>("command")? .ok_or_else(|| Error::new("command unwrap failed"))?; let command_args = AppConfig::get::>("command_args")? .ok_or_else(|| Error::new("command unwrap failed"))?; + let command_args: Vec = pyroscope::pyroscope::parse_vec_string_json(command_args)?; - // Get UID let uid = AppConfig::get::>("user_name").unwrap_or(None); - // Get GID let gid = AppConfig::get::>("group_name").unwrap_or(None); - // Create new executor and run it - let executor = Executor::new(command.as_ref(), command_args.as_ref(), uid, gid).run()?; - - // Set PID - AppConfig::set("pid", executor.get_pid()?.to_string().as_str())?; + let handle = cmd(command, command_args) + .before_spawn(move |c| { + if let Some(uid) = uid { + c.uid(uid); + } + if let Some(gid) = gid { + c.gid(gid); + } + Ok(()) + }) + .start()?; + + let pid = handle + .pids() + .get(0) + .ok_or_else(|| Error::new("pid not collected"))? + .to_owned() as i32 ; + + AppConfig::set("pid", pid.to_string().as_str())?; - // Initialize profiler let mut profiler = Profiler::default(); profiler.init()?; - // Create a channel for ctrlc - let (tx, rx) = channel(); - - // Set ctrcl handler - ctrlc::set_handler(move || { - tx.send(()).unwrap(); - }) - .expect("Error setting Ctrl-C handler"); - - println!("Press Ctrl-C to exit."); - - // Wait for Ctrl+C signal - rx.recv().unwrap(); - - println!("Exiting."); - - // Stop exector and profiler - executor.stop()?; - profiler.stop()?; + let child_res = handle.wait(); + //todo this waits for up to 10 seconds, fix this + let profiler_res = profiler.stop(); + child_res?; + profiler_res?; Ok(()) } diff --git a/pyroscope_cli/src/core/executor.rs b/pyroscope_cli/src/core/executor.rs deleted file mode 100644 index 6350dbab..00000000 --- a/pyroscope_cli/src/core/executor.rs +++ /dev/null @@ -1,79 +0,0 @@ -use duct::cmd; -use std::os::unix::process::CommandExt; - -use crate::utils::error::{Error, Result}; - -/// Run a command with the given arguments, uid and gid. -/// This is a wrapper around the duct crate. -pub struct Executor<'a> { - /// The command to run - cmd: &'a str, - /// The arguments to pass to the command - args: &'a str, - /// The user id to run the command as - uid: Option, - /// The group id to run the command as - gid: Option, - /// duct thread handle - handle: Option, -} - -impl<'a> Executor<'a> { - /// Create a new `Executor` with the given command, arguments, uid and gid. - pub fn new(cmd: &'a str, args: &'a str, uid: Option, gid: Option) -> Executor<'a> { - Executor { - cmd, - args, - uid, - gid, - handle: None, - } - } - - /// Run the command. - pub fn run(self) -> Result { - let handle = cmd!(self.cmd, self.args) - .before_spawn(move |cmd| { - if let Some(uid) = self.uid { - cmd.uid(uid); - } - if let Some(gid) = self.gid { - cmd.gid(gid); - } - Ok(()) - }) - .stdout_capture() - .start()?; - - Ok(Self { - cmd: self.cmd, - args: self.args, - uid: self.uid, - gid: self.gid, - handle: Some(handle), - }) - } - - /// Stop the command. - pub fn stop(self) -> Result<()> { - self.handle - .ok_or_else(|| Error::new("handle is not initialized"))? - .kill()?; - - Ok(()) - } - - /// Get the process id of the executed command. - pub fn get_pid(&self) -> Result { - let pid = self - .handle - .as_ref() - .ok_or_else(|| Error::new("handle is not initialized"))? - .pids() - .get(0) - .ok_or_else(|| Error::new("pid not collected"))? - .to_owned() as i32; - - Ok(pid) - } -} diff --git a/pyroscope_cli/src/core/mod.rs b/pyroscope_cli/src/core/mod.rs index ca2b43ab..81c0ca32 100644 --- a/pyroscope_cli/src/core/mod.rs +++ b/pyroscope_cli/src/core/mod.rs @@ -1,3 +1,2 @@ pub mod commands; -pub mod executor; pub mod profiler; diff --git a/pyroscope_cli/src/resources/default_config.toml b/pyroscope_cli/src/resources/default_config.toml index 01677002..dd4a516c 100644 --- a/pyroscope_cli/src/resources/default_config.toml +++ b/pyroscope_cli/src/resources/default_config.toml @@ -1,5 +1,5 @@ detect_subprocesses = false -log_level = "info" +log_level = "error" no_logging = false blocking = false oncpu = false diff --git a/pyroscope_cli/src/utils/app_config.rs b/pyroscope_cli/src/utils/app_config.rs index 1afdec5e..d8ed75d2 100644 --- a/pyroscope_cli/src/utils/app_config.rs +++ b/pyroscope_cli/src/utils/app_config.rs @@ -170,10 +170,9 @@ impl AppConfig { .iter() .skip(1) .map(|s| s.to_string()) - .collect::>() - .join(" "); + .collect::>(); - AppConfig::set("command_args", &command_args)?; + AppConfig::set("command_args", &json::stringify(command_args))?; } } if sub_exec.is_present("log_level") { diff --git a/pyroscope_cli/src/utils/logger.rs b/pyroscope_cli/src/utils/logger.rs index 2797dc5d..ecd796e2 100644 --- a/pyroscope_cli/src/utils/logger.rs +++ b/pyroscope_cli/src/utils/logger.rs @@ -64,7 +64,7 @@ where } // TODO: This is probably expensive (and should be cached) - let log_level = AppConfig::get::("log_level").unwrap_or(LogLevel::Info); + let log_level = AppConfig::get::("log_level").unwrap_or(LogLevel::Error); // convert log level to slog level let current_level = match log_level { diff --git a/pyroscope_ffi/ffikit/Cargo.toml b/pyroscope_ffi/ffikit/Cargo.toml index 18f908c2..b834ea5e 100644 --- a/pyroscope_ffi/ffikit/Cargo.toml +++ b/pyroscope_ffi/ffikit/Cargo.toml @@ -2,7 +2,7 @@ name = "ffikit" version = "0.1.0" edition = "2021" -rust-version = "1.63" +rust-version = "1.64" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pyroscope_ffi/python/lib/Cargo.lock b/pyroscope_ffi/python/lib/Cargo.lock index 7867d34f..5826e868 100644 --- a/pyroscope_ffi/python/lib/Cargo.lock +++ b/pyroscope_ffi/python/lib/Cargo.lock @@ -1570,7 +1570,7 @@ dependencies = [ [[package]] name = "pyroscope" -version = "0.5.6" +version = "0.5.7" dependencies = [ "json", "libc", diff --git a/pyroscope_ffi/python/lib/Cargo.toml b/pyroscope_ffi/python/lib/Cargo.toml index 686660c7..cc2f4d97 100644 --- a/pyroscope_ffi/python/lib/Cargo.toml +++ b/pyroscope_ffi/python/lib/Cargo.toml @@ -3,7 +3,7 @@ name = "pyroscope_ffi" version = "0.1.0" authors = ["Abid Omar "] edition = "2021" -rust-version = "1.63" +rust-version = "1.64" [lib] crate-type = ["cdylib"] diff --git a/pyroscope_ffi/python/scripts/docker.sh b/pyroscope_ffi/python/scripts/docker.sh index 18d9cf76..3e94af7f 100755 --- a/pyroscope_ffi/python/scripts/docker.sh +++ b/pyroscope_ffi/python/scripts/docker.sh @@ -1,17 +1,18 @@ #!/bin/bash set -ex -if [ "${BUILD_ARCH}" != "manylinux2010_x86_64" ] && [ "${BUILD_ARCH}" != "manylinux2014_aarch64" ]; +if [ "${BUILD_ARCH}" != "manylinux2014_x86_64" ] && [ "${BUILD_ARCH}" != "manylinux2014_aarch64" ]; then - echo set BUILD_ARCH to one of manylinux2010_x86_64 or manylinux2014_aarch64 + echo set BUILD_ARCH to one of manylinux2014_x86_64 or manylinux2014_aarch64 exit 239 fi BUILD_DIR="/work" MANYLINUX_PREFIX=pyroscope/rust_builder +MANYLINUX_VERSION=3 docker run \ -w /work/pyroscope_ffi/python \ -v `pwd`:/work \ - ${MANYLINUX_PREFIX}_${BUILD_ARCH} \ + ${MANYLINUX_PREFIX}_${BUILD_ARCH}:${MANYLINUX_VERSION} \ sh manylinux.sh diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml index 126cf305..f0edd48d 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml @@ -2,7 +2,7 @@ name = "rbspy" version = "0.1.0" edition = "2021" -rust-version = "1.63" +rust-version = "1.64" [lib] name = "rbspy" diff --git a/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml b/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml index e6cde635..c1361955 100644 --- a/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml @@ -2,7 +2,7 @@ name = "thread_id" version = "0.1.0" edition = "2021" -rust-version = "1.63" +rust-version = "1.64" [lib] name = "thread_id" diff --git a/pyroscope_ffi/ruby/scripts/docker.sh b/pyroscope_ffi/ruby/scripts/docker.sh index b1496111..cb94f3f9 100755 --- a/pyroscope_ffi/ruby/scripts/docker.sh +++ b/pyroscope_ffi/ruby/scripts/docker.sh @@ -1,23 +1,24 @@ #!/bin/bash set -ex -if [ "${BUILD_ARCH}" != "manylinux2010_x86_64" ] && [ "${BUILD_ARCH}" != "manylinux2014_aarch64" ]; +if [ "${BUILD_ARCH}" != "manylinux2014_x86_64" ] && [ "${BUILD_ARCH}" != "manylinux2014_aarch64" ]; then - echo set BUILD_ARCH to one of manylinux2010_x86_64 or manylinux2014_aarch64 + echo set BUILD_ARCH to one of manylinux2014_x86_64 or manylinux2014_aarch64 exit 239 fi BUILD_DIR="/work" MANYLINUX_PREFIX=pyroscope/rust_builder +MANYLINUX_VERSION=3 docker run \ -w /work/pyroscope_ffi/ruby/elflib/rbspy \ -v `pwd`:/work \ - ${MANYLINUX_PREFIX}_${BUILD_ARCH} \ + ${MANYLINUX_PREFIX}_${BUILD_ARCH}:${MANYLINUX_VERSION} \ sh manylinux.sh docker run \ -w /work/pyroscope_ffi/ruby/elflib/thread_id \ -v `pwd`:/work \ - ${MANYLINUX_PREFIX}_${BUILD_ARCH} \ + ${MANYLINUX_PREFIX}_${BUILD_ARCH}:${MANYLINUX_VERSION} \ sh manylinux.sh diff --git a/src/pyroscope.rs b/src/pyroscope.rs index b01741bb..6846ff28 100644 --- a/src/pyroscope.rs +++ b/src/pyroscope.rs @@ -853,4 +853,21 @@ pub fn parse_http_headers_json(http_headers_json: String) -> Result Result> { + let parsed = json::parse(&s)?; + if !parsed.is_array() { + return Err(PyroscopeError::AdHoc(format!("expected array, got {}", parsed))); + } + let mut res = Vec::new(); + res.reserve(parsed.len()); + for v in parsed.members() { + if v.is_string() { + res.push(v.to_string()); + } else { + return Err(PyroscopeError::AdHoc(format!("invalid element value, not a string: {}", v.to_string()))); + } + }; + return Ok(res); } \ No newline at end of file