Need to build from subdir of source without removing rest of repo

Bug #1606833 reported by Nick Moffitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapcraft (Ubuntu)
New
Undecided
Unassigned

Bug Description

While attempting to build a library as a part, I need to follow these instructions:

    cd build/autotools
    autoreconf -i
    ./configure CFLAGS='-O2'
    make

The autotools plugin does almost exactly the right thing here, except that it doesn't cd into build/autotools first. I tried using the source-subdir option to make it build in that subdir, but unfortunately that's not meant to be the top of the source tree (for example, src/ is right next to build/ in this repo). Unfortunately source-subdir meant that all I had was my automake/m4 stuff without any C sources!

It would be extremely helpful if any of these build plugins had an option for a directory to cd into before either each step or the chain of steps as a whole.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: snapcraft 2.13.1
ProcVersionSignature: Ubuntu 4.4.0-24.43-generic 4.4.10
Uname: Linux 4.4.0-24-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Jul 27 11:13:17 2016
InstallationDate: Installed on 2014-05-29 (789 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
PackageArchitecture: all
SourcePackage: snapcraft
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :
Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

It looks like I had some leftover noise in my environment. I just re-tried source-subdir and it worked. Apologies for the noise!

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

Hm, but no, it's still very wrong and I end up with no sources in my parts in the end...

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

In my build tree, that is.

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

Here's the snapcraft.yaml I'm sketching out that runs into this: http://pastebin.ubuntu.com/21125851/

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

this should be doable with scriptlets https://snapcraft.io/docs/build-snaps/scriptlets

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.