{"action":"opened","issue":{"url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/156","repository_url":"https://api.github.com/repos/flatpak/flatpak-builder","labels_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/156/comments","events_url":"https://api.github.com/repos/flatpak/flatpak-builder/issues/156/events","html_url":"https://github.com/flatpak/flatpak-builder/issues/156","id":326220023,"number":156,"title":"Allow building SDK extensions that require SDK extensions","user":{"login":"mbooth101","id":597661,"avatar_url":"https://avatars2.githubusercontent.com/u/597661?v=4","gravatar_id":"","url":"https://api.github.com/users/mbooth101","html_url":"https://github.com/mbooth101","followers_url":"https://api.github.com/users/mbooth101/followers","following_url":"https://api.github.com/users/mbooth101/following{/other_user}","gists_url":"https://api.github.com/users/mbooth101/gists{/gist_id}","starred_url":"https://api.github.com/users/mbooth101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbooth101/subscriptions","organizations_url":"https://api.github.com/users/mbooth101/orgs","repos_url":"https://api.github.com/users/mbooth101/repos","events_url":"https://api.github.com/users/mbooth101/events{/privacy}","received_events_url":"https://api.github.com/users/mbooth101/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-24T17:31:37Z","updated_at":"2018-05-24T17:31:37Z","closed_at":null,"author_association":"NONE","body":"I have a use-case where I think it would be useful to allow SDK extensions to require extensions, but it seems like it currently can't be done. For example, I might want to use the previous version of the JDK to bootstrap the next version of the JDK, so that we don't have to rely on pre-built binaries from some place else.\r\n\r\nConsider an app that uses an extension; it works fine:\r\n\r\n```\r\n$ cat org.freedesktop.Sdk.Extension.testapp.json\r\n{\r\n  \"id\" : \"org.freedesktop.Sdk.Extension.testapp\",\r\n  \"branch\" : \"1.6\",\r\n  \"runtime\" : \"org.freedesktop.Sdk\",\r\n  \"runtime-version\" : \"1.6\",\r\n  \"sdk\" : \"org.freedesktop.Sdk\",\r\n  \"sdk-extensions\" : [ \"org.freedesktop.Sdk.Extension.openjdk9\" ],\r\n  \"modules\" : [\r\n    {\r\n      \"name\" : \"test\",\r\n      \"no-autogen\" : true,\r\n      \"sources\" : [\r\n        {\r\n          \"type\" : \"shell\",\r\n          \"commands\": [\r\n                  \"ls -l /usr/lib/sdk/openjdk9\"\r\n          ]\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n$ flatpak-builder --force-clean --repo=repo jdk-build org.freedesktop.Sdk.Extension.testapp.json \r\nEmptying app dir 'jdk-build'\r\nDownloading sources\r\nStarting build of org.freedesktop.Sdk.Extension.testapp\r\nCache miss, checking out last cache hit\r\n========================================================================\r\nBuilding module test in /home/mbooth/flatpak/flathub/.flatpak-builder/build/test-12\r\n========================================================================\r\ntotal 44\r\ndrwxr-xr-x 2 nfsnobody nfsnobody 4096 Jan  1  1970 bin\r\n-rwxr-xr-x 2 nfsnobody nfsnobody   54 Jan  1  1970 enable.sh\r\n-rwxr-xr-x 2 nfsnobody nfsnobody  122 Jan  1  1970 installjdk.sh\r\n-rwxr-xr-x 2 nfsnobody nfsnobody  151 Jan  1  1970 install.sh\r\ndrwxr-xr-x 3 nfsnobody nfsnobody 4096 Jan  1  1970 jvm\r\n-rw-r--r-- 2 nfsnobody nfsnobody 8507 Jan  1  1970 manifest.json\r\ndrwxr-xr-x 4 nfsnobody nfsnobody 4096 Jan  1  1970 share\r\n```\r\n\r\nHowever, when you add the one extra line **\"build-extension\" : true,** to the manifest to turn it into an extension, it fails:\r\n\r\n```\r\n$ cat org.freedesktop.Sdk.Extension.testext.json \r\n{\r\n  \"id\" : \"org.freedesktop.Sdk.Extension.testext\",\r\n  \"branch\" : \"1.6\",\r\n  \"runtime\" : \"org.freedesktop.Sdk\",\r\n  \"runtime-version\" : \"1.6\",\r\n  \"build-extension\" : true,\r\n  \"sdk\" : \"org.freedesktop.Sdk\",\r\n  \"sdk-extensions\" : [ \"org.freedesktop.Sdk.Extension.openjdk9\" ],\r\n  \"modules\" : [\r\n    {\r\n      \"name\" : \"test\",\r\n      \"no-autogen\" : true,\r\n      \"sources\" : [\r\n        {\r\n          \"type\" : \"shell\",\r\n          \"commands\": [\r\n                  \"ls -l /usr/lib/sdk/openjdk9\"\r\n          ]\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n$ flatpak-builder --force-clean --repo=repo jdk-build org.freedesktop.Sdk.Extension.testext.json \r\nEmptying app dir 'jdk-build'\r\nDownloading sources\r\nStarting build of org.freedesktop.Sdk.Extension.testext\r\nCache miss, checking out last cache hit\r\n========================================================================\r\nBuilding module test in /home/mbooth/flatpak/flathub/.flatpak-builder/build/test-13\r\n========================================================================\r\nls: cannot access '/usr/lib/sdk/openjdk9': No such file or directory\r\n```\r\n\r\nIs it intentional to disallow using extensions to build extensions?\r\n\r\nFWIW, I currently have installed:\r\n\r\n    $ rpm -q flatpak-builder flatpak\r\n    flatpak-builder-0.10.10-2.fc28.x86_64\r\n    flatpak-0.11.7-1.fc28.x86_64\r\n"}}
{"actor":{"display_login":"mbooth101"}}