karljohns0n / nginx-more

Development repository for nginx-more package
MIT License
120 stars 29 forks source link

Unable to build as public sources are not referenced in the spec file #38

Closed bugfest closed 1 year ago

bugfest commented 1 year ago

Problem description

Local/forked repos fails to build as the nginx-more package source dependencies are not using public URLs but currently relying in snapshots hosted in a private host, controlled by secrets.CDNURL gh actions variable (https://github.com/karljohns0n/nginx-more/blob/4fedea40b103763d512a171d1e0658467c1dba02/.github/workflows/build.yml#L69)

This causes builds to fail as they cannot retrieve the sources. Example output when building nginx-more using act for rockylinux:8

$ act -v -j buildrpm
...
[nginx-more/Build el8 package]   🐳  docker run image=act-addnab-docker-run-action-v3-dockeraction:latest platform= entrypoint=[] cmd=[]
[nginx-more/Build el8 package] [DEBUG] Starting container: 444f91f829a5ff0e4d6c3fca191864197b3a75339d608cb7cd7bd4bf730aa679
[nginx-more/Build el8 package] [DEBUG] Started container: 444f91f829a5ff0e4d6c3fca191864197b3a75339d608cb7cd7bd4bf730aa679
| + cd tmp/nginx-more
| ++ awk '{print $2}'
| ++ grep Version: SPECS/nginx-more.spec
| + PKG_VERSION=1.22.1
| ++ awk '{print $2}'
| ++ grep Release: SPECS/nginx-more.spec
| ++ tr -d '%{?dist}'
| + PKG_RELEASE=3
| + mkdir -p /tmp/nginx-more/BUILD /tmp/nginx-more/RPMS /tmp/nginx-more/SPECS /tmp/nginx-more/SOURCES /tmp/nginx-more/SRPMS
| + bash /tmp/nginx-more/.github/workflows/fetch_sources.sh ''
| Getting https://nginx.org/download/nginx-1.22.1.tar.gz to /tmp/nginx-more/SOURCES/nginx-1.22.1.tar.gz
|   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
|                                  Dload  Upload   Total   Spent    Left  Speed
100 1048k  100 1048k    0     0  1517k      0 --:--:-- --:--:-- --:--:-- 1515k
| Getting https://www.openssl.org/source/openssl-3.0.8.tar.gz to /tmp/nginx-more/SOURCES/openssl-3.0.8.tar.gz
|   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
|                                  Dload  Upload   Total   Spent    Left  Speed
^R
100 14.4M  100 14.4M    0     0  6054k      0  0:00:02  0:00:02 --:--:-- 6054k
| Error downloading ngx_pagespeed-1.13.35.2-stable.tar.gz.
| Error downloading psol-1.13.35.2-stable.tar.gz.
| Error downloading ngx_headers_more-0.34.tar.gz.
| Error downloading ngx_cache_purge-2.3.tar.gz.
| Error downloading ngx_brotli-snap20220505.tar.gz.
| Error downloading ngx_module_vts-0.2.1.tar.gz.
| Error downloading ngx_http_geoip2_module-3.4.tar.gz.
| Error downloading ngx_echo-0.62.tar.gz.
| Error downloading ngx_modsecurity-1.0.3.tar.gz.
| + mock --isolation=simple -r aeris-8-x86_64 --spec=/tmp/nginx-more/SPECS/nginx-more.spec --sources=/tmp/nginx-more/SOURCES --resultdir=/tmp/nginx-more/SRPMS --buildsrpm --with=modsecurity --with=pagespeed
| INFO: mock.py version 3.5 starting (python version = 3.6.8, NVR = mock-3.5-1.el8)...
| Start(bootstrap): init plugins
...

Solution proposal

Fix the nginx-more.spec so that spectool can fetch the sources from public URLs: https://github.com/karljohns0n/nginx-more/blob/master/SPECS/nginx-more.spec#L80

This change can help the community to maintain this project by being able rebuild it locally

bugfest commented 1 year ago

I'm working on this in my fork https://github.com/bugfest/nginx-more; I'll open a PR so you can review if you like the approach.

BTW, @karljohns0n congrats for the project it's really useful and easy to use.

karljohns0n commented 1 year ago

You are right, I'm also using act while providing the secret CDNURL variable, not a great solution for the community indeed. I've been hosting these sources for years as some didn't provide an easy way to get them in the past such as PageSpeed. It was much easier to package and host them.

I had a quick look at your PR and it seems to be an amazing work. I'll take a second look later when I'll be a bit less busy. Thank you very much for your contribution.

bugfest commented 1 year ago

Thanks @karljohns0n! Happy to help!

radmacd commented 1 year ago

Hey, this would be super helpful to us as well. Thanks @karljohns0n and @bugfest for putting this together. Hopefully the PR gets merged. 👍

bugfest commented 1 year ago

Thanks @karljohns0n !