#Permission Denied (os error 13)

97 messages · Page 1 of 1 (latest)

fossil magnet
#

I am doing 3 things and getting a permission denied error.
cargo new bevy-chess
cd bevy-chess
cargo run
This all works fine. It's only after I add bevy as a dependency that I start having problems.
cargo add bevy
cargo run

thread 'main' panicked at /home/ashensilverwolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alsa-sys-0.3.1/build.rs:13:18:
  Failed to run command `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "alsa"`, because: Permission denied (os error 13)
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Not sure what would be causing this, as I'm not using sudo commands at any point.
Any help would be appreciated.

#
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.76.0-nightly (49b3924bd 2023-11-27)`
woeful token
#

what does it say if you run

RUST_BACKTRACE=1 cargo run
fossil magnet
#
  --- stderr
  thread 'main' panicked at /home/ashensilverwolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "Failed to run command `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=\"1\" PKG_CONFIG_ALLOW_SYSTEM_LIBS=\"1\" \"pkg-config\" \"--libs\" \"--cflags\" \"libudev\"`, because: Permission denied (os error 13)"
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/49b3924bd4a34d3cf9c37b74120fba78d9712ab8/library/std/src/panicking.rs:645:5
     1: core::panicking::panic_fmt
               at /rustc/49b3924bd4a34d3cf9c37b74120fba78d9712ab8/library/core/src/panicking.rs:72:14
     2: core::result::unwrap_failed
               at /rustc/49b3924bd4a34d3cf9c37b74120fba78d9712ab8/library/core/src/result.rs:1649:5
     3: core::result::Result<T,E>::unwrap
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
woeful token
#

I'm not sure why this would happen when adding Bevy an a dependency since I never had to write

sudo cargo run

I wonder, are you using Windows with WSL2?

fossil magnet
#

Correct

woeful token
fossil magnet
#

Interesting

#

I'll try on another machine that's using native linux and see what happens

#

That breaks too.

#

It's running Linux Mint.
I followed the same order of operations that I did above.
It isn't a permission error, but is mentioning the same package; alsa.

fossil magnet
#

Just spun up a VM using Kali, got the same problem.

#

alsa seems to be the common denominator here.

woeful token
#

If you install alsa does it work?

fossil magnet
#

Good question

#

I don't even know how I would install it

#

There's obviously the crate for alsa, but that's a library, not a tool or anything that can be "installed".

#

other resources are pointing to it being the "Advanced Linux Sound Architecture", which sounds like a driver

woeful token
#

I never heard of it before but it looks like its something that is part of the linux kernel so shouldn't need installation

fossil magnet
#

I dunno if this is the problem though.
The "Permission Denied (os error 13)" was my original reason for posting here.
The alsa conspiracy only came up after testing on other platforms.

woeful token
#

what if you run the original command with sudo

fossil magnet
#

I suppose I could try it

#

sudo cargo run

woeful token
#

yeah

fossil magnet
#

I'll let you know how it goes, it's gonna take a while

#

fetching is already gonna be a minute or two

#

well this is funky

woeful token
#

aha

fossil magnet
#

i've got nothing for this

woeful token
#

update rustc

fossil magnet
#

it's on 1.76 nightly

woeful token
#

oh yeah I see

fossil magnet
#

hence why I'm confused lol

woeful token
#

maybe delete lock file

#

shot in the dark

fossil magnet
#

negative, chief

woeful token
#

maybe there is the rustc version for windows and the rustc version for WSL2 and its using the wrong one

fossil magnet
#

wait...

#

lemme wipe previous rustup installs, I might've borked something earlier

#

weirder problem

#

I uninstalled rust via rustup self uninstall, as instructed

#

now i'm reinstalling

#

i hate when problems become more problematic

woeful token
#

what happens if you check the rust version in powershell?

fossil magnet
#

doesn't exist

#

rustc : The term 'rustc' is not recognized as the name of a cmdlet, function, script file, or operable program.

#
rustc -V
woeful token
#

is there anything in the folder ~/.cargo/bin

#

in wsl

fossil magnet
#

.cargo/ does not exist as a directory within my user directory

woeful token
#

the page also mentions "During installation rustup will attempt to configure the PATH. Because of differences between platforms, command shells, and bugs in rustup, the modifications to PATH may not take effect until the console is restarted, or the user is logged out, or it may not succeed at all.

If, after installation, running rustc --version in the console fails, this is the most likely reason."

fossil magnet
#

that...

woeful token
#

I wonder if uninstalling also would require a restart

fossil magnet
#

good question

#

nope, still complaining

#

still a fair question

woeful token
#

what is inside /usr/bin since that is where the error message says the existing installation of Rust is

#

Also found this thread, if you scroll down a bit theres a post with 30 upvotes that might have a solution

fossil magnet
#

rust-clang, rust-lld, rust-llvm-dwp, rustc*, and cargo*

woeful token
#

if the github thread post doesn't fix it maybe delete all those folders

fossil magnet
#

pretty sure that issue was just to add the warning

#
warning: it looks like you have an existing installation of Rust at:
warning: /usr/bin
warning: It is recommended that rustup be the primary Rust installation.
warning: Otherwise you may have confusion unless you are careful with your PATH
warning: If you are sure that you want both rustup and your already installed Rust
warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes
warning: or pass `-y' to ignore all ignorable checks.
error: cannot install while Rust is installed
#

cleared the files/folders in question

#

not complaining

woeful token
#

nice

fossil magnet
#

cargo run still complaining about permissions

#

trying sudo

#
  --- stderr
  thread 'main' panicked at 'Could not run `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "alsa"`
  The pkg-config command could not be found.

  Most likely, you need to install a pkg-config package for your OS.
  Try `apt install pkg-config`, or `yum install pkg-config`,
  or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution.

  If you've already installed it, ensure the pkg-config command is one of the
  directories in the PATH environment variable.

  If you did not expect this build to link to a pre-installed system library,
  then check documentation of the alsa-sys crate for an option to
  build the library from source, or disable features or dependencies
  that require pkg-config.', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alsa-sys-0.3.1/build.rs:13:18
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#

back to alsa

#

this is now the same problem I had on Mint and Kali native systems

woeful token
#
apt install pkg-config
#

assuming thats ubuntu

#

from the color of the terminal

fossil magnet
#

correct

#

  --- stderr
  thread 'main' panicked at '`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "alsa"` did not exit successfully: exit status: 1
  error: could not find system library 'alsa' required by the 'alsa-sys' crate

  --- stderr
  Package alsa was not found in the pkg-config search path.
  Perhaps you should add the directory containing `alsa.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'alsa' found
  ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alsa-sys-0.3.1/build.rs:13:18
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#

and we're back to square one

woeful token
fossil magnet
#

pray for me

#

it worked

#

still refuses to cooperate when running w/o sudo

#

but it's something

woeful token
#

did it compile?

fossil magnet
#

yes

#

still need to address the original issue, which is permission

#

but thanks for helping me get this far in the first place

woeful token
#

no worries

fossil magnet
#

anything you have for the perms?

woeful token
#

I'm not really sure why it wants permissions, was the permissions a problem on Kali or Mint or just the alsa thing?

fossil magnet
#

permissions (so far) has only been a WSL thing

woeful token
fossil magnet
fossil magnet