Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage to CI #29

Open
gussmith23 opened this issue Sep 30, 2020 · 13 comments
Open

Add code coverage to CI #29

gussmith23 opened this issue Sep 30, 2020 · 13 comments
Labels
continuous integration Issues of Continuous Integration (aka Github Actions) good first issue Good for newcomers

Comments

@gussmith23
Copy link
Owner

No description provided.

@gussmith23 gussmith23 added good first issue Good for newcomers continuous integration Issues of Continuous Integration (aka Github Actions) labels Sep 30, 2020
@u5surf
Copy link

u5surf commented Oct 1, 2020

@gussmith23
Hi, Can I try to work in this issue?

@u5surf
Copy link

u5surf commented Oct 1, 2020

@gussmith23
First, I'm trying to get coverage with grcov (https://github.com/mozilla/grcov)
It can get the coverage reports as follow:

  • using nightly toolchain rustup install nightly && rustup default nightly can be resolved
  • cargo build with some envs.
  • also, executing cargo test.

But the build phase, it' occurred the build failure with following the messasges. Now I'm not sure how to resolve these errors.

docker run -e CARGO_INCREMENTAL=0 -e RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflo
w-checks=off -Zpanic_abort_tests -Cpanic=abort" -e RUSTDOCFLAGS="-Cpanic=abort" -it glenside  rustup default nightly && cargo build
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-10-01, rust version 1.48.0-nightly (ef663a8a4 2020-09-30)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)  11.4 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
 21.8 MiB /  21.8 MiB (100 %)  11.4 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  11.5 MiB/s in  5s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: Defaulting to 500.0 MiB unpack ram
info: installing component 'clippy'
info: installing component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)   6.1 MiB/s in  1s ETA:  0s
info: installing component 'rust-std'
 21.8 MiB /  21.8 MiB (100 %)   9.9 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  11.0 MiB/s in  5s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu installed - rustc 1.48.0-nightly (ef663a8a4 2020-09-30)

   Compiling tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3b6edf9e)
The following warnings were emitted during compilation:

warning: couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
warning: set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

error: failed to run custom build command for `tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b
2#3b6edf9e)`

Caused by:
  process didn't exit successfully: `/home/u5surf/glenside/target/debug/build/tvm-sys-86087355e93fe9d9/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=TVM_HOME
  cargo:rustc-link-lib=dylib=tvm
  cargo:rustc-link-search=/home/u5surf/.cargo/git/checkouts/incubator-tvm-4920fa2689ba3c60/3b6edf9/build
  cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
  cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'li
bclang.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /home/u5surf/.cargo/re
gistry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/lib.rs:1731:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It said that libclang.so could not found, thus, it doubt that libclang-dev's versions is old in the docker container

 docker run -it glenside apt install -y libclang-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libclang-dev is already the newest version (1:6.0-41~exp5~ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@gussmith23
Copy link
Owner Author

docker run -e CARGO_INCREMENTAL=0 -e RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflo w-checks=off -Zpanic_abort_tests -Cpanic=abort" -e RUSTDOCFLAGS="-Cpanic=abort" -it glenside rustup default nightly && cargo build

I think this runs the first command (rustup default nightly) in the container, but the second not in the container! at least that's my guess; I suspect that the docker command is not getting anything after the &&.

@gussmith23
Copy link
Owner Author

excited to have help on this by the way! thanks so much!

@u5surf
Copy link

u5surf commented Oct 1, 2020

@gussmith23
Humm.., although I used bin/bash -c "command1 && command2" instead of , it also failed the same reasons.
c.f docker run multiple commands
https://stackoverflow.com/questions/28490874/docker-run-image-multiple-commands

docker run -e CARGO_INCREMENTAL=0 -e RUSTFLAGS="-C link-args=-Wl,-rpath,/tvm/build -Zpro
file -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" -e RUSTDO
CFLAGS="-Cpanic=abort" -it glenside  /bin/bash -c "rustup default nightly && cargo build"
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-10-01, rust version 1.48.0-nightly (ef663a8a4 2020-09-30)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)  11.4 MiB/s in  1s ETA:  0s^[[D
info: downloading component 'rust-std'
 21.8 MiB /  21.8 MiB (100 %)  11.4 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  11.4 MiB/s in  5s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: Defaulting to 500.0 MiB unpack ram
info: installing component 'clippy'
info: installing component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)   6.3 MiB/s in  1s ETA:  0s
info: installing component 'rust-std'
 21.8 MiB /  21.8 MiB (100 %)  10.0 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  11.0 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu installed - rustc 1.48.0-nightly (ef663a8a4 2020-09-30)

    Updating crates.io index
    Updating git repository `https://github.com/mwillsey/egg`
    Updating git repository `https://github.com/mwillsey/incubator-tvm`
    Updating git submodule `https://github.com/agauniyal/rang`
    Updating git submodule `https://github.com/apache/incubator-tvm-vta`
    Updating git submodule `https://github.com/dmlc/dlpack`
    Updating git submodule `https://github.com/dmlc/dmlc-core`
  Downloaded anyhow v1.0.32
  Downloaded indexmap v1.6.0
   Compiling rand_distr v0.2.2
   Compiling py_literal v0.2.2
   Compiling goblin v0.2.3
   Compiling zip v0.5.8
   Compiling tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3b6e
df9e)
   Compiling env_logger v0.3.5
   Compiling ndarray-rand v0.11.0
   Compiling ndarray-npy v0.6.0
   Compiling test-logger v0.1.0
   Compiling tvm-macros v0.1.1 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3
b6edf9e)
error: failed to run custom build command for `tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b
6b3ab6a91174e7e2aa321cd8ec9b2#3b6edf9e)`

Caused by:
  process didn't exit successfully: `/root/glenside/target/debug/build/tvm-sys-86087355e93fe9d9/build-script-build` (sig
nal: 6, SIGABRT: process abort signal)
  --- stdout
  cargo:rerun-if-env-changed=TVM_HOME
  cargo:rustc-link-lib=dylib=tvm
  cargo:rustc-link-search=/root/tvm/build
warning: build failed, waiting for other jobs to finish...
error: build failed
...

@gussmith23
Copy link
Owner Author

gussmith23 commented Oct 2, 2020

This doesn't work for you? It works for me.

docker run -e CARGO_INCREMENTAL=0 -e RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" -e RUSTDOCFLAGS="-Cpanic=abort" -it glenside /bin/bash -c "rustup default nightly && cargo build"

@u5surf
Copy link

u5surf commented Oct 2, 2020

@gussmith23

I attempted your docket command, but it ‘s same failure. it seems that tvm-macro build failure.
as follow:


docker run -e CARGO_INCREMENTAL=0 -e RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" -e RUSTDOCFLAGS="-Cpanic=abort" -it glenside /bin/bash -c "rustup default nightly && cargo build"
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-10-02, rust version 1.48.0-nightly (8fe73e80d 2020-10-01)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)  11.4 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
 21.9 MiB /  21.9 MiB (100 %)  11.4 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  11.4 MiB/s in  5s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: Defaulting to 500.0 MiB unpack ram
info: installing component 'clippy'
info: installing component 'rust-docs'
 13.3 MiB /  13.3 MiB (100 %)   6.6 MiB/s in  2s ETA:  0s
info: installing component 'rust-std'
 21.9 MiB /  21.9 MiB (100 %)  10.2 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  10.9 MiB/s in  5s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu installed - rustc 1.48.0-nightly (8fe73e80d 2020-10-01)

    Updating crates.io index

...
   Compiling zip v0.5.8
   Compiling goblin v0.2.3
   Compiling tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3b6edf9e)
   Compiling env_logger v0.3.5
   Compiling ndarray-rand v0.11.0
   Compiling ndarray-npy v0.6.0
   Compiling test-logger v0.1.0
   Compiling tvm-macros v0.1.1 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3b6edf9e)
error: failed to run custom build command for `tvm-sys v0.1.0 (https://github.com/mwillsey/incubator-tvm?rev=3b6edf9ec0b6b3ab6a91174e7e2aa321cd8ec9b2#3b6edf9e)`

Caused by:
  process didn't exit successfully: `/root/glenside/target/debug/build/tvm-sys-86087355e93fe9d9/build-script-build` (signal: 6, SIGABRT: process abort signal)
  --- stdout
  cargo:rerun-if-env-changed=TVM_HOME
  cargo:rustc-link-lib=dylib=tvm
  cargo:rustc-link-search=/root/tvm/build
warning: build failed, waiting for other jobs to finish...
error: build failed

@gussmith23
Copy link
Owner Author

gussmith23 commented Oct 2, 2020 via email

@u5surf
Copy link

u5surf commented Oct 3, 2020

I attempted check in new origin/HEAD which commit id is
3395aa7e24b736013b63abdcb8f5bfff1e6f1b5a(is it correct?), although it was still same result...

@gussmith23
Copy link
Owner Author

That's correct!

Another dumb question, but are you rerunning the Docker build? You may need to rerun it from scratch without caching:

docker build --no-cache --tag glenside .

The error you're getting is different now...a sigabrt. that's a little concerning... not sure what's going on!

What OS are you running? I know this works on Mac and Linux at least, but no idea about windows!

Do you have enough free space on your machine? Things can act up when you're running out of space: try running docker container prune and docker image prune.

@u5surf
Copy link

u5surf commented Oct 4, 2020

@gussmith23
Unfortunately,It was to be the same results with —no-cache building its docker container again after all the containers and images were destroyed docker system prune -f

This is my localhost configurations
Do you consider this is enough for it?

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            472M     0  472M   0% /dev
tmpfs            99M  612K   98M   1% /run
/dev/vda3        46G   18G   26G  41% /
tmpfs           493M     0  493M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           493M     0  493M   0% /sys/fs/cgroup
tmpfs            99M     0   99M   0% /run/user/1001
 free -h
              total        used        free      shared  buff/cache   available
Mem:           985M        120M        208M         68K        656M        723M
Swap:          4.0G         80M        3.9G
cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

@gussmith23
Copy link
Owner Author

Yeah, that should be fine! I'm really scratching my head at this one.

My next debugging step would be to build this without the Docker. I suggest following the steps in the Dockerfile on your own machine. Install LLVM if you don't have it, clone and build the specific branch of TVM, and then try building Glenside.

I'm sorry this is such a hassle. I'm utterly perplexed by the SIGABRT coming out of the TVM Rust build script. CC @mwillsey @jroesch as people who work on the Rust bindings. Maybe they might know where the error's coming from...

@gussmith23
Copy link
Owner Author

Btw, you could also make this easier on yourself by using the --no-default-features with cargo, when you run it on your machine. Then you won't have to install TVM/LLVM! You're getting build errors because of TVM, which is not actually needed for what you're trying to do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous integration Issues of Continuous Integration (aka Github Actions) good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants