new developer: make deb

Hi,

I am new to the Ansible github project. Hope this is not a stupid question…

I want to get accustomed to the basic development workflow on my local machine.

I checked out the github repository and executed make deb:

1. git clone https://github.com/ansible/ansible.git

2. cd ansible/

I edited some portion of the code and now I want to use the new code base:

3. make deb

The output of make is as follows:

Cleaning up distutils stuff
rm -rf build
rm -rf dist
rm -rf lib/ansible.egg-info/
Cleaning up byte compiled python stuff
find . -type f -regex “.*.py[co]$” -delete
find . -type d -name “pycache” -delete
Cleaning up editor backup files
find . -type f -not -path ./test/units/inventory_test_data/group_vars/noparse/all.yml~ ( -name “~" -or -name "#” ) -delete
find . -type f ( -name “*.swp” ) -delete
Cleaning up manpage stuff
find ./docs/man -type f -name “*.xml” -delete
find ./docs/man -type f -name “*.asciidoc” -delete
find ./docs/man/man3 -type f -name “*.3” -delete
rm -f ./docs/man/man1/*
Cleaning up output from test runs
rm -rf test/test_data
rm -rf shippable/
rm -rf logs/
rm -rf .cache/
rm -f test/units/.coverage*
rm -rf test/results//
find test/ -type f -name ‘*.retry’ -delete
Cleaning up RPM building stuff
rm -rf MANIFEST rpm-build
Cleaning up Debian building stuff
rm -rf debian
rm -rf deb-build
rm -rf docs/json
rm -rf docs/js
Cleaning up authors file
rm -f AUTHORS.TXT
Cleaning up docsite
make -C docs/docsite clean
make[1]: Entering directory ‘/home/my-user/workspace_oxygen_python/ansible/docs/docsite’
rm -rf htmlout
rm -rf module_docs
rm -rf _build
rm -f .buildinfo
rm -f objects.inv
rm -rf *.doctrees
Cleaning up minified css files
find . -type f -name “*.min.css” -delete
Cleaning up byte compiled python stuff
find . -regex “.*.py[co]$” -delete
Cleaning up editor backup files
find . -type f ( -name “~" -or -name "#” ) -delete
find . -type f ( -name “*.swp” ) -delete
Cleaning up generated rst
rm rst/cli/ansible-*.rst
rm: cannot remove ‘rst/cli/ansible-*.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/cli/ansible.rst
rm: cannot remove ‘rst/cli/ansible.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/modules/_by_category.rst
rm: cannot remove 'rst/modules/
by_category.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/modules/list_of
.rst
rm: cannot remove 'rst/modules/list_of_
.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/modules/_maintained.rst
rm: cannot remove 'rst/modules/
_maintained.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/modules/_module.rst
rm: cannot remove 'rst/modules/
_module.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/modules/_plugin.rst
rm: cannot remove 'rst/modules/
plugin.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/playbooks_directives.rst
rm: cannot remove ‘rst/playbooks_directives.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/plugins//.rst
rm: cannot remove ‘rst/plugins//.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/reference_appendices/config.rst
rm: cannot remove ‘rst/reference_appendices/config.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
rm rst/reference_appendices/playbooks_keywords.rst
rm: cannot remove ‘rst/reference_appendices/playbooks_keywords.rst’: No such file or directory
Makefile:47: recipe for target ‘clean’ failed
make[1]: [clean] Error 1 (ignored)
make[1]: Leaving directory ‘/home/my-user/workspace_oxygen_python/ansible/docs/docsite’
make -C docs/api clean
make[1]: Entering directory ‘/home/my-user/workspace_oxygen_python/ansible/docs/api’
rm -rf build/
__rm -rf rst/
.rst

make[1]: Leaving directory ‘/home/my-user/workspace_oxygen_python/ansible/docs/api’
*mkdir -p ./docs/man/man1/ ; *
PYTHONPATH=./lib docs/bin/generate_man.py --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-pull.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-console.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-doc.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-inventory.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-vault.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-config.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-galaxy.1.asciidoc.in
Wrote doc to /home/my-user/workspace_oxygen_python/ansible/docs/man/man1/ansible-playbook.1.asciidoc.in
make ./docs/man/man1/ansible-vault.1 ./docs/man/man1/ansible.1 ./docs/man/man1/ansible-playbook.1 ./docs/man/man1/ansible-config.1 ./docs/man/man1/ansible-inventory.1 ./docs/man/man1/ansible-console.1 ./docs/man/man1/ansible-doc.1 ./docs/man/man1/ansible-pull.1 ./docs/man/man1/ansible-galaxy.1
make[1]: Entering directory ‘/home/my-user/workspace_oxygen_python/ansible’
sed “s/%VERSION%/2.6.0/” docs/man/man1/ansible-vault.1.asciidoc.in > docs/man/man1/ansible-vault.1.asciidoc
ERROR: AsciiDoc ‘a2x’ command is not installed but is required to build ./docs/man/man1/ansible-vault.1 ./docs/man/man1/ansible.1 ./docs/man/man1/ansible-playbook.1 ./docs/man/man1/ansible-config.1 ./docs/man/man1/ansible-inventory.1 ./docs/man/man1/ansible-console.1 ./docs/man/man1/ansible-doc.1 ./docs/man/man1/ansible-pull.1 ./docs/man/man1/ansible-galaxy.1
Makefile:151: recipe for target ‘docs/man/man1/ansible-vault.1’ failed
make[1]: *** [docs/man/man1/ansible-vault.1] Error 1
rm docs/man/man1/ansible-vault.1.asciidoc
make[1]: Leaving directory ‘/home/my-user/workspace_oxygen_python/ansible’
Makefile:355: recipe for target ‘docs’ failed
make: *** [docs] Error 2

I think I get an error. What am I doing wrong?

The error seems quite clear here:

ERROR: AsciiDoc ‘a2x’ command is not installed but is required to build …

Serge

first thanks for your answer and sorry again for the next stupid question.

Ok I installed this stuff here:

sudo apt-get install -y asciidoc libxslt1-dev docbook-xsl xsltproc libxml2-utils devscripts

Now make deb fails here:

ansible-2.6.0/docs/docsite/_static/basic.css
ansible-2.6.0/docs/docsite/_static/default.css
ansible-2.6.0/docs/docsite/_static/jquery.js
ansible-2.6.0/docs/docsite/_static/minus.png
ansible-2.6.0/docs/docsite/_static/bootstrap-scrollspy.js
ansible-2.6.0/README.md
ansible-2.6.0/setup.py
ansible-2.6.0/VERSION
debuild: unknown dpkg-buildpackage/debuild option: --source-option=-I
dpkg-buildpackage -rfakeroot -d -us -uc --source-option=-I -S
dpkg-buildpackage: source package ansible
dpkg-buildpackage: source version 2.6.0-100.git201802270732.60a24bb.devel~unstable
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Ansible, Inc. info@ansible.com
dpkg-source -I --before-build ansible-2.6.0
fakeroot debian/rules clean
debian/rules:6: /usr/share/cdbs/1/rules/debhelper.mk: No such file or directory
debian/rules:7: /usr/share/cdbs/1/class/python-distutils.mk: No such file or directory
make: *** No rule to make target ‘/usr/share/cdbs/1/class/python-distutils.mk’. Stop.
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -d -us -uc --source-option=-I -S failed
Makefile:317: recipe for target ‘deb-src’ failed
make: *** [deb-src] Error 29

I am on Linux Mint 18.1 Serena/ Ubuntu 5.4.0-6ubuntu1~16.04.9 .

Any help setting up the basic workflow is appreciated. And again sorry for stupid questions. Just kick me out of the mailinglist if you want.

You need to check the line Build-Depends: in file packaging/debian/control and install the requirement listed there.

Hey Thanks. Now here comes yet another stupid question.

Thanks to your hint to the file packaging/debian/control I have found the README.md file in the same folder.

I have proceded like its written there:

  1. apt-get install asciidoc cdbs debootstrap devscripts make pbuilder python-setuptools
  2. git clone https://github.com/ansible/ansible.git
  3. cd ansible
  4. sudo su
  5. DEB_DIST=‘xenial trusty precise’ make deb

Now I get this error:


dpkg-source: info: building ansible in ansible_2.6.0-100.git201802270732.60a24bb.devel~precise.dsc
dpkg-genchanges -S >…/ansible_2.6.0-100.git201802270732.60a24bb.devel~precise_source.changes
dpkg-genchanges: including full source code in upload
dpkg-source -I --after-build ansible-2.6.0
dpkg-buildpackage: source-only upload: Debian-native package
Now running lintian…
warning: the authors of lintian do not recommend running it with root privileges!
W: ansible source: native-package-with-dash-version
E: ansible source: source-is-missing docs/docsite/_static/jquery.js line length is 517 characters (>512)
E: ansible source: source-is-missing docs/docsite/_static/underscore.js line length is 530 characters (>512)
E: ansible source: source-is-missing docs/docsite/_themes/sphinx_rtd_theme/static/js/modernizr.min.js
E: ansible source: source-is-missing docs/docsite/_themes/sphinx_rtd_theme/static/js/theme.js line length is 4287 characters (>512)
W: ansible source: debian-revision-not-well-formed 2.6.0-100.git201802270732.60a24bb.devel~precise
W: ansible source: binary-nmu-debian-revision-in-source 2.6.0-100.git201802270732.60a24bb.devel~precise
W: ansible source: ancient-standards-version 3.9.3 (current is 3.9.7)
Finished running lintian.

Hey,

I have also tried the build steps for the docker stuff:

  1. git clone https://github.com/ansible/ansible.git
  2. cd ansible
  3. docker build -t ansible-deb-builder -f packaging/debian/Dockerfile .
  4. docker run --privileged -e DEB_DIST=‘xenial’ -v $(pwd):/ansible ansible-deb-builder

Resulting in another error:

…(retrieving lots of stuff, some fails)

I: Retrieving zlib1g 1:1.2.8.dfsg-2ubuntu4
I: Validating zlib1g 1:1.2.8.dfsg-2ubuntu4
E: Couldn’t download packages: debianutils diffutils dpkg dpkg-dev e2fslibs e2fsprogs findutils g++ g+±5 gnupg gpgv grep gzip initscripts libacl1 libatomic1 libdpkg-perl libgcc1 libgcrypt20 libgdbm3 libisl15 liblsan0 liblz4-1 libmpx0 libncurses5 libncursesw5 libperl5.22 libquadmath0 libsemanage-common login make makedev mawk ncurses-bin perl sensible-utils systemd sysv-rc tzdata util-linux
E: debootstrap failed
W: Aborting with an error
I: cleaning the build env
I: removing directory /var/cache/pbuilder/build/369 and its subdirectories
W: /root/.pbuilderrc does not exist
I: Current time: Fri Mar 9 13:53:36 UTC 2018
I: pbuilder-time-stamp: 1520603616
I: Building the build Environment
I: extracting base tarball [/var/cache/pbuilder/xenial-amd64-base.tgz]

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
E: failed to extract /var/cache/pbuilder/xenial-amd64-base.tgz to /var/cache/pbuilder/build/3546
W: /root/.pbuilderrc does not exist
I: using fakeroot in build.
I: pbuilder: network access will be disabled during build
I: Current time: Fri Mar 9 13:53:36 UTC 2018
I: pbuilder-time-stamp: 1520603616
I: Building the build Environment
I: extracting base tarball [/var/cache/pbuilder/xenial-amd64-base.tgz]

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
E: failed to extract /var/cache/pbuilder/xenial-amd64-base.tgz to /var/cache/pbuilder/build/3563
Makefile:288: recipe for target ‘deb’ failed
make: *** [deb] Error 1

What can I do? Should I reinstall my OS?