moon icon indicating copy to clipboard operation
moon copied to clipboard

[bug] Failed to execute typeshare and stream and capture output

Open prabirshrestha opened this issue 1 year ago • 2 comments

Running typeshare command results int the following error. This works for the first time but next push fails to build consistently.

  typeshare-typescript:
    command: typeshare crates/server --lang=typescript --output-file=apps/client/src/models/models.generated.ts
    inputs:
      - crates/server/src/models/*.rs
    outputs:
      - apps/client/src/models/models.generated.ts
rust:
  version: '1.74.1' # renovate: datasource=github-releases depName=rust-lang/rust
  # List of Cargo binaries to install globally and make available to tasks.
  bins:
    - bin: '[email protected]'
      local: true
    - bin: '[email protected]'
      local: true
    - '[email protected]'
    - '[email protected]'
  components:
    - 'clippy'
    - 'rust-analyzer'
  # Sync the configured version above as a channel to the root `rust-toolchain.toml` config.
  syncToolchainConfig: true
[TRACE 31:54.703] moon_action_graph::action_graph:run  Running action  index=10 deps=[7, 6]
[TRACE 31:54.703] moon_action_graph::action_graph  Marking action as complete  index=4
[DEBUG 31:54.703] moon_cache_item::cache_item  Cache miss, item does not exist  cache="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/typeshare-typescript/lastRun.json"
[DEBUG 31:54.703] log  Running task objstor:typeshare-typescript  log.target="moon:action:run-task" log.module_path="moon_action_pipeline::actions::run_task" log.file="crates/core/action-pipeline/src/actions/run_task.rs" log.line=34
[TRACE 31:54.703] moon_hash::hasher  Created new content hasher  label="Run objstor:typeshare-typescript target"
[DEBUG 31:54.710] moon_process::command_inspector  Running command git hash-object --stdin-paths - (truncated)  env_vars={} working_dir="/tmp/github-runner-objstor/objstor/objstor"
[TRACE 31:54.712] moon_hash::hasher  Adding content to hasher  label="Run objstor:typeshare-typescript target"
[TRACE 31:54.712] log  Loading /tmp/github-runner-objstor/objstor/objstor/Cargo.lock  log.target="moon:lang:config" log.module_path="moon_rust_lang::cargo_lock::cache_container" log.file="crates/rust/lang/src/cargo_lock.rs" log.line=13
[TRACE 31:54.730] moon_hash::hasher  Adding content to hasher  label="Run objstor:typeshare-typescript target"
[DEBUG 31:54.731] moon_hash::hasher  Generated content hash  label="Run objstor:typeshare-typescript target" hash="a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb"
[DEBUG 31:54.731] log  Generated hash a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb for target objstor:typeshare-typescript  log.target="moon:runner" log.module_path="moon_runner::runner" log.file="crates/core/runner/src/runner.rs" log.line=533
[DEBUG 31:54.731] moon_hash::hasher  Using cached content hash (previously generated)  hash="a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb" label="Run objstor:typeshare-typescript target"
[DEBUG 31:54.731] moon_hash::hash_engine  Saving hash manifest  label="Run objstor:typeshare-typescript target" manifest="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/hashes/a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb.json"
[TRACE 31:54.731] starbase_utils::fs  Writing file  file="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/hashes/a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb.json"
[DEBUG 31:54.731] log  Cache miss for hash a9182a6c48263118a7fa21bf062398beb856a5a08381e4a9b5a81e2f08bad4bb, continuing run  log.target="moon:runner" log.module_path="moon_runner::runner" log.file="crates/core/runner/src/runner.rs" log.line=597
[DEBUG 31:54.731] log  Creating objstor:typeshare-typescript command (in working directory /tmp/github-runner-objstor/objstor/objstor)  log.target="moon:runner" log.module_path="moon_runner::runner" log.file="crates/core/runner/src/runner.rs" log.line=240
[DEBUG 31:54.731] moon_process::command_inspector  Running command typeshare crates/server --lang=typescript --output-file=apps/client/src/models/models.generated.ts  env_vars={"MOON_PROJECT_SOURCE": ".", "MOON_TOOLCHAIN_DIR": "/root/.proto", "MOON_PROJECT_SNAPSHOT": "/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/snapshot.json", "MOON_TARGET": "objstor:typeshare-typescript", "MOON_PROJECT_ID": "objstor", "MOON_WORKSPACE_ROOT": "/tmp/github-runner-objstor/objstor/objstor", "MOON_CACHE_DIR": "/tmp/github-runner-objstor/objstor/objstor/.moon/cache", "MOON_PROJECT_ROOT": "/tmp/github-runner-objstor/objstor/objstor", "MOON_WORKING_DIR": "/tmp/github-runner-objstor/objstor/objstor"} working_dir="/tmp/github-runner-objstor/objstor/objstor"
▪▪▪▪ objstor:typeshare-typescript
[DEBUG 31:54.734] moon_cache_item::cache_item  Writing cache item  cache="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/typeshare-typescript/lastRun.json"
[TRACE 31:54.734] starbase_utils::json  Stringifying JSON  file="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/typeshare-typescript/lastRun.json"
[TRACE 31:54.734] starbase_utils::fs  Creating directory  dir="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/typeshare-typescript"
[TRACE 31:54.734] starbase_utils::fs  Writing file  file="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/objstor/typeshare-typescript/lastRun.json"
[TRACE 31:54.734] moon_action_graph::action_graph  Marking action as complete  index=10
[DEBUG 31:54.734] moon_cache_item::cache_item:check_for_new_version  Cache miss, item does not exist  cache="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/moonVersion.json"
[DEBUG 31:54.734] moon_api::launchpad:check_for_new_version  Checking for a new version of moon  current_version="1.18.5"
[TRACE 31:54.747] starbase_utils::fs:check_for_new_version  Reading file  file="/root/.moon/id"
[TRACE 31:54.747] starbase_utils::fs:check_for_new_version  Traversing upwards to find a file/root  file=".moon" dir="/tmp/github-runner-objstor/objstor/objstor"
[DEBUG 31:55.265] moon_cache_item::cache_item:check_for_new_version  Writing cache item  cache="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/moonVersion.json"
[TRACE 31:55.265] starbase_utils::json:check_for_new_version  Stringifying JSON  file="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/moonVersion.json"
[TRACE 31:55.265] starbase_utils::fs:check_for_new_version  Writing file  file="/tmp/github-runner-objstor/objstor/objstor/.moon/cache/states/moonVersion.json"
[TRACE 31:55.266] starbase::app  Running shutdown phase with 1 systems 
Error: process::capture_stream::failed

  × Failed to execute typeshare and stream and capture output.
  ╰─▶ No such file or directory (os error 2)

Error: Process completed with exit code 1.

prabirshrestha avatar Dec 23 '23 07:12 prabirshrestha

@prabirshrestha Where is typeshared located? It's failing with No such file or directory, which means either typeshare can't be found, or bin that typeshare uses can't be found.

If you run with MOON_DEBUG_PROCESS_ENV=true, it'll show the PATH used for the task.

milesj avatar Dec 23 '23 19:12 milesj

Doesn't seem like it logs for bins. It only logs of rust and node.

rust:
  version: '1.75.0' # renovate: datasource=github-releases depName=rust-lang/rust
  # List of Cargo binaries to install globally and make available to tasks.
  bins:
    - bin: '[email protected]'
      local: true
    - bin: '[email protected]'
      local: true
    - '[email protected]'
    - '[email protected]'
[DEBUG 44:09.980] log  Installing Cargo binaries: [email protected], [email protected], [email protected], [email protected]  log.target="moon:rust-platform" log.module_path="moon_rust_platform::rust_platform" log.file="crates/rust/platform/src/rust_platform.rs" log.line=297
[DEBUG 44:09.980] moon_process::command_inspector  Running command /bin/sh -c cargo binstall --no-confirm --log-level info [email protected]  env_vars={"PATH": "/root/.proto/tools/proto/0.25.3:/root/.proto/shims:/root/.proto/bin:/root/.moon/bin:/root/.cargo/bin:/root/.proto/shims:/root/.proto/bin:/root/.cargo/bin:/opt/hostedtoolcache/zig/0.11.0/x64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/actions-runner"} working_dir="/_work/objstor-runer/objstor/objstor"
 INFO typeshare-cli v1.7.0 is already installed, use --force to override
 INFO Done in 1.471712ms
ls $HOME/.cargo/bin
cargo
cargo-binstall
cargo-clippy
cargo-fmt
cargo-miri
clippy-driver
rls
rust-analyzer
rustc
rustdoc
rustfmt
rust-gdb
rust-gdbgui
rust-lldb
rustup

prabirshrestha avatar Jan 01 '24 05:01 prabirshrestha

Is this still an issue in the latest versions?

milesj avatar Mar 25 '24 23:03 milesj

Gonna close this as no one else seems to be reporting anything liek this.

milesj avatar Apr 21 '24 05:04 milesj