Build process corrupting binary?

Asked by Michel Helms

Hi!

I just solved the problem of getting a PPA into Launchpad and it works! I am so happy! I have a binary to distribute only so the Makefile looks like this:

BINDIR := /usr/bin
all:
install:
 mkdir -p ${DESTDIR}${BINDIR}
 cp cronjob-guardian ${DESTDIR}${BINDIR}/

So it just copies the binary from the same folder into /usr/bin.

However, when I install this PPA on a different system it puts a smaller binary into /usr/bin, only 30.8 MB instead of the original 39.5 MB. The `cmp` app says the differences start at byte 41, so it is not just truncated.

That binary always fails with "Pkg: Error reading from file.", doesn't even start. I am not sure where this error message comes from. The original binary is executable on that same system.

Does anyone have an idea why the binary is altered and why it isn't executable anymore?

Thank you!

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

The standard packaging machinery automatically runs "strip" over installed binaries. See "man dh_strip", and you can have a look in /usr/bin/dh_strip to see details of what it does. I've never previously heard of it breaking a program, but I suppose it's technically possible if the binary is sufficiently strange. In any case, you can tell debhelper not to do this by putting something like this in debian/rules (see "man dh", and note that the eight leading spaces should be a hard tab character, as usual for Makefiles):

override_dh_strip:
        # some appropriate comment explaining why this is disabled

Also, you could remove the artificial Makefile from your packaging and instead put the single line "cronjob-guardian usr/bin" in debian/cronjob-guardian.install, which would be rather simpler.

Revision history for this message
Michel Helms (badestrand) said :
#2

Wonderful, I will try that, thank you so much Colin!

Can you help with this problem?

Provide an answer of your own, or ask Michel Helms for more information if necessary.

To post a message you must log in.