nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.37k stars 323 forks source link

simplify package dependency #1036

Closed remicollet closed 3 months ago

remicollet commented 9 months ago

the unit-r1.31.1 was introduced in 2ac4a7527

Requires: unit = %{version} is simpler, allows any release of the same version, and avoids additional metadata

A specific virtual provide will make sense for an API number (for the future)

Example in unit Provides: unit(ABI) = 12

Example for module

BuildRequires: unit-devel
Requires: unit(ABI) = %{unit_abi} 

%{unit_api}being defined in a rpm macro file provided by unit-devel

remicollet commented 9 months ago

Various cleanups are possible in the spec template

Can be safely removed

thresheek commented 9 months ago

The https://github.com/nginx/unit/commit/2ac4a7527de8fb7ce8cfac05563a542078d65f4b change is exactly there because we don't have a proper API that can be exposed, and we need to make sure modules are installed alongside the builds we provide. Relying on unit = %{version} might work for RPM, but I believe it has issuest on debian-based systems where package manager is less flexible (and possibly other OSes that are not there for Unit upstream packages yet, e.g. Alpine). I would rather prefer the dependencies to be handled the same way between the OSes we support.

Other cleanup you mention is OK I guess, provided it's not required by the OSes we still support (e.g. Amazon Linux 2, CentOS 7).

remicollet commented 9 months ago

Other cleanup you mention is OK I guess

Pushed in second commit

I would rather prefer the dependencies to be handled the same way between the OSes we support.

Feel free to apply only the second commit if you prefer Always sad to align to the bottom.

callahad commented 3 months ago

Not sure why this has lingered quite so long.

Let's apply Remi's second patch. In preparation, we should also drop Amazon Linux 2 (EOL in 1 yr) and CentOS 7 (EOL in 2 weeks) support. We may cut further, but these two shouldn't be controversial.

Any takers on doing the needful? Maybe @ac000 or @javorszky? (Or @thresheek if you've got spare cycles)

callahad commented 3 months ago

@remicollet can you comment on why you were suggesting removing Group: metadata? Seems it's not deprecated / obsoleted like the buildroot stuff.

callahad commented 3 months ago

(I'll go cross-reference the obsoletion of buildroot against our matrix of supported distros to make sure we're in the clear there)

ac000 commented 3 months ago

Seems Fedora has indeed deprecated the use of the Group field.

ac000 commented 3 months ago
$ git range-diff ec31d100...1c324ff3
1:  2a24c21f < -:  -------- simplify package dependency
2:  ec31d100 ! 1:  1c324ff3 cleanup deprecated packaging stuff
    @@ Metadata
     Author: Remi Collet <remi@remirepo.net>

      ## Commit message ##
    -    cleanup deprecated packaging stuff
    +    pkg/rpm: Remove deprecated rpm spec file items
    +
    +    The 'Group' and 'BuildRoot' tags have been declared as deprecated by the
    +    Fedora project.
    +
    +    Also, to quote the Fedora Packaging Guidelines
    +
    +      The contents of the buildroot SHOULD NOT be removed in the first line
    +      of %install.
    +
    +      The %defattr directive in the %files list SHOULD ONLY be used when
    +      setting a non-default value, or to reset to the default value after
    +      having set a non-default value.
    +
    +    Link: <https://fedoraproject.org/wiki/RPMGroups>
    +    Link: <https://fedoraproject.org/wiki/Phase_out_buildroot_tag_(draft)>
    +    Link: <https://fedoraproject.org/wiki/Archive:PackagingDrafts/BuildRoot>
    +    Link: <https://docs.fedoraproject.org/en-US/packaging-guidelines/#_tags_and_sections>
    +    [ Tweaked subject & added commit message - Andrew ]
    +    Signed-off-by: Andrew Clayton <a.clayton@nginx.com>

      ## pkg/rpm/unit.module.spec.in ##
     @@ pkg/rpm/unit.module.spec.in: Release: %%RELEASE%%%{?dist}.ngx
    @@ pkg/rpm/unit.module.spec.in: Release: %%RELEASE%%%{?dist}.ngx
     -
      BuildRequires: pcre2-devel

    - Requires: unit = %{version}
    + Requires: unit-r%%UNIT_VERSION%%
     @@ pkg/rpm/unit.module.spec.in: make %%MODULE_MAKEARGS%%
      %{__mv} build build-nodebug
ac000 commented 3 months ago

Rebase with master...

$ git -P range-diff 1c324ff3...4a37c565
  -:  -------- >   1:  263460d9 Docs: replaced the slack community links with GitHub Discussions
  -:  -------- >   2:  7e03a6cc Go: Add missing +build and go:build comments
  -:  -------- >   3:  6ee5d555 .mailmap: Fix up Taryn's email address
  -:  -------- >   4:  b04455f6 Updated security.txt
  -:  -------- >   5:  e95a91cb .mailmap: Add a few more entries
  -:  -------- >   6:  5a833793 Tests: pathlib used where appropriate
  -:  -------- >   7:  a1e00b4e White space formatting fixes
  -:  -------- >   8:  4e08f495 Tests: added Ruby tests with array in header values
  -:  -------- >   9:  02d1984c HTTP: Remove short read check in nxt_http_static_buf_completion()
  -:  -------- >  10:  af6833a1 Tools: setup-unit: -hh: Add missing documentation for 'restart'
  -:  -------- >  11:  034b6394 Tools: setup-unit: -hh: The advanced commands aren't experimental
  -:  -------- >  12:  ba56e50e Tools: setup-unit: -hh: Add short-cut for the advanced help
  -:  -------- >  13:  6452ca11 Node.js: fixed "httpVersion" variable format
  -:  -------- >  14:  37abe2e4 HTTP: refactored out nxt_http_request_access_log().
  -:  -------- >  15:  4c91bebb HTTP: enhanced access log with conditional filtering.
  -:  -------- >  16:  dcbff27d Docs: Update changes.xml for conditional access logging
  -:  -------- >  17:  ad364507 Tests: "if" option in access logging.
  -:  -------- >  18:  9919b50a Isolation: Add a new nxt_cred_t type
  -:  -------- >  19:  f7c9d3a8 Isolation: Use an appropriate type for storing uid/gids
  -:  -------- >  20:  eba7378d Configuration: Use the NXT_CONF_VLDT_REQUIRED flag for procmap
  -:  -------- >  21:  990fbe70 Configuration: Remove procmap validation code
  -:  -------- >  22:  ecd57392 Configuration: Add nxt_conf_get_string_dup()
  -:  -------- >  23:  bb376c68 Simplify, by calling nxt_conf_get_string_dup()
  -:  -------- >  24:  46cef09f Configuration: Don't corrupt abstract socket names
  -:  -------- >  25:  9e986704 Configuration: Fix validation of "processes"
  -:  -------- >  26:  3a2687bb Packages: added Ubuntu 23.10 "mantic" support.
  -:  -------- >  27:  8ebe04fd contrib: Bump libunit-wasm to 0.3.0.
  -:  -------- >  28:  ca1bc062 contrib: updated njs to 0.8.2.
  -:  -------- >  29:  bad2c181 Packages: Added Fedora 39 support.
  -:  -------- >  30:  661e918a Docker: added python3.12 to versions
  -:  -------- >  31:  2b0d93d1 Docker: Generated Dockerfile for Unit 1.31.1.
  -:  -------- >  32:  fbeb2065 fix: Take options as well as requestListener (#1091)
  -:  -------- >  33:  c3af21e9 Docker: Switch to github
  -:  -------- >  34:  baff936b Packages: Move dist target to git archive
  -:  -------- >  35:  34b3a812 Add nxt_file_chown()
  -:  -------- >  36:  b500c36d Allow to set the permissions of the Unix domain control socket
  -:  -------- >  37:  2bd3b418 Docs: Update man page for new --control-* options
  -:  -------- >  38:  1dca8602 Tools: disambiguate unitc control socket detection
  -:  -------- >  39:  756feafd Node.js: Use console.warn instead of stderr.write
  -:  -------- >  40:  ea239635 Docker: Switch python3.12 to using github
  -:  -------- >  41:  0c983530 Node.js: Build/install fix
  -:  -------- >  42:  30b410e4 Avoid a segfault in nxt_conn_io_sendbuf()
  -:  -------- >  43:  62894ae7 Var: Refactored nxt_var_ref_get()
  -:  -------- >  44:  01fd121c Var: Refactored nxt_http_unknown_var_ref()
  -:  -------- >  45:  63507c49 Var: Make nxt_var_cache_value() more general
  -:  -------- >  46:  46554015 Var: Introduced nxt_var_get()
  -:  -------- >  47:  63ad4deb NJS: Simplified nxt_js_call()
  -:  -------- >  48:  33c6c4d4 NJS: variable access support
  -:  -------- >  49:  183a1e9d Docker: redirect logs to stderr
  -:  -------- >  50:  5570d807 Packages: fixed a path to python 3.12 example app
  -:  -------- >  51:  53648ed5 Tools: Fix typo in tools/README.md
  -:  -------- >  52:  d24ae5a9 Add additional replace rules for node:* modules
  -:  -------- >  53:  bd0abdf0 Docker: Shallow clone the Unit repo
  -:  -------- >  54:  914cd4e3 .mailmap: Map some more personal addresses
  -:  -------- >  55:  d52a9361 Docker: Update versions of Go, Node, PHP, Ruby
  -:  -------- >  56:  2765522b Tests: NJS request variables
  -:  -------- >  57:  cca2c46e Tools: setup-unit: Use trap(1) to handle cleanup
  -:  -------- >  58:  d6ed0003 Tools: setup-unit: De-duplicate code
  -:  -------- >  59:  e9a0c49d Tools: setup-unit: Pass --fail-with-body to curl(1)
  -:  -------- >  60:  565a8ed0 Tools: setup-unit: ctl edit: Print file name on error
  -:  -------- >  61:  bc093ab3 Tools: setup-unit: Fix error message
  -:  -------- >  62:  6aa5ef63 Tools: setup-unit: ctl edit: Append suffix to tmp file name
  -:  -------- >  63:  f71ead5f Updated copyright notice.
  -:  -------- >  64:  697a5850 Python: bytearray body support for ASGI module.
  -:  -------- >  65:  56d3a1a7 Add GitHub Actions
  -:  -------- >  66:  bca44630 .mailmap: Map Dylan's GitHub address
  -:  -------- >  67:  f2e64475 Wasm-wc: Register a new Wasm component model language module type
  -:  -------- >  68:  f0782722 Wasm-wc: Add core configuration data structure
  -:  -------- >  69:  20ada4b5 Wasm-wc: Core of initial Wasm component model language module support
  -:  -------- >  70:  a9345dd4 Add a .rustfmt.toml file
  -:  -------- >  71:  79c81772 Wasm-wc: Run src/lib.rs through rustfmt
  -:  -------- >  72:  ac3a54d6 Wasm-wc: Improve request buffer handling
  -:  -------- >  73:  98f808af Wasm-wc: Upgrade to wasmtime 17
  -:  -------- >  74:  60eb6c43 Wasm-wc: Allow to use the 'reactor' adaptor again
  -:  -------- >  75:  8d030139 Wasm-wc: Add Cargo.lock
  -:  -------- >  76:  07a0c9a3 Wasm-wc: Wire up the language module to the config system
  -:  -------- >  77:  da44dc00 Fix alignment of wasm options text in auto/help
  -:  -------- >  78:  4e6d7e87 Wasm-wc: Wire it up to the build system
  -:  -------- >  79:  7702293d Docker: Bump rust version to 1.76.0
  -:  -------- >  80:  1297f6f0 Docker: Add wasm-wasi-component to the wasm target
  -:  -------- >  81:  4c558697 Docker: Re-generate Dockerfile.wasm
  -:  -------- >  82:  7883acc6 Tests: Ruby hook tests unstable for version older 3.0
  -:  -------- >  83:  99da2f3c Tests: check for the AddressSanitizer flag during discovery
  -:  -------- >  84:  dbd9d25f Tests: skip some of TLS reconfiguration tests under AddressSanitizer
  -:  -------- >  85:  cabea47d Tests: renamed test_python_procman.py since it's not Python-specific
  -:  -------- >  86:  3f805bc6 Packages: added wasm-wasi-component module packaging for deb-based distros
  -:  -------- >  87:  7a640556 Packages: added wasm-wasi-component module packaging for rpm-based distros
  -:  -------- >  88:  7b13c306 Wasm-wc: Add nxt_unit.o as a dependency in the auto script
  -:  -------- >  89:  d54af163 Wasm-wc: Use the cargo build output as the make target dependency
  -:  -------- >  90:  2f3c7c2c Update third-party java components to their recent versions
  -:  -------- >  91:  e2cab032 Remove debug from builds and tests
  -:  -------- >  92:  faa7e792 Packages: Pass CFLAGS to compile wasm modules on all packaging targets
  -:  -------- >  93:  9d02b906 Add PHP 8.2 and 8.1 to test matrix
  -:  -------- >  94:  d5665f49 Update setup-go to v5
  -:  -------- >  95:  4d25c612 Edited changes.xml for the 1.32.0 release
  -:  -------- >  96:  ace553dc Generated Dockerfiles for Unit 1.32.0
  -:  -------- >  97:  08811700 Added version 1.32.0 CHANGES
  -:  -------- >  98:  e67d7433 Version bump
  -:  -------- >  99:  23e807de Wasm-wc: use more common uname switch to get operating system name
  -:  -------- > 100:  8ff606fb Configuration: Fix check in nxt_conf_json_parse_value()
  -:  -------- > 101:  4eb008bb Remove unused nxt_vector_t API
  -:  -------- > 102:  353d2d05 Var: Remove a dead assignment in nxt_var_interpreter()
  -:  -------- > 103:  c2f7f296 Avoid potential NULL pointer dereference in nxt_router_temp_conf()
  -:  -------- > 104:  8032ce31 Test with root access in GitHub workflows
  -:  -------- > 105:  0cee7d1a Add GitHub workflow for wasm-wasi-component
  -:  -------- > 106:  63bc3882 .mailmap: Map Dylan's 2nd GitHub address
  -:  -------- > 107:  f6899af6 Var: Fix cacheable issue for njs variable access
  -:  -------- > 108:  5511593d Remove support for Microsoft's Visual C++ compiler
  -:  -------- > 109:  0c2d7786 Remove support for Intel's icc compiler
  -:  -------- > 110:  e79e4635 Remove support for IBM's XL C compiler
  -:  -------- > 111:  9cd11133 Remove support for Sun's Sun Studio/SunPro C compiler
  -:  -------- > 112:  806e209d Remove -W from compiler flags
  -:  -------- > 113:  1dcb5383 Expand the comment about -Wstrict-overflow on GCC
  -:  -------- > 114:  0b5223e1 Disable strict-aliasing in clang by default
  -:  -------- > 115:  c1e3f02f Compile with -fno-strict-overflow
  -:  -------- > 116:  280a978d Add initial infrastructure for pretty printing make output
  -:  -------- > 117:  5d831af0 Hook up make pretty printing to the Unit core and tests
  -:  -------- > 118:  da335bec Pretty print the Java language module compiler output
  -:  -------- > 119:  574528f7 Pretty print the Perl language module compiler output
  -:  -------- > 120:  0a0dcf91 Pretty print the PHP language module compiler output
  -:  -------- > 121:  caaa1d28 Pretty print the Python language module compiler output
  -:  -------- > 122:  133f75fd Pretty print the Ruby language module compiler output
  -:  -------- > 123:  b763ba7e Pretty print the wasm language module compiler output
  -:  -------- > 124:  15072fbd Enable optional 'debuggable' builds
  -:  -------- > 125:  d23812b8 Allow to disable -Werror at 'make' time
  -:  -------- > 126:  f55fa70c Add a help target to the root Makefile
  -:  -------- > 127:  a171b399 Add an EXTRA_CFLAGS make variable
  -:  -------- > 128:  6b138571 Wasm-wc: Bump the mio crate from 0.8.10 to 0.8.11
  -:  -------- > 129:  2e615250 Add dependabot.yml
  -:  -------- > 130:  0d99744d Router: match when pattern and tested string are both zero length
  -:  -------- > 131:  fdc46759 NJS: avoiding arithmetic ops with NULL pointer in r->args
  -:  -------- > 132:  8844d33c Fixed undefined behaviour in left shift of int value
  -:  -------- > 133:  7dcd6c0e Avoiding arithmetic ops with NULL pointer in nxt_http_arguments_parse
  -:  -------- > 134:  264b3755 Avoiding arithmetic ops with NULL pointer in nxt_port_mmap_get
  -:  -------- > 135:  c9461a6b Initialize port_impl only when it is needed
  -:  -------- > 136:  dd701fb4 Avoiding arithmetic ops with NULL pointer in nxt_unit_mmap_get
  -:  -------- > 137:  abcfc4cd Fix the security-alert email link in the README
  -:  -------- > 138:  9993814d NJS: loader should be registered using njs_vm_set_module_loader()
  -:  -------- > 139:  0716b0c7 Tests: NJS cacheable variables with access log
  -:  -------- > 140:  dc16a7bc Add a repostatus badge to the README
  -:  -------- > 141:  7472a2ca Add a GitHub workflow status badge for our CI to the README
  -:  -------- > 142:  b65e49c5 Build with -std=gnu11 (C11 with GNU extensions)
  -:  -------- > 143:  a8cfea8b Rebuild wasm-wasi-component when any of its dependencies change
  -:  -------- > 144:  e75f8d5d Wasm-wc: Fix application restarts
  -:  -------- > 145:  d494d2eb Wasm-wc: Bump the h2 crate from 0.4.2 to 0.4.4
  -:  -------- > 146:  e6d8fc66 njs (lowercase) is more preferred way to mention
  -:  -------- > 147:  6e79da47 Docs: njs (lowercase) is more preferred way to mention
  -:  -------- > 148:  5f606742 Tests: added $request_uri tests with proxy
  -:  -------- > 149:  a625a0b1 Tests: compatibility with OpenSSL 3.2.0
  -:  -------- > 150:  2d7a8468 HTTP: Added variable validation to the response_headers option
  -:  -------- > 151:  62697773 Tests: error report corrected for unknown variables in "response_headers"
  -:  -------- > 152:  64934e59 HTTP: Introduce quoted target marker in HTTP parsing
  -:  -------- > 153:  a4dbee14 HTTP: Rewrote url target section in nxt_h1p_peer_header_send()
  -:  -------- > 154:  678c0568 Fixes: 64934e59f ("HTTP: Introduce quoted target marker in HTTP parsing") Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
  -:  -------- > 155:  a48fbc03 Add additional information to the README
  -:  -------- > 156:  d7ce3569 Elaborate on docker image differences
  -:  -------- > 157:  237a26aa wasm-wc: Bump the rustls crate from 0.21.10 to 0.21.11
  -:  -------- > 158:  3fbca6ca Fix some trailing whitespace and long lines in the README
  -:  -------- > 159:  e5bc299d configuration: Constify numerous pointers
  -:  -------- > 160:  8f861cf4 Constify a bunch of static local variables
  -:  -------- > 161:  33c978cc php: Constify some local static variables
  -:  -------- > 162:  31cec908 configuration: Constify more pointers
  -:  -------- > 163:  b26c119f Tighten up some string arrays
  -:  -------- > 164:  db3cf3e4 tools: Add unitctl CLI
  -:  -------- > 165:  2c4502f8 tools: Add unitctl section to the README
  -:  -------- > 166:  ff2e0f42 Add a GitHub workflow to check for whitespace issues
  -:  -------- > 167:  5b01bd65 auto/wasm: No need to explicitly set -fno-strict-aliasing now
  -:  -------- > 168:  e2a09c77 Convert 0-sized arrays to true flexible array members
  -:  -------- > 169:  5d1ce5c4 auto, perl: Fix building the Perl language module with clang
  -:  -------- > 170:  6e8f7bbb tools/unitctl: Initial Docker Procedures
  -:  -------- > 171:  818d4ad7 tools/unitctl: API Plumbing for docker deployments
  -:  -------- > 172:  f6989dd6 tools/unitctl: Add Docker deployment functionality
  -:  -------- > 173:  1d237990 tools/unitctl: Add new functionality to README.md and fmt code
  -:  -------- > 174:  4e4d1dd2 tools/unitctl: temporarily ignore issues with autogenerated readme
  -:  -------- > 175:  e61d9e7a tools/unitctl: Readme fixes
  -:  -------- > 176:  787980db tools/unitctl: Improve quality of life on osx
  -:  -------- > 177:  cb03d31e tools/unitctl: Update host_path() to account for OSX special behaviour
  -:  -------- > 178:  6ad1fa34 tools/unitctl: clean up control socket impls
  -:  -------- > 179:  cc9eb8e7 tools/unitctl: enable passing IP addresses to the 'instances new' command
  -:  -------- > 180:  da43f443 java: Update third-party components
  -:  -------- > 181:  05a82294 http: Use consistent target in nxt_h1p_peer_header_send()
  -:  -------- > 182:  87077ec4 http: Ensure REQUEST_URI immutability
  -:  -------- > 183:  eed21785 tests: Change request_uri tests for changed behaviour
  -:  -------- > 184:  00009765 tests: REQUEST_URI variable test with rewrite
  -:  -------- > 185:  6d0880c9 Add unitctl build and release CI
  -:  -------- > 186:  149555db trigger unitctl CI on version tags of existing format
  -:  -------- > 187:  a98acded ci: Add unit testing to unitctl CI workflow
  -:  -------- > 188:  44709bea .mailmap: Add an entry for Ava's GitHub address
  -:  -------- > 189:  30b39bd0 Add GitHub workflows for extra coverage
  -:  -------- > 190:  c30c2f5e Add unitctl quickstart to README.md
  -:  -------- > 191:  4e884d9e tools/unitctl: Replace matching image name to matching command
  -:  -------- > 192:  b91073e5 tools/unitctl: Replace format! with .to_string()
  -:  -------- > 193:  8fc16a77 Packaging: added missing build dependencies to Makefiles
  -:  -------- > 194:  f281207f Packaging: fix build-depends detection on debian-based systems
  -:  -------- > 195:  c38bcee1 contrib: be quiet on unpack
  -:  -------- > 196:  7b19a06c tstr: Constify the 'str' parameter to nxt_tstr_compile()
  -:  -------- > 197:  ea5c41b8 wasm: Add a missing 'const' qualifier in nxt_wasm_setup()
  -:  -------- > 198:  4fc50258 ci: Be more specific when to run the main Unit checks
  -:  -------- > 199:  e77a0c16 Tests: explicitly specify 'f' prefix to format string before printing
  -:  -------- > 200:  c9dced37 Tests: print unit.log on unsuccessful unmount
  -:  -------- > 201:  98983f3f Add a GitHub discussions badge to the README
  -:  -------- > 202:  a7e3686a Tools: improved error handling for unitc
  -:  -------- > 203:  d7ec30c4 ci: Limit when to run checks on pull-requests
  -:  -------- > 204:  04a24f61 http: fix use-of-uninitialized-value bug
  -:  -------- > 205:  965fc94e fuzzing: add fuzzing infrastructure in build system
  -:  -------- > 206:  a93d878e fuzzing: add fuzzing targets
  -:  -------- > 207:  665353dc fuzzing: add a fuzzing seed corpus and dictionary
  -:  -------- > 208:  5b65134c fuzzing: add a basic README
  -:  -------- > 209:  35a572c2 fuzzing: Add a .gitattributes file
  -:  -------- > 210:  ec11eb12 tools/unitc: Redirect stderr for curl feature test
  1:  1c324ff3 = 211:  4a37c565 pkg/rpm: Remove deprecated rpm spec file items