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

What is the purpose of sysconfdir in rust installation? #130270

Closed
alitariq4589 opened this issue Sep 12, 2024 · 5 comments
Closed

What is the purpose of sysconfdir in rust installation? #130270

alitariq4589 opened this issue Sep 12, 2024 · 5 comments
Labels
D-confusing Diagnostics: Confusing error or lint that should be reworked. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@alitariq4589
Copy link

I am trying to build rust master branch from source on RISC-V architecture. On, execution of ./x.py install, I get the following error:

Building bootstrap
   Compiling bootstrap v0.0.0 (/home/user/Downloads/rust-1.81.0/rust/rust/src/bootstrap)
    Finished `dev` profile [unoptimized] target(s) in 36.42s
WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
NOTE: to silence this warning, add `change-id = 129473` at the top of `config.toml`
warning: unable to check if origin/master is old due to error: No such file or directory (os error 2)
warning: origin/master is used to determine if files have been modified
warning: if it is not updated, this may cause files to be needlessly reformatted
DESTDIR is set to: "/etc"
thread 'main' panicked at src/core/build_steps/install.rs:92:9:
User doesn't have write access on `install.sysconfdir` path in `config.toml`.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:39

The sysconfdir is set to /etc and why does it require the write access? This kills the whole purpose of building from source (i.e. building in specific user space)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2024
@ChrisDenton
Copy link
Member

Note that you can change these values. Look at the [install] section in config.example.toml and copy/paste to config.toml, changing the values as desired. You can also override them on the command line, e.g. with:
./x.py install --set install.sysconfdir=??? (you'd probably also want to change install.prefix too).

Installing machine-wide (rather than per user) is also a typical default for many projects when you do make && make install without configuring the output dir.

@alitariq4589
Copy link
Author

@ChrisDenton Thanks for the response.

Then I assume these configuration files can be installed in any location as the user desires and will not alter the installation process.

I already modified the install.prefix but it didn't change sysconfdir, so it struck me as an anomaly that I tried installing the package in the location where root/sudo privileges are not required but it still asked me for elevated privileges.

I think, it should be mentioned in the documentation explicitly, that if you want to build and store the binaries in a user-specific location instead of the system default location, then install.prefix AND install.sysconfdir both be changed via the command line.

@workingjubilee
Copy link
Member

Please PR any improvements to the documentation that you desire.

@lolbinarycat lolbinarycat added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) D-confusing Diagnostics: Confusing error or lint that should be reworked. labels Sep 14, 2024
@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 14, 2024
@iyernaveenr
Copy link
Contributor

iyernaveenr commented Sep 29, 2024

Please PR any improvements to the documentation that you desire.

I also ran into this issue. Since no PR has been made yet as recommended above, I made one. Please find the PR below:
#131001

Thanks!

@jieyouxu
Copy link
Member

Closing as PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-confusing Diagnostics: Confusing error or lint that should be reworked. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

8 participants