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

cargo installer trying to write to /etc (creating /etc/bash_completion.d) and failing as user on macos #116

Open
potanin opened this issue Jun 26, 2022 · 3 comments

Comments

@potanin
Copy link

potanin commented Jun 26, 2022

On the latest macos there is no /etc/bash_completion.d yet ./x.py build tries to mkdir /etc/bash_completion.d as per the error message below despite prefix in the config.toml set to a local home folder and not expecting it to write anything outside the user space.

This is doing "./x.py install" after a successful "./x.py build" with config set to have "extended=true" for all the tools to build and install and profile being "compiler".

...
Building stage2 tool cargo-credential-1password (aarch64-apple-darwin)
Compiling syn v1.0.91
Compiling serde_derive v1.0.125
Compiling serde v1.0.125
Compiling serde_json v1.0.59
Compiling cargo-credential-1password v0.1.0 (/Users/alex/Documents/GitHub/rust-lang/rust/src/tools/cargo/crates/credential/cargo-credential-1password)
Finished release [optimized] target(s) in 7.99s
Dist cargo-1.64.0-dev-aarch64-apple-darwin
finished in 5.046 seconds
Install cargo stage2 (Some(aarch64-apple-darwin))
install: creating uninstall script at /Users/alex/.local/lib/rustlib/uninstall.sh
install: installing component 'cargo'
mkdir: /etc/bash_completion.d: Permission denied
install: error: directory creation failed. see logs at '/Users/alex/.local/lib/rustlib/install.log'
Build completed unsuccessfully in 0:06:36

The prefix is set to "/Users/alex/.local" FYI.

Here is the install.log FYI:

$ umask 022 && mkdir -p "/Users/alex/.local/lib/rustlib"
$ echo "3" > "/Users/alex/.local/lib/rustlib/rust-installer-version"
install: creating uninstall script at /Users/alex/.local/lib/rustlib/uninstall.sh
$ cp /Users/alex/Documents/GitHub/rust-lang/rust/build/tmp/tarball/cargo/aarch64-apple-darwin/cargo-1.64.0-dev-aarch64-apple-darwin/install.sh /Users/alex/.local/lib/rustlib/uninstall.sh
install: installing component 'cargo'
$ echo "cargo" >> "/Users/alex/.local/lib/rustlib/components"
$ umask 022 && mkdir -p "/Users/alex/.local/bin"
install: copying file /Users/alex/.local/bin/cargo
$ cp /Users/alex/Documents/GitHub/rust-lang/rust/build/tmp/tarball/cargo/aarch64-apple-darwin/cargo-1.64.0-dev-aarch64-apple-darwin/cargo/bin/cargo /Users/alex/.local/bin/cargo
$ chmod 755 /Users/alex/.local/bin/cargo
$ echo "file:/Users/alex/.local/bin/cargo" >> "/Users/alex/.local/lib/rustlib/manifest-cargo"
$ umask 022 && mkdir -p "/Users/alex/.local/libexec"
install: copying file /Users/alex/.local/libexec/cargo-credential-1password
$ cp /Users/alex/Documents/GitHub/rust-lang/rust/build/tmp/tarball/cargo/aarch64-apple-darwin/cargo-1.64.0-dev-aarch64-apple-darwin/cargo/libexec/cargo-credential-1password /Users/alex/.local/libexec/cargo-credential-1password
$ chmod 755 /Users/alex/.local/libexec/cargo-credential-1password
$ echo "file:/Users/alex/.local/libexec/cargo-credential-1password" >> "/Users/alex/.local/lib/rustlib/manifest-cargo"
$ umask 022 && mkdir -p "/Users/alex/.local/libexec"
install: copying file /Users/alex/.local/libexec/cargo-credential-macos-keychain
$ cp /Users/alex/Documents/GitHub/rust-lang/rust/build/tmp/tarball/cargo/aarch64-apple-darwin/cargo-1.64.0-dev-aarch64-apple-darwin/cargo/libexec/cargo-credential-macos-keychain /Users/alex/.local/libexec/cargo-credential-macos-keychain
$ chmod 755 /Users/alex/.local/libexec/cargo-credential-macos-keychain
$ echo "file:/Users/alex/.local/libexec/cargo-credential-macos-keychain" >> "/Users/alex/.local/lib/rustlib/manifest-cargo"
$ umask 022 && mkdir -p "/etc/bash_completion.d"
install: error: directory creation failed. see logs at '/Users/alex/.local/lib/rustlib/install.log'

@potanin
Copy link
Author

potanin commented Jun 27, 2022

I could obviously fix it by sudo creating the required /etc/bash_completion.d and sudo chmod it to o=rwx to let it install successfully but this does not seem right to me.

@correabuscar
Copy link

The Gentoo-specific bug related to this, is here https://bugs.gentoo.org/689562

@sleak-lbl
Copy link

I hit the same problem and eventually worked out that I can get past it by adding --sysconfdir=/place/i/can/write/to to my ./configure options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants