saltstack / saltstack/salt

[DOCS] Instructions to build deb onedir packages

Open
#65,437 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation severity-medium time-estimate-long-term
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
I try to build own Deb packages on Debian 12 for the Salt Minion with some local modifications. The documentation link I found via Google (https://docs.saltproject.io/en/latest/topics/packaging/index.html#how-to-build-deb-packages) seems incomplete, and/or parts do not work.

Suggested Fix
A perfect 10 would be a step-by-step guide from git clone to a directory full of working Salt onedir .deb (or .rpm, .exe, .msi) packages, expecting only knowledge about the OS to build for (for me Debian 12) and the packaging format (deb).

Some details/suggestions:

Step 2 does not work as-is on Debian 12: Installing os-wide pip dependencies on Debian 12 is (IMHO rightfully) deactivated, thus the pip install command fails with a big warning. Debian recommends using the packaged python modules instead.
Analyzing the text file from step 2, I came up with this:

apt-get install python3-attr python3-boto3 python3-botocore python3-certifi python3-charset-normalizer python3-commonmark python3-idna python3-jinja2 python3-jmespath python3-markupsafe python3-packaging python3-pygments python3-dateutil python3-yaml python3-requests python3-rich python3-s3transfer python3-six python3-urllib3

(This will most certainly not provide the exact versions from the tools.txt file, and the virustotal3 module is not available in Debian 12)

There's also pipx available in Debian, which will install modules locally below the user's home directory (though I do not know if this will work transparently with the actuall build/packaging process)

Step 4 and 5 look like having a formatting error, there is no "tools" command.

Possibly, the python scripts tools/changelog.py and tools/pkg/build.py are meant.
Both fail with a missing ptscripts module that even Google does not know, so I guess my assumption is false:

$ python3 tools/pkg/build.py deb
Traceback (most recent call last):
  File "/home/emric05/tmp/salt/tools/pkg/build.py", line 17, in <module>
    from ptscripts import Context, command_group
ModuleNotFoundError: No module named 'ptscripts' 

Yet that mysterious tools command is mentioned here explicitly: https://docs.saltproject.io/en/latest/topics/packaging/testing.html#using-tools

But again no explaination on where to get that tools tool. (Tbh, giving any tool that generic name "tools" and placing it in $PATH feels a bit strange, too.)

So I have no clue what to do there and I am stuck now.

Apart from that, I tried the "generic" Debian package build approach: find the debian/../ directory and run dpkg-buildpackage, but that did not work either.

Type of documentation
Salt documentation (Onedir Packaging guide)

Location or format of documentation
https://docs.saltproject.io/en/latest/topics/packaging/index.html#how-to-build-deb-packages

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Onedir Packaging guide at the linked Salt documentation page, then compare its steps with tools/changelog.py, tools/pkg/build.py, and the linked packaging testing page. Reproduce the Debian 12 failures, including the missing ptscripts module and the incorrect “tools” commands. Done means the guide takes a user from git clone through building working Salt onedir .deb packages, with accurate dependency and tool setup instructions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.