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

Fix dh_make call for Debian packaging #73

Merged
merged 1 commit into from
Jan 8, 2018
Merged

Conversation

pluehne
Copy link
Contributor

@pluehne pluehne commented Jan 8, 2018

dh_make recently changed from Python 2 to Python 3. For this reason, the call to dh_make with Python 2 won’t work on systems with new dh_make versions. Instead of locking the Python version to Python 2, call Python without the fixed version number. This should be safe, because we can expect Linux distributions to ship a version of dh_make that works with the system’s default Python version.

dh_make recently changed from Python 2 to Python 3. For this reason, the
call to dh_make with Python 2 won’t work on systems with new dh_make
versions. Instead of locking the Python version to Python 2, call Python
without the fixed version number. This should be safe, because we can
expect Linux distributions to ship a version of dh_make that works with
the system’s default Python version.
@@ -12,7 +12,7 @@ all: clean
cd $(BUILDDIR) && \
export DEBEMAIL=$(EMAIL) && \
export DEBFULLNAME=$(MAINTAINER) && \
python2 /usr/bin/dh_make -p $(PKGNAME)_$(PKGVERSION) -i --native -c mit -y && \
python /usr/bin/dh_make -p $(PKGNAME)_$(PKGVERSION) -i --native -c mit -y && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if I have the wrong Python version? Would it scream loud or error silently?

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling dh_make with the wrong Python version results in errors.

dh_make 2.201701 (the new version) with Python 2 gives a module dependency error:

Traceback (most recent call last):
  File "/usr/bin/dh_make", line 16, in <module>
    from enum import Enum
ImportError: No module named enum

dh_make 2.201608 (the old version) with Python 3 even results in a syntax error:

  File "dh_make", line 715
    os.mkdir('source', 0755)
                          ^
SyntaxError: invalid token

So in both cases, we get an error.

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, we should, perhaps, require dh_make to succeed for any of the later commands. In this way, make would get an error exit code and report the version mismatch more nicely.

Currently, the result would be a file not found error toward the end of the Makefile.

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I’d like to call dh_make without python and to rely on a proper shebang declaration. However, dh_make as of 2.201608 declares /usr/bin/python as its interpreter without specifying the required Python version explicitly. This is unfortunate, because now, we have to care about the correct version. However, dh_make 2.201701 has a proper interpreter directive (/usr/bin/python3).

@larsxschneider larsxschneider merged commit 00f7289 into master Jan 8, 2018
@larsxschneider larsxschneider deleted the patrick/fix-dh_make branch January 8, 2018 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants