bytehound icon indicating copy to clipboard operation
bytehound copied to clipboard

Nonstandard target dir affecting build

Open skeet70 opened this issue 4 years ago • 6 comments

I've set my global cargo target dir to a tmp directory to avoid thrashing my SSD and get faster builds. This is the first project I've encountered any issues with while building. I previously didn't have issues building this project, before I changed that setting. Setting CARGO_TARGET_DIR=target for just the build doesn't seem to fix it.

This is a build with .cargo/config set to

[build]
rustc-wrapper = "/home/mumu/.cargo/bin/sccache"
rustflags = ["-Clink-args=-fuse-ld=lld"]
target-dir = "/tmp/rust-builds"
λ ~/code/oss/memory-profiler/ master cargo +nightly build --release -p memory-profiler-cli
   Compiling serde v1.0.126
   Compiling actix-threadpool v0.1.2
   Compiling common v0.6.1 (/home/mumu/code/oss/memory-profiler/common)
   Compiling nwind v0.1.0 (https://github.com/koute/not-perf.git?rev=2d8a5ee#2d8a5ee3)
   Compiling phf v0.8.0
   Compiling server-core v0.6.1 (/home/mumu/code/oss/memory-profiler/server-core)
error: failed to run custom build command for `server-core v0.6.1 (/home/mumu/code/oss/memory-profiler/server-core)`

Caused by:
  process didn't exit successfully: `/tmp/rust-builds/release/build/server-core-39c38d9af2396655/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'failed to acquire a semaphore: "OpenOptions::open failed: entity not found"', server-core/build.rs:57:64
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Commenting out the target-dir line results in a successful server-core build, though I seem to get build errors in the yarn stuff too now, that's likely unrelated to this issue. https://github.com/koute/memory-profiler/issues/16#issuecomment-749396690 is another instance of someone seeming to run into this problem.

skeet70 avatar Aug 05 '21 18:08 skeet70

The yarn failure was due to a brainfart on my part where I accidentally forgot to commit the necessary file; it's fixed now.

As far as this issue, unfortunately I can't reproduce it. What filesystem are you using for your /tmp? Is it tmpfs?

koute avatar Aug 06 '21 08:08 koute

Yeah, tmpfs, on archlinux, with target-dir set in the user cargo config. I'll try to get some people at work to reproduce, there are a few folks spread out across Ubuntu, arch, and Mac.

skeet70 avatar Aug 06 '21 14:08 skeet70

I'm on manjaro (arch still kind of) and with the same configuration I get the same result as @skeet70

   Compiling actix-rt v0.2.6
error: failed to run custom build command for `server-core v0.7.0 (/home/colt/src/memory-profiler/server-core)`

Caused by:
  process didn't exit successfully: `/tmp/rust-builds/release/build/server-core-fef24ee3abc0908c/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'failed to acquire a semaphore: "OpenOptions::open failed: entity not found"', server-core/build.rs:57:64
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

my /tmp is also a tmpfs

tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=16144028k,nr_inodes=409600)

coltfred avatar Aug 10 '21 17:08 coltfred

Okay, I think it should be fixed now?

koute avatar Aug 11 '21 03:08 koute

cargo build --release -p bytehound-cli Compiling server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core) 00h00m00s 0/0: : error: failed to run custom build command for server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core)

Caused by: process didn't exit successfully: /home/gaokai/disk/zj/bytehound/target/release/build/server-core-b61c1c8448ee75b5/build-script-build (exit status: 101) --- stdout 0.32+git v10.19.0

--- stderr ERROR: [Errno 2] No such file or directory: 'install' thread 'main' panicked at 'Failed to install the dependencies for the WebUI; child process exited with error code Some(1)! You might want to try to run 'rm -Rf ~/.cache/yarn' and try again.', server-core/build.rs:91:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace 目前还出现这个问题,这个缺少的文件修复了吗

zhangji92 avatar May 07 '22 10:05 zhangji92

cargo build --release -p bytehound-cli Compiling server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core) 00h00m00s 0/0: : error: failed to run custom build command for server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core)

Caused by: process didn't exit successfully: /home/gaokai/disk/zj/bytehound/target/release/build/server-core-b61c1c8448ee75b5/build-script-build (exit status: 101) --- stdout 0.32+git v10.19.0

--- stderr ERROR: [Errno 2] No such file or directory: 'install' thread 'main' panicked at 'Failed to install the dependencies for the WebUI; child process exited with error code Some(1)! You might want to try to run 'rm -Rf ~/.cache/yarn' and try again.', server-core/build.rs:91:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace 目前还出现这个问题,这个缺少的文件修复了吗? 我cd WebUI目录之后yarn install还是报错,目前这个问题我需要怎么操作才能解决上述错误

zhangji92 avatar May 09 '22 02:05 zhangji92

cargo build --release -p bytehound-cli Compiling server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core) 00h00m00s 0/0: : error: failed to run custom build command for server-core v0.8.0 (/home/gaokai/disk/zj/bytehound/server-core)

Caused by: process didn't exit successfully: /home/gaokai/disk/zj/bytehound/target/release/build/server-core-b61c1c8448ee75b5/build-script-build (exit status: 101) --- stdout 0.32+git v10.19.0

--- stderr ERROR: [Errno 2] No such file or directory: 'install' thread 'main' panicked at 'Failed to install the dependencies for the WebUI; child process exited with error code Some(1)! You might want to try to run 'rm -Rf ~/.cache/yarn' and try again.', server-core/build.rs:91:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace 目前还出现这个问题,这个缺少的文件修复了吗? 我cd WebUI目录之后yarn install还是报错,目前这个问题我需要怎么操作才能解决上述错误

I solved it by upgrading yarn(1.12.19) and nodejs(16.20.0). https://github.com/koute/bytehound/issues/16#issuecomment-496812064

gamestart avatar May 17 '23 06:05 gamestart

@koute Okay, I think it should be fixed now?

I don't have the same computer/setup I did in the past to check super definitively. On my current system though set to the configuration that was problematic before, I can't reproduce. Seems fixed to me.

skeet70 avatar May 18 '23 18:05 skeet70