GithubHelp home page GithubHelp logo

Comments (21)

jasonwhite avatar jasonwhite commented on May 5, 2024 3

We're working on it! We don't use Cargo internally and keeping two different build systems in sync is a little challenging.

from hermit.

rrnewton avatar rrnewton commented on May 5, 2024 2

Thanks for the investigation!! So ceee5bd probably builds for you on that arch setup then then? Reverting that business about the map_first_last feature.

@rnbguy, thanks again for your patience. Our external build was half baked here. (It builds fine and runs 750 integration tests, with buck, over in monorepo land ;-). ) We'll invest here to get this in good shape, buildable with Docker & Nix, and with images on dockerhub.

Also, of course, reenabling the barest level of build in CI (#13). Porting real integration tests will take a bit more work as described in the README.

from hermit.

rnbguy avatar rnbguy commented on May 5, 2024

adding the following lines in [dependencies] of hermit-verify/Cargo.toml resolves the use of undeclared crate or module `detcore` errors

detcore = { version = "0.0.0", path = "../detcore" }
edit-distance = { version = "0.0.0", path = "../common/edit-distance" }

but I still get could not find `preemptions` in `detcore` errors - which is weird. rust-analyzer can find the references all fine, but not cargo build.

error[E0432]: unresolved import `detcore::preemptions`
  --> tests/standalone/stacktrace_events.rs:13:14
   |
13 | use detcore::preemptions::PreemptionReader;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

error[E0432]: unresolved import `detcore::preemptions`
  --> tests/standalone/stacktrace_events.rs:14:14
   |
14 | use detcore::preemptions::PreemptionRecord;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

error[E0432]: unresolved import `detcore::Config`
  --> detcore/tests/testutils/src/lib.rs:18:5
   |
18 | use detcore::Config;
   |     ^^^^^^^^^^^^^^^ no `Config` in the root

error[E0432]: unresolved import `detcore::Detcore`
  --> detcore/tests/testutils/src/lib.rs:19:5
   |
19 | use detcore::Detcore;
   |     ^^^^^^^^^^^^^^^^ no `Detcore` in the root

error[E0432]: unresolved import `detcore::SchedHeuristic`
  --> detcore/tests/testutils/src/lib.rs:20:5
   |
20 | use detcore::SchedHeuristic;
   |     ^^^^^^^^^^^^^^^^^^^^^^^ no `SchedHeuristic` in the root

error[E0433]: failed to resolve: could not find `logdiff` in `detcore`
   --> detcore/tests/testutils/src/lib.rs:582:38
    |
582 |                 let str_a = detcore::logdiff::strip_log_entry(&x[ix]);
    |                                      ^^^^^^^ could not find `logdiff` in `detcore`

error[E0433]: failed to resolve: could not find `logdiff` in `detcore`
   --> detcore/tests/testutils/src/lib.rs:583:38
    |
583 |                 let str_b = detcore::logdiff::strip_log_entry(&filtered[ix]);

from hermit.

androm3da avatar androm3da commented on May 5, 2024

adding the following lines in [dependencies] of hermit-verify/Cargo.toml resolves the use of undeclared crate or module `detcore` errors

detcore = { version = "0.0.0", path = "../detcore" }
edit-distance = { version = "0.0.0", path = "../common/edit-distance" }

With those changes I get a smaller set of errors:

error[E0432]: unresolved import `detcore::preemptions`
  --> hermit-verify/src/internal/schedule_trace.rs:13:14
   |
13 | use detcore::preemptions::read_trace;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

error[E0432]: unresolved import `detcore::preemptions`
  --> hermit-verify/src/internal/schedule_trace.rs:14:14
   |
14 | use detcore::preemptions::PreemptionRecord;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

from hermit.

androm3da avatar androm3da commented on May 5, 2024

adding the following lines in [dependencies] of hermit-verify/Cargo.toml resolves the use of undeclared crate or module `detcore` errors

detcore = { version = "0.0.0", path = "../detcore" }
edit-distance = { version = "0.0.0", path = "../common/edit-distance" }

With those changes I get a smaller set of errors:

error[E0432]: unresolved import `detcore::preemptions`
  --> hermit-verify/src/internal/schedule_trace.rs:13:14
   |
13 | use detcore::preemptions::read_trace;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

error[E0432]: unresolved import `detcore::preemptions`
  --> hermit-verify/src/internal/schedule_trace.rs:14:14
   |
14 | use detcore::preemptions::PreemptionRecord;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

Hmm, oddly - on subsequent build attempts, several more build errors are reported.

from hermit.

rrnewton avatar rrnewton commented on May 5, 2024

Erk, sorry, looks like this JUST got messed up by a recent push. Bad timing.

@samth @rnbguy - does the prior commit, cacc346, work for you?

We'll stick a Dockerfile in there momentarily to address the libunwind dependence.

from hermit.

androm3da avatar androm3da commented on May 5, 2024

I get the same or substantially similar results when building cacc346

Both with or without this patch:

diff --git a/hermit-verify/Cargo.toml b/hermit-verify/Cargo.toml
index 36524c5..9ba41df 100644
--- a/hermit-verify/Cargo.toml
+++ b/hermit-verify/Cargo.toml
@@ -7,6 +7,8 @@ edition = "2021"
 
 [dependencies]
 anyhow = "1.0.65"
+detcore = { version = "0.0.0", path = "../detcore" }
+edit-distance = { version = "0.0.0", path = "../common/edit-distance" }
 clap = { version = "3.2.17", features = ["derive", "env", "regex", "unicode", "wrap_help"] }
 colored = "1.9"
 fbinit = { version = "0.1.2", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" }

from hermit.

androm3da avatar androm3da commented on May 5, 2024

FYI my nightly happens to be brand new, I suppose that could contribute.

nightly-x86_64-unknown-linux-gnu (overridden by '.../hermit/rust-toolchain.toml')
rustc 1.67.0-nightly (b7bc90fea 2022-11-21)

from hermit.

rnbguy avatar rnbguy commented on May 5, 2024

the detcore error persists on cacc346 at my side too. I tried local build and on an empty docker - both gave same results.

my nightly is also the latest.

from hermit.

rrnewton avatar rrnewton commented on May 5, 2024

Jeez, sorry about this. At the current main branch, 6cb5575, it cargo builds for me fine on a Centos Stream 8 server and Fedora 36 laptop (with libunwind). I'm trying this from the rust/ Debian base image:

git clone [email protected]:facebookexperimental/hermit.git
cd hermit
docker run --volume `pwd`:/build -it --rm --platform linux/amd64 rust:latest
apt-get update && apt-get install -y libunwind-dev
cd /build
cargo update # make sure there is enough memory
cargo build

(and having some trouble with cargo update getting OOM killed.. will update this in a moment)

from hermit.

androm3da avatar androm3da commented on May 5, 2024

Interesting. Does your cargo and rustc come from rustup? Or does debian have its own installation?

I had not tried cargo update before but it did not change the results.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          64318        6052        2420        1771       55845       55820
Swap:         32767        2928       29839

$ cargo build | tail
warning: skipping duplicate package `main` found at `/local/mnt/workspace/install/rust/git/checkouts/reverie-9a587e40a0d7d3be/6f03658/experimental/traceviz`
   Compiling hermetic_infra_hermit_tests v0.0.0 (/local/mnt/workspace/vp/hermit/tests)
   Compiling hermit v0.0.0 (/local/mnt/workspace/vp/hermit/hermit-cli)
   Compiling detcore-testutils v0.0.0 (/local/mnt/workspace/vp/hermit/detcore/tests/testutils)
error[E0432]: unresolved import `detcore::preemptions`
  --> tests/standalone/stacktrace_events.rs:13:14
   |
13 | use detcore::preemptions::PreemptionReader;
   |              ^^^^^^^^^^^ could not find `preemptions` in `detcore`

$ git show|head
commit 6cb5575ffd287289769144ec82e2900cbf6cd1ad
Author: Ryan Newton <[email protected]>
Date:   Tue Nov 22 15:20:46 2022 -0500

    Revert "tooling to compare schedules and run midpoints on CLI" (#12)
    
    This reverts commit 56f1390a474d3b123d8fc8d3e734410b593e04f9.

diff --git a/common/edit-distance/src/bubbles.rs b/common/edit-distance/src/bubbles.rs
index fb1ef9b..e3486c5 100644


from hermit.

rnbguy avatar rnbguy commented on May 5, 2024

I am using archlinux, and rustup for rust toolchains.

Anyway, using git bisect I found the earliest commit with a failed build - 66a93ab

Successful build on d37f732 🙂

from hermit.

rnbguy avatar rnbguy commented on May 5, 2024

Ah this is the culprit

#![cfg(not(version("1.66")))]

Removing this line builds everything all fine on current main 🎉

Maybe turn on the CI runs using cargo-action 🙂 Atleast the cargo build one.

- name: Build
working-directory: detcore-model
run: echo cargo build --verbose
- name: Run tests
working-directory: detcore-model
run: echo cargo test --verbose

from hermit.

samth avatar samth commented on May 5, 2024

That being the issue makes me think it's about the difference between what Debian installs for rust:latest and what rustup installs for nightly (I also used rustup).

from hermit.

androm3da avatar androm3da commented on May 5, 2024

I am using archlinux, and rustup for rust toolchains.

Anyway, using git bisect I found the earliest commit with a failed build - 66a93ab

Successful build on d37f732 🙂

This commit makes my build succeed but might be worth mentioning that there's a test failure. Not sure how significant it is.

test scheduler::test::test_my_thread_group1 ... FAILED
...
failures:

---- scheduler::test::test_my_thread_group1 stdout ----
thread 'scheduler::test::test_my_thread_group1' panicked at 'Unable to install global subscriber: SetGlobalDefaultError("a global default trace dispatcher has already been set")', /local/mnt/workspace/install/rust/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/fmt/mod.rs:1232:16


from hermit.

jasonwhite avatar jasonwhite commented on May 5, 2024

@androm3da Does it work with cargo test -- --test-threads=1?

Edit: Never mind. I can reproduce the failure as well. Looking into it!

from hermit.

rnbguy avatar rnbguy commented on May 5, 2024

main build is successful now.

$ cargo +nightly install --git https://github.com/facebookexperimental/hermit hermit
$ hermit run date
Sat Jan  1 12:59:59 AM CET 2000

🎉

from hermit.

androm3da avatar androm3da commented on May 5, 2024

@androm3da Does it work with cargo test -- --test-threads=1?

It does. However a different test fails when I use that command line.

$ cargo test -- --test-threads=1
...
test scheduler::replay_cursor::tests::test_peek_nth ... ok
test scheduler::replay_cursor::tests::test_peek_pair ... ok
test scheduler::replay_cursor::tests::test_peek_pair_empty ... ok
test scheduler::replay_cursor::tests::test_peek_pair_one ... ok
test scheduler::test::test_my_thread_group1 ... ok
test scheduler::test::test_my_thread_group2 ... FAILED
test syscalls::files::test::linux_flags_assumptions ... ok

failures:

---- scheduler::test::test_my_thread_group2 stdout ----
thread 'scheduler::test::test_my_thread_group2' panicked at 'Unable to install global subscriber: SetGlobalDefaultError("a global default trace dispatcher has already been set")', /local/mnt/workspace/install/rust/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/fmt/mod.rs:1232:16


failures:
    scheduler::test::test_my_thread_group2

test result: FAILED. 41 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s

error: test failed, to rerun pass `-p detcore --lib`

from hermit.

VladimirMakaev avatar VladimirMakaev commented on May 5, 2024

@androm3da Does it work with cargo test -- --test-threads=1?

It does. However a different test fails when I use that command line.

$ cargo test -- --test-threads=1
...
test scheduler::replay_cursor::tests::test_peek_nth ... ok
test scheduler::replay_cursor::tests::test_peek_pair ... ok
test scheduler::replay_cursor::tests::test_peek_pair_empty ... ok
test scheduler::replay_cursor::tests::test_peek_pair_one ... ok
test scheduler::test::test_my_thread_group1 ... ok
test scheduler::test::test_my_thread_group2 ... FAILED
test syscalls::files::test::linux_flags_assumptions ... ok

failures:

---- scheduler::test::test_my_thread_group2 stdout ----
thread 'scheduler::test::test_my_thread_group2' panicked at 'Unable to install global subscriber: SetGlobalDefaultError("a global default trace dispatcher has already been set")', /local/mnt/workspace/install/rust/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/fmt/mod.rs:1232:16


failures:
    scheduler::test::test_my_thread_group2

test result: FAILED. 41 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s

error: test failed, to rerun pass `-p detcore --lib`

We'll fix this particular issue soon. Currently we have a bit of desync problem with our internal repo but at least you can build and try hermit.

from hermit.

samth avatar samth commented on May 5, 2024

This now builds correctly for me (although I then experience #16) so I'm closing this.

from hermit.

sanmai-NL avatar sanmai-NL commented on May 5, 2024

@samth The official instructions are incomplete still, like you I had to install the libunwind-dev OS package under Debian Bullseye. Can you reopen this?

from hermit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.