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

Incorrect OS value set in Mimir v2.3.* RPM packages #3216

Closed
mac133k opened this issue Oct 14, 2022 · 6 comments · Fixed by #3221
Closed

Incorrect OS value set in Mimir v2.3.* RPM packages #3216

mac133k opened this issue Oct 14, 2022 · 6 comments · Fixed by #3221
Labels
bug Something isn't working release Release process

Comments

@mac133k
Copy link

mac133k commented Oct 14, 2022

Describe the bug

It is not possible to install Mimir 2.3.* from released RPMs due to incorrect OS value which is set to darwin.

To Reproduce

Steps to reproduce the behavior:

# cat /etc/redhat-release 
Rocky Linux release 8.6 (Green Obsidian)
# wget https://github.com/grafana/mimir/releases/download/mimir-2.3.1/mimir-2.3.1_amd64.rpm
# wget https://github.com/grafana/mimir/releases/download/mimir-2.3.0/mimir-2.3.0_amd64.rpm
# rpm -ivh mimir-2.3.0_amd64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
	package mimir-2.3.0-1.x86_64 is intended for a different operating system
# rpm -ivh mimir-2.3.1_amd64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
	package mimir-2.3.1-1.x86_64 is intended for a different operating system
# rpm -qp --qf '%{OS}\n' mimir-*.rpm
darwin
darwin

Expected behavior

It should be possible to install Mimir form RPM packages on RPM-based Linux distros.

Environment

# cat /etc/redhat-release 
Rocky Linux release 8.6 (Green Obsidian)
# uname -r
4.18.0-372.13.1.el8_6.x86_64

Additional Context

n/a

@mac133k mac133k changed the title Incorrect OS set in Mimir v2.3.* RPM packages Incorrect OS value set in Mimir v2.3.* RPM packages Oct 14, 2022
@pracucci pracucci added bug Something isn't working release Release process labels Oct 14, 2022
@pracucci pracucci mentioned this issue Oct 14, 2022
45 tasks
@mac133k
Copy link
Author

mac133k commented Oct 14, 2022

Ignore OS can be used with rpm, ie.:

# rpm -ivh --ignoreos mimir-2.3.1_amd64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:mimir-2.3.1-1                    ################################# [100%]

but there is no such flag in DNF or Yum.

@pracucci
Copy link
Collaborator

Thanks for your report! Looks like a bug, sorry. Are you willing to open a PR to fix it? :)

@mac133k
Copy link
Author

mac133k commented Oct 14, 2022

I would like to help, but the last time I built rpm was 15 years ago. I looked through Mimir repo and got no idea where the bug was or how to fix it.

wilfriedroset added a commit to wilfriedroset/mimir that referenced this issue Oct 14, 2022
When creating the packages on MacOS the `OS` applied on the package is
not correct. The documentation says:

    --rpm-os OS
    The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example

See: https://fpm.readthedocs.io/en/latest/packages/rpm.html
Fixes: grafana#3216

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
@wilfriedroset
Copy link
Collaborator

RPMs are built with FPM.
You can start to have a look here: https://github.com/grafana/mimir/blob/main/Makefile#L625
I believe we are missing one flag --rpm-os OS when creating the package.
See: https://fpm.readthedocs.io/en/latest/packages/rpm.html

This is something we will need to watchout for when dealing with #2986
I've issued a PR to address that. @mac133k Would you be able to confirm the rpm works as expected in your environment?

treid314 pushed a commit that referenced this issue Oct 14, 2022
)

When creating the packages on MacOS the `OS` applied on the package is
not correct. The documentation says:

    --rpm-os OS
    The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example

See: https://fpm.readthedocs.io/en/latest/packages/rpm.html
Fixes: #3216

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
pracucci pushed a commit that referenced this issue Oct 17, 2022
)

When creating the packages on MacOS the `OS` applied on the package is
not correct. The documentation says:

    --rpm-os OS
    The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example

See: https://fpm.readthedocs.io/en/latest/packages/rpm.html
Fixes: #3216

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
(cherry picked from commit 80e6fc1)
pracucci added a commit that referenced this issue Oct 17, 2022
) (#3226)

When creating the packages on MacOS the `OS` applied on the package is
not correct. The documentation says:

    --rpm-os OS
    The operating system to target this rpm for. You want to set this to ‘linux’ if you are using fpm on OS X, for example

See: https://fpm.readthedocs.io/en/latest/packages/rpm.html
Fixes: #3216

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
(cherry picked from commit 80e6fc1)

Co-authored-by: wilfriedroset <wilfriedroset@users.noreply.github.com>
@mac133k
Copy link
Author

mac133k commented Oct 18, 2022

@mac133k Would you be able to confirm the rpm works as expected in your environment?

Works as expected now:

# wget https://github.com/grafana/mimir/releases/download/mimir-2.4.0-rc.1/mimir-2.4.0-rc.1_amd64.rpm
# rpm -qp --qf '%{OS}\n' mimir-2.4.0-rc.1_amd64.rpm
linux
# rpm -Uvh mimir-2.4.0-rc.1_amd64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:mimir-2.4.0_rc.1-1               ################################# [ 50%]
/bin/systemctl
Cleaning up / removing...
   2:mimir-2.3.1-1                    ################################# [100%]

Thanks for fixing this.

@pracucci
Copy link
Collaborator

Thanks @mac133k for testing and @wilfriedroset for fixing! Great job 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release Release process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants