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

split build into build and install #429

Open
ynikitenko opened this issue Apr 2, 2020 · 15 comments
Open

split build into build and install #429

ynikitenko opened this issue Apr 2, 2020 · 15 comments

Comments

@ynikitenko
Copy link

Every time I use kiwix-build I have to enter my sudo password. During some short period I don't have to re-enter that. However, due to many errors, I have to enter it many times.
This is an enhancement proposal to separate build into several phases: first build (without root permissions), then install (special permissions needed).
An optional zero phase may be to install dependencies or system or pip packages with root permissions.

@kelson42
Copy link
Contributor

kelson42 commented Apr 2, 2020

@mgautierfr What this sudo is for?

@ynikitenko
Copy link
Author

Before asking sudo password it prints a line like this:

sudo dnf install pkg-config glibc-static libstdc++-static xz-static

(so I think this is the command to be executed).

@kelson42
Copy link
Contributor

kelson42 commented Apr 2, 2020

@ynikitenko This make sense to use sudo there, but this should happen only one time.

@kelson42
Copy link
Contributor

kelson42 commented Apr 2, 2020

@ynikitenko I see in the code that there is a checker code, so sudo should not be called each time you run kiwix-build. I believe your installation of packages is never done properly... or something else happen.

The checker line should be here:

rpm -q --quiet pkg-config glibc-static libstdc++-static xz-static

@kelson42 kelson42 self-assigned this Apr 2, 2020
@ynikitenko
Copy link
Author

@kelson42 thanks for the prompt reply. Yes, I'm struggling to install kiwix-desktop, and I have many errors during that. If I had to enter sudo only once, that would not be an issue (frankly speaking that's not the worst thing, so I'm calling this issue an enhancement, not a bug).

@ynikitenko
Copy link
Author

@kelson42 you're right. It seems that pkg-config is reinstalled every time. I don't know why it happens. dnf in the normal environment says that it is installed.
kiwix-build tries to reinstall that and prints

Package pkgconf-pkg-config-1.5.3-2.fc29.x86_64 is already installed.

@kelson42
Copy link
Contributor

kelson42 commented Apr 3, 2020

@ynikitenko If you run manually

rpm -q --quiet pkg-config glibc-static libstdc++-static xz-static ; echo $?

What is displayed?

@ynikitenko
Copy link
Author

ynikitenko commented Apr 3, 2020

@kelson42 1.
If I run without --quiet, it prints

package pkg-config is not installed

(and other packages, which are installed).

@mgautierfr
Copy link
Member

pkg-config on recent fedora is a "alias" to pkgconf-pkg-config since they move from pkg-config implementation to pkgconf
The ckeck with rpm (who doesn't know the alias) doesn't detect that.
This change is now pretty old (fedora 26) (https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation) we should change kiwix-build to directly tryingto install pkgconf-pkg-config.

However, for now, if you want to avoid this, you can pass the option --assume-packages-installed to kiwix-build to skip the packages installation step.

@kelson42
Copy link
Contributor

kelson42 commented Apr 7, 2020

Out of this ticket, I see two things to do:

  • Document properly --assume-packages-installed in the README.md
  • Update the Python to check pkgconf-pkg-config package in Fedora in place of pkg-config.

@mgautierfr @ynikitenko Do I have forgotten something?

@ynikitenko
Copy link
Author

@kelson42 thanks. No, I don't recall other needs.

@mgautierfr
Copy link
Member

Document properly --assume-packages-installed in the README.md

We may, but there is a kiwix-build --help option also :)

@ynikitenko
Copy link
Author

@mgautierfr This option gives this output

--assume-packages-installed
Assume the package to install to be aleady installed

Honestly, this doesn't explain much to me. (Is 'the package to install' kiwix-desktop or what?)
It's also much easier to have information in only one place (README or INSTALL is fine).

I can say that there is a common installation scheme:

  1. configure
  2. make
  3. make install

The 3rd step requires root privileges. Since I don't understand well what is happening during kiwix-build, what steps it does, I can't be sure what could be 'assumed to be installed'.

If you split your build into make and make install this would add a tiny bit of flexibility (and maybe some transparency). The downside is slightly more commands to type.

I wrote about my experience. It's your decision as developers to make this enhancement or to consider this not useful. This is no major problem for me, and I accept any your resolution :)

@mgautierfr
Copy link
Member

Honestly, this doesn't explain much to me. (Is 'the package to install' kiwix-desktop or what?)

Then we should change the help text.

It's also much easier to have information in only one place (README or INSTALL is fine).

The --help option is a pretty good "one place" to have information about the what options are available and what they are doing.

The 3rd step requires root privileges.

It depends on where you are installing. kiwix-build install everything in the BUILD_<your_target>/INSTALL directory, so it doesn't need root privileges.
We may (and should) add a option to tell where to install things. But it would not help to split the whole process.

Projects need dependencies to be installed to use them. So the install step is at end of each dependency build step. We cannot build all and then install all.

@stale
Copy link

stale bot commented Jun 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants