SkyAPM / SkyAPM-php-sdk

Replaced by https://github.com/apache/skywalking-php
https://skywalking.apache.org/
Apache License 2.0
421 stars 104 forks source link

[5.0.0] Impossible to build offline #493

Closed remicollet closed 2 years ago

remicollet commented 2 years ago

The build system seems terrible (and fragile) as it downloads tons of things, so it cannot be run offline.

Version 4.x was buildable with some hack to use system grpc

FYI, I will have to stop providing RPMs of this extension for Fedora/RHEL/CentOS...

And even online a try fails...

...
   Compiling ipc-channel v0.16.0
   Compiling hyper v0.14.18
   Compiling SkyAPM-php-sdk v1.0.0 (/dev/shm/BUILD/php-pecl-skywalking-5.0.0/NTS)
error: failed to run custom build command for `SkyAPM-php-sdk v1.0.0 (/dev/shm/BUILD/php-pecl-skywalking-5.0.0/NTS)`

Caused by:
  process didn't exit successfully: `/dev/shm/BUILD/php-pecl-skywalking-5.0.0/NTS/target/release/build/SkyAPM-php-sdk-5089d13374504935/build-script-build` (exit status: 1)
  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: ./src/protocol/: warning: directory does not exist.\nCould not make proto path relative: ./src/protocol/language-agent/Tracing.proto: No such file or directory\n" }
warning: build failed, waiting for other jobs to finish...
helingfeng commented 2 years ago
git submodule update --init --recursive
remicollet commented 2 years ago

I mean using the pecl archive https://pecl.php.net/get/skywalking-5.0.0.tgz

heyanlong commented 2 years ago

@remicollet I upgrade now to fix this. Hope to continue providing RPMs on Fedora/RHEL/CentOS

heyanlong commented 2 years ago

@remicollet I tested it and release a new version https://pecl.php.net/get/skywalking-5.0.1.tgz

remicollet commented 2 years ago

Doesn't solve the main issue "Impossible to build offline"


    Updating crates.io index
warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
warning: spurious network error (1 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
error: Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
remicollet commented 2 years ago

The possible ways for packaging

and use system registry, i.e. /usr/share/cargo/registry

Problem: some dependencies are not available (ipc-channel, tonic, local-ip-address)

And rust is out of my skills

Terribly big (~300MB)

Against all good practices Sounds terrible, and be will very long

remicollet commented 2 years ago

I use "2" as a temporary workaround (but this is only a workaround)

So https://twitter.com/RemiRepository/status/1542505699619373056

BTW:

heyanlong commented 2 years ago

I try the Rust vendor and delete Win32 api https://github.com/rust-lang/cargo/issues/7058, final get ~140MB vendor, is it ok if vendor packed to PECL?

heyanlong commented 2 years ago

@jmjoy Is there a way to reduce the vendor

remicollet commented 2 years ago

@heyanlong indeed using the vendor feature helps a lot reducing sources size from 300MB to 30Mb

is it ok if vendor packed to PECL?

don't know ;) using bundled library is still bad practice (especially from packaging PoV) and, as explained, only a workaround

don't know if other users really care, as "pecl install" is working online by design ;)

jmjoy commented 2 years ago

@jmjoy Is there a way to reduce the vendor

Archive the vendor directory and unarchive when build?

heyanlong commented 2 years ago

@jmjoy Good idea, maybe just do this

wu-sheng commented 2 years ago

Fixed through https://github.com/SkyAPM/SkyAPM-php-sdk/commit/edd699cfa1220f6b0221f8a6753d05628a563085 in 5.0.1