db: crossbuild and arm64 fixes

Bug #1105368 reported by Wookey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
db (Ubuntu)
Fix Released
Undecided
Dimitri John Ledkov
db5.3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

db does not crossbuild for a new architecture. Nor would it crossbuild for an existing architecture doing a stage1 profile build either (I don't think). I couldn't even get it to natively build without nobbling the db_signature thing. I don't understand how that is supposed to work, so that part of the patch should be reviewed. It's disabled for the crossbuild anyway so doesn't cause issue there. Although I don't see why it shouldn't work the same in both cases...

So this patch works, but various things were confusing and this is very much a 'version 0.1' cross/staging/arm64 patch. Smoone who knows the package better could improve it.

The main config files are already uptodate and thus work for arm64/aarch64, but the sub-files in the lang/sql dirs (actually 3 in different dirs (sqlite, jdbc, odbc) are old. I tried to get dh-autoreconf to update these with a debian/autoreconf file listing these dirs (or just the lang/sql/sqlite dir, as the only one that actually gets built) but it never put the old files back so a second build would always halt on 'missing/changed files'. So this is a good old-fashioned config.guess/sub patch, because that works. Again, only doing the one dir that gets built out of these 3. I also tried explicit dh_autoreconf and autoreconf_clean commands in the rules file, but still failed to get it to work. I expect this could be done.

I tried a range of things to get past sqlite build errors. config.h from an external libsqlite-dev is needed because -D_HAVE_SQLITE_CONFIG_H is set so the build-dep for that is added to build deps. I don't know why the native build doesn't fall over this problem. Maybe I'm confused, but this worked for me.
An alternative is the part of the patch that disables sql build and package, switched with ENABLE_SQL=no.
It was also necessary to run configure on the lang/sql/sqlite dir otherwise it tries to do a native build there and ignores the configure setting to turn it off. I tried a number of things here and I'm not absolutely sure which combinations are needed. As it stands the SQL part of the build can be disabled, but is not disabled in stage1 as it does not seem to be necessary for a bootstrap (sqlite3 can be cross-built first). This WFM.

DEB_BUILD_OPTIONS=nocheck is not honoured by the rules file, and is overwridden by cross/not cross state. This prevents a native stage1 build as --enable test also requires --enable-tcl. Interesting question as to whether cross should set test state automatically, or if ot should be left to build tools. Better fixes may well be possible here.

The clean target didn't clean the build dir or the generated db_signature file. So a second build never worked. Tidied that too.

The rules files has inconsistent use of $(CURDIR) but I left that alone.

Tags: patch arm64 cross
Revision history for this message
Wookey (wookey) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "db_5.1.29-5ubuntu4-cross-fix-2.patch" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

Changed in db (Ubuntu):
assignee: nobody → Dmitrijs Ledkovs (xnox)
status: New → In Progress
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I don't think db_signature check should run for DEB_STAGE=stage1 builds, since the signature will be different.
Or alternatively one should cache (include in the source package) the expected DEB_STAGE=stage1 db_signature.

Colin just uploaded a change to use autotools-dev helper, it's a pre-decessor to dh_autoreconf which only finds and updates all config.sub|guess files. dh_autoreconf is failing for me as well, but I don't want to dig into and fix their autoconf macros but autotools-dev is all we need.

db seems to include slqlite3 in it's sources and to correctly build it needs tcl8.4:native available to do the amalgamation. [1] But we don't have :native build-dep support yet. So instead of adding sqlite3 build-dep, you can manually install tcl8.4:native (i hope higher versions also work)

I'll upload the rest of the cross-building fixes and add comments about tcl8.4 into the debian/control file.

[1] https://www.sqlite.org/amalgamation.html

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Now thinking about it, since tcl8.4:native is required during the build, maybe the tests can run even if we are building DEB_STAGE=1 withotu tcl-dev.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package db - 5.1.29-5ubuntu6

---------------
db (5.1.29-5ubuntu6) raring; urgency=low

  * Cross building fixes (LP: #1105368):
    - do not run tests when crossbuilding, when nocheck is enabled or stage1.
    - do not check db_signature in stage1 build.
    - comment that tcl:native is needed for cross-builds.

  * Really clean the build directory.

  * Thanks to wookey for the initial patch.
 -- Dmitrijs Ledkovs <email address hidden> Tue, 12 Feb 2013 15:21:04 +0000

Changed in db (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package db5.3 - 5.3.15-4ubuntu2

---------------
db5.3 (5.3.15-4ubuntu2) raring; urgency=low

  [ Dmitrijs Ledkovs ]
  * Cross building fixes (LP: #1105368):
    - do not run tests when crossbuilding, when nocheck is enabled or stage1.
    - do not check db_signature in stage1 build.
    - comment that tcl:native is needed for cross-builds.

  * Really clean the build directory.

  * Thanks to wookey for the initial patch.

  [ Colin Watson ]
  * Use the autotools-dev dh addon, so that we update all the
    config.guess/config.sub copies rather than just the one in dist/.

  [ Matthias Klose ]
  * Disable java bindings for arm64.
  * Introduce a stage1 build to skip the java and the tcl bindings.
 -- Dmitrijs Ledkovs <email address hidden> Tue, 12 Feb 2013 16:32:10 +0000

Changed in db5.3 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.