diff mbox series

UBUNTU: snapcraft.yaml: copy retpoline-extract-one to scripts before build

Message ID 1531839069-12334-2-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series UBUNTU: snapcraft.yaml: copy retpoline-extract-one to scripts before build | expand

Commit Message

Paolo Pisati July 17, 2018, 2:51 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1782121

The Ubuntu kernel source code depends on the presence of the
retpoline-extract-one file in the script directory during build (see
scripts/Makefile.build::cmd_ubuntu_retpoline) - such a file lives in the debian
directory and is copied to scripts during the 'debian/rules clean' phase.

Snapcraft is oblivious to the debian details, and the clean target is never
invoked, breaking the normal kernel build (make defconfig; make ...).

To workaround that, before starting the build, make snapcraft do the copy and
fix the build.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 snapcraft.yaml | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Colin Ian King July 17, 2018, 3:04 p.m. UTC | #1
On 17/07/18 15:51, Paolo Pisati wrote:
> BugLink: http://bugs.launchpad.net/bugs/1782121

I don't think that's the correct bug link

> 
> The Ubuntu kernel source code depends on the presence of the
> retpoline-extract-one file in the script directory during build (see
> scripts/Makefile.build::cmd_ubuntu_retpoline) - such a file lives in the debian
> directory and is copied to scripts during the 'debian/rules clean' phase.
> 
> Snapcraft is oblivious to the debian details, and the clean target is never
> invoked, breaking the normal kernel build (make defconfig; make ...).
> 
> To workaround that, before starting the build, make snapcraft do the copy and
> fix the build.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  snapcraft.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/snapcraft.yaml b/snapcraft.yaml
> index 9eb3f40..f96d4aa 100644
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -17,6 +17,10 @@ parts:
>      kconfigflavour: generic
>      kconfigs:
>        - CONFIG_DEBUG_INFO=n
> +    override-build: |
> +      cp debian/scripts/retpoline-extract-one \
> +        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
> +      snapcraftctl build
>    firmware:
>      plugin: nil
>      stage-packages:
>
Paolo Pisati July 17, 2018, 3:15 p.m. UTC | #2
My mistake, that should read:

BugLink: http://bugs.launchpad.net/bugs/1782116

I'll resend.

On Tue, Jul 17, 2018 at 5:04 PM, Colin Ian King
<colin.king@canonical.com> wrote:
> On 17/07/18 15:51, Paolo Pisati wrote:
>> BugLink: http://bugs.launchpad.net/bugs/1782121
>
> I don't think that's the correct bug link
>
>>
>> The Ubuntu kernel source code depends on the presence of the
>> retpoline-extract-one file in the script directory during build (see
>> scripts/Makefile.build::cmd_ubuntu_retpoline) - such a file lives in the debian
>> directory and is copied to scripts during the 'debian/rules clean' phase.
>>
>> Snapcraft is oblivious to the debian details, and the clean target is never
>> invoked, breaking the normal kernel build (make defconfig; make ...).
>>
>> To workaround that, before starting the build, make snapcraft do the copy and
>> fix the build.
>>
>> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
>> ---
>>  snapcraft.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/snapcraft.yaml b/snapcraft.yaml
>> index 9eb3f40..f96d4aa 100644
>> --- a/snapcraft.yaml
>> +++ b/snapcraft.yaml
>> @@ -17,6 +17,10 @@ parts:
>>      kconfigflavour: generic
>>      kconfigs:
>>        - CONFIG_DEBUG_INFO=n
>> +    override-build: |
>> +      cp debian/scripts/retpoline-extract-one \
>> +        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
>> +      snapcraftctl build
>>    firmware:
>>      plugin: nil
>>      stage-packages:
>>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/snapcraft.yaml b/snapcraft.yaml
index 9eb3f40..f96d4aa 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -17,6 +17,10 @@  parts:
     kconfigflavour: generic
     kconfigs:
       - CONFIG_DEBUG_INFO=n
+    override-build: |
+      cp debian/scripts/retpoline-extract-one \
+        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
+      snapcraftctl build
   firmware:
     plugin: nil
     stage-packages: