Bug 211448 - [Flatpak SDK] Import build definitions
Summary: [Flatpak SDK] Import build definitions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-05 08:31 PDT by Philippe Normand
Modified: 2020-05-07 01:34 PDT (History)
6 users (show)

See Also:


Attachments
Patch (289.50 KB, patch)
2020-05-05 08:46 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (289.39 KB, patch)
2020-05-05 08:50 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (294.68 KB, patch)
2020-05-06 03:38 PDT, Philippe Normand
clopez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2020-05-05 08:31:59 PDT
.
Comment 1 Philippe Normand 2020-05-05 08:46:04 PDT
Created attachment 398513 [details]
Patch
Comment 2 Philippe Normand 2020-05-05 08:50:08 PDT
Created attachment 398514 [details]
Patch
Comment 3 Philippe Normand 2020-05-05 09:27:28 PDT
Forgot to mention the bst workspace stuff, hands-on: https://wiki.gnome.org/Newcomers/BuildSystemComponent#Running_software_built_with_BuildStream
Comment 4 Carlos Alberto Lopez Perez 2020-05-05 09:41:33 PDT
Comment on attachment 398514 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398514&action=review

> Tools/ChangeLog:30
> +        To build the SDK, run `Tools/Scripts/webkit-flatpak-sdk --build`,
> +        this can take hours and use gigabytes of your hard-drive. To build
> +        a single recipe, use something like:
> +
> +        `Tools/Scripts/bst-wrapper build sdk/gtk.bst`
> +
> +        To enter the Buildstream SDK shell and debug stuff when hacking on
> +        a specific dependency, `Tools/Scripts/bst-wrapper shell sdk/gtk.bst`.
> +
> +        To test your changes in WebKit:
> +        ```shell
> +        $ Tools/Scripts/webkit-flatpak -u --repo=Tools/buildstream/repo
> +        $ Tools/Scripts/run-minibrowser --gtk --flatpak-repo=Tools/buildstream/repo <url>
> +        ...
> +        ```
> +
> +        bst-wrapper has the same options as bst itself, documented on
> +        https://docs.buildstream.build/1.4.2/index.html.
> +
> +        Internally the bst-wrapper will install Buildstream and a few
> +        other python dependencies in a local virtualenv managed by pipenv.
> +        This is all abstracted though, in theory direct access to the
> +        pipenv environment shouldn't be needed.

Nice summary of how to use this.
Can we add this info in a README file inside Tools/buildstream as well?

> Tools/buildstream/utils/generate-version:16
> +#!/bin/sh
> +
> +timestamp=$(git log -1 --format="%at" HEAD)
> +datestring=$(date -d @$timestamp -Idate)
> +
> +version=$(git describe --always --dirty)
> +
> +cat >$1 <<EOF
> +# no-commit
> +# This file is generated by utils/generate-version as part of the
> +# Makefile / CI system. Please do not commit it.
> +
> +variables:
> +  runtime-version: '${version}'
> +  runtime-version-date: '${datestring}'
> +EOF

Using the git hash as the runtime-version looks less optimal than using the svn version (which its guaranteed to be a monotonically increasing number)
You can get that by calling the script Tools/glib/svn-revision
Comment 5 Philippe Normand 2020-05-05 10:01:26 PDT
Comment on attachment 398514 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398514&action=review

>> Tools/ChangeLog:30
>> +        pipenv environment shouldn't be needed.
> 
> Nice summary of how to use this.
> Can we add this info in a README file inside Tools/buildstream as well?

Yep!

>> Tools/buildstream/utils/generate-version:16
>> +EOF
> 
> Using the git hash as the runtime-version looks less optimal than using the svn version (which its guaranteed to be a monotonically increasing number)
> You can get that by calling the script Tools/glib/svn-revision

Ah yes, this was in a git repo before. Makes sense to use svn rev indeed. Good catch.
Comment 6 Philippe Normand 2020-05-06 03:38:26 PDT
Created attachment 398600 [details]
Patch
Comment 7 Carlos Alberto Lopez Perez 2020-05-06 12:20:46 PDT
Comment on attachment 398600 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398600&action=review

> Tools/buildstream/utils/generate-version:2
> +#!/bin/sh
> +

# To make this script more robust I would set here:
set -eu
Comment 8 Philippe Normand 2020-05-07 01:33:49 PDT
Committed r261274: <https://trac.webkit.org/changeset/261274>
Comment 9 Radar WebKit Bug Importer 2020-05-07 01:34:17 PDT
<rdar://problem/62966399>