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

Using -ih on Centos7 causes many hash marks and a locked RPM db #32

Open
jtk18 opened this issue Jul 8, 2022 · 1 comment
Open

Using -ih on Centos7 causes many hash marks and a locked RPM db #32

jtk18 opened this issue Jul 8, 2022 · 1 comment

Comments

@jtk18
Copy link
Contributor

jtk18 commented Jul 8, 2022

This only happens on centos 7 afaict.

Steps to reproduce:

  1. git clone https://github.com/cat-in-136/cargo-generate-rpm.git
  2. cd cargo-generate-rpm
  3. cargo install --path .
  4. cargo build --release
  5. cargo strip -s target/release/cargo-generate-rpm
  6. cargo generate-rpm --payload-compress none --auto-req no
  7. docker run --rm -v $PWD:/workdir centos:7 rpm -ih /workdir/target/generate-rpm/cargo-generate-rpm-0.6.0-1.x86_64.rpm

Adding -i -t to the above docker run command will produce infinite hashmarks and lock the rpm db

I tested using almalinux:8, centos:6, and centos:8 and they all function as expected. I'm pretty sure this is an issue with centos 7 itself, but users of the library should be aware of this issue.

@cat-in-136
Copy link
Owner

cat-in-136 commented Jul 9, 2022

It seems to be hash-mode bug of rpm 4.11 on centos 7-stream and the workaround is to do without -h flag.

I did reproduce the issue as follows. I use podman but this behavior is not depending on the difference of container system (docker vs podman).

$ podman run -it --rm -v $PWD:/workdir --security-opt label=disable centos:7 rpm -ivh /workdir/target/generate-rpm/cargo-generate-rpm-0.6.0-1.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:cargo-generate-rpm-0:0.6.0-1       # ############################################################################################### (65676%################################################################################################################################################################################################################################################################################################(6###############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################(6567#############################################################################################################################################################################################################################################################################################################################################

Even if the progress reaches 100%, # is appended to the line and the operation is such that it exceeds 100%. Very large numbers of # are displayed on the screen, so it is difficult for human eye to see this behavior. I saved the log to a text file, and checked the operation with head -c 1000 log.txt and head -c 12000 log.txt, and so on.

This can be avoided by omitting -h.

$ podman run -it --rm -v $PWD:/workdir --security-opt label=disable centos:7 rpm -i /workdir/target/generate-rpm/cargo-generate-rpm-0.6.0-1.x86_64.rpm
Preparing packages...
cargo-generate-rpm-0:0.6.0-1.x86_64
$

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

2 participants