Skip to content

Added support for Devuan#614

Closed
Centuriondan wants to merge 2 commits intoLinuxCNC:masterfrom
Centuriondan:master
Closed

Added support for Devuan#614
Centuriondan wants to merge 2 commits intoLinuxCNC:masterfrom
Centuriondan:master

Conversation

@Centuriondan
Copy link

@Centuriondan Centuriondan commented Jun 18, 2019

These commits:

  1. adds support for detecting Devuan GNU/Linux versions into the debian/configure script
  2. fixes the "clean" stage so it doesn't try to run autoconfig.sh (breaks building with pbuilder because deps are resolved after the clean stage.
  • this meant making some of the clean steps result be ignored because it tries to clean files that haven't yet been created.

* don't run autoconf during clean

* stop clean rule from erroring on make clean -s
@andypugh andypugh requested a review from jepler June 18, 2019 10:36
@andypugh
Copy link
Collaborator

Are you sure about the "clean" changes? I have not noticed a problem with it, and it seems likely that the code was put in for a reason.

@SebKuzminsky
Copy link
Collaborator

SebKuzminsky commented Jun 18, 2019

The autogen and configure steps produce the Makefile.inc file, without which $(MAKE) clean will fail.

@SebKuzminsky
Copy link
Collaborator

I should also mention that we currently build packages using pbuilder and it works just fine, eg: http://buildbot.linuxcnc.org/buildbot/builders/4031.deb-stretch-rtpreempt-amd64/builds/800

@Centuriondan
Copy link
Author

Centuriondan commented Jun 18, 2019

The autogen and configure steps produce the Makefile.inc file, without which $(MAKE) clean will fail.
That is why I made the "rm" commands result ignored by prefixing the "-"
Autogen gets run during the build phase anyway.

To me it seems bad form to run build operations in order to have generated files to clean up...

@Centuriondan
Copy link
Author

I should also mention that we currently build packages using pbuilder and it works just fine, eg: http://buildbot.linuxcnc.org/buildbot/builders/4031.deb-stretch-rtpreempt-amd64/builds/800

Interesting.... because for me it fails because the configure step fails due to missing dependencies. Is your pbuilder environment populated with some of the dependencies already??

@SebKuzminsky
Copy link
Collaborator

@Centuriondan and I spoke about this some on IRC and discovered a difference in how we build debs, that may be responsible for this problem.

The LinuxCNC Buildbot uses this package build process:

  1. Configure source for the current distro: cd debian; ./configure
  2. Install missing build dependencies: pbuilder-satisfydepends
  3. Build source package: dpkg-buildpackage -S
  4. Build binary package (in pbuilder): pbuilder build

In contrast, @Centuriondan tells me he uses git-buildpackage, using a process like this:

  1. Configure source for the current distro: cd debian; ./configure
  2. Build source & binary packages (in pbuilder): gbp buildpackage --git-pbuilder

However, i just tried building our master branch (without @Centuriondan's PR) and it built fine. I ran these commands:

  1. sudo git-pbuilder create
  2. cd linuxcnc-dev
  3. git checkout master
  4. cd debian; ./configure uspace; cd ..
  5. sudo gbp buildpackage --git-pbuilder --git-ignore-branch

This seemed to build the dsc on the host machine (not in pbuilder), similar to the process our buildbot uses. @Centuriondan, please correct me if i'm wrong in that assessment.

Building the dsc of course requires making clean, to ensure that any old build artifacts lying around in your working directory don't get accidentally mixed in to the clean pbuilder build. My build machine has the linuxcnc build dependencies installed, which is why the dsc build worked. A clean pbuilder environment is expected to not have these dependencies installed, so if you somehow build the dsc inside pbuilder it'll fail. This must be how @Centuriondan does his build, though i haven't been able to replicate it.

The second commit in this PR ("fix clean routine") breaks debian/rules clean by making it try to run make clean without running autogen and src/configure to create Makefile.inc. This results in an error:

$ fakeroot ./debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp
cd src && /usr/bin/make clean -s
Makefile:82: *** Makefile.inc must specify RTPREFIX and other variables.  Stop.
make: [debian/rules:47: clean] Error 2 (ignored)
rm -f Makefile.inc
rm -f src/config.log src/config.status
dh_clean

The make clean invocation errors out before cleaning up, and old object files and other junk is left behind in the build directory while constructing the source package. I think this current approach is a mistake.
I would welcome a PR with just the first commit ("Added support for Devuan"), but the second commit shouldn't go in, as it currently exists. The Devuan support PR should be made against 2.8.

@Centuriondan
Copy link
Author

Centuriondan commented Jun 18, 2019

@SebKuzminsky Your right, it does build them locally first, but I don't have ALL the deps installed locally. (And shouldn't need them for a source build). FWIW, Devuan builds the source package from the source in a buildhost again without the deps being installed.

It still seem wrong to me to have make clean running autoconf to generate files it needs to delete.
my approach makes deletion of the generated files non-fatal if they fail because the files aren't there.

That said, what I'll have to do to for Devuan will be a derivation from LinuxCNC's buildbot setup anyway.

I'll resubmit the first commit as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants