Getting green ticks on the SPI build matrix #6

Closed
opened 2024-03-26 11:53:27 +01:00 by finestructure · 12 comments
finestructure commented 2024-03-26 11:53:27 +01:00 (Migrated from github.com)

Hi, it's great to see this package on swift.org but I noticed that we're currently showing all grey boxes over on the SPI compatibility matrix:

CleanShot 2024-03-26 at 11 17 21@2x

We currently don't support adding OS level dependencies for build on Apple platforms but our Linux builders are a bit more flexible. I've tried running a build locally with the dependencies set up but I'm getting build errors:

/host/adwaita-swift/Sources/Adwaita/Model/User Interface/Window/GTUIAboutWindow.swift:18:23: error: cannot find 'adw_about_window_new_from_appdata' in scope
            pointer = adw_about_window_new_from_appdata(filePath, nil)?.cast()
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/host/adwaita-swift/Sources/Adwaita/Model/User Interface/Window/GTUIAboutWindow.swift:18:67: error: 'nil' requires a contextual type
            pointer = adw_about_window_new_from_appdata(filePath, nil)?.cast()
                                                                  ^

Here are the steps to reproduce:

docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash swift:5.10-jammy
apt-get update
apt-get install libadwaita-1-dev
git clone https://github.com/AparokshaUI/adwaita-swift
cd adwaita-swift
swift build

It looks like libadwaita-1-dev isn't the correct dependency. Do you know what dev package needs to be installed on Ubuntu?

Hi, it's great to see this package on swift.org but I noticed that we're currently showing all grey boxes over on the [SPI compatibility matrix](https://swiftpackageindex.com/AparokshaUI/adwaita-swift): ![CleanShot 2024-03-26 at 11 17 21@2x](https://github.com/AparokshaUI/adwaita-swift/assets/65520/8c7810d6-0f7e-4e07-a944-b9d7f0d8ed18) We currently don't support adding OS level dependencies for build on Apple platforms but our Linux builders are a bit more flexible. I've tried running a build locally with the dependencies set up but I'm getting build errors: ``` /host/adwaita-swift/Sources/Adwaita/Model/User Interface/Window/GTUIAboutWindow.swift:18:23: error: cannot find 'adw_about_window_new_from_appdata' in scope pointer = adw_about_window_new_from_appdata(filePath, nil)?.cast() ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /host/adwaita-swift/Sources/Adwaita/Model/User Interface/Window/GTUIAboutWindow.swift:18:67: error: 'nil' requires a contextual type pointer = adw_about_window_new_from_appdata(filePath, nil)?.cast() ^ ``` Here are the steps to reproduce: ``` docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash swift:5.10-jammy apt-get update apt-get install libadwaita-1-dev git clone https://github.com/AparokshaUI/adwaita-swift cd adwaita-swift swift build ``` It looks like `libadwaita-1-dev` isn't the correct dependency. Do you know what dev package needs to be installed on Ubuntu?
david-swift commented 2024-03-26 12:06:51 +01:00 (Migrated from github.com)

Thanks for looking into this!

I think it is libadwaita-1-dev, but probably, the Ubuntu version is not yet on the latest version? This package requires Libadwaita 1.5 (it is normally used inside a Flatpak, and Homebrew is already on version 1.5). The latest version seems to be Beta on Ubuntu packages.

Thanks for looking into this! I think it is `libadwaita-1-dev`, but probably, the Ubuntu version is not yet on the latest version? This package requires Libadwaita 1.5 (it is normally used inside a Flatpak, and Homebrew is already on version 1.5). The latest version seems to be [Beta on Ubuntu packages](https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=libadwaita-1-dev&searchon=names).
finestructure commented 2024-03-26 14:40:47 +01:00 (Migrated from github.com)

Oh, I see, thanks for checking that. Is there a way to get the beta package on jammy?

The alternative would be to use a noble base image but there isn't one yet with Swift on it, so it'd be a whole different thing to get that set up 😕

Oh, I see, thanks for checking that. Is there a way to get the beta package on jammy? The alternative would be to use a `noble` base image but there [isn't one yet with Swift](https://hub.docker.com/_/swift/tags?page=1&name=noble) on it, so it'd be a whole different thing to get that set up 😕
david-swift commented 2024-03-30 18:52:53 +01:00 (Migrated from github.com)

@finestructure I'd like to move to DocC for the documentation and host it on the SPI, since I like to have the "Reference documentation" and articles/tutorials combined in one service, and as SPI offers that amazing, super simple approach to hosting it. I wanted to ask whether, as soon as we can fix the compatibility matrix problem, we can apply the same solution to the documentation generator? I don't know whether that is a good approach, but Homebrew is very fast with updating to the newest versions of libadwaita (I also won't update this package faster than Homebrew). Maybe we can install via Homebrew?

@finestructure I'd like to move to DocC for the documentation and host it on the SPI, since I like to have the "Reference documentation" and articles/tutorials combined in one service, and as SPI offers that amazing, super simple approach to hosting it. I wanted to ask whether, as soon as we can fix the compatibility matrix problem, we can apply the same solution to the documentation generator? I don't know whether that is a good approach, but Homebrew is very fast with updating to the newest versions of libadwaita (I also won't update this package faster than Homebrew). Maybe we can install via Homebrew?
david-swift commented 2024-03-30 21:23:45 +01:00 (Migrated from github.com)

@finestructure does it have to be Ubuntu? With e.g. Fedora 40 it's very simple (the Swift version is 5.8.1):

sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40
dnf install swiftlang -y
dnf install libadwaita-devel -y
dnf install git -y
git clone https://github.com/AparokshaUI/adwaita-swift
cd adwaita-swift
swift build
@finestructure does it have to be Ubuntu? With e.g. Fedora 40 it's very simple (the Swift version is 5.8.1): ``` sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40 dnf install swiftlang -y dnf install libadwaita-devel -y dnf install git -y git clone https://github.com/AparokshaUI/adwaita-swift cd adwaita-swift swift build ```
finestructure commented 2024-03-30 21:41:17 +01:00 (Migrated from github.com)

@finestructure I'd like to move to DocC for the documentation and host it on the SPI, since I like to have the "Reference documentation" and articles/tutorials combined in one service, and as SPI offers that amazing, super simple approach to hosting it. I wanted to ask whether, as soon as we can fix the compatibility matrix problem, we can apply the same solution to the documentation generator? I don't know whether that is a good approach, but Homebrew is very fast with updating to the newest versions of libadwaita (I also won't update this package faster than Homebrew). Maybe we can install via Homebrew?

The doc generation runs as an additional phase right after building, so once builds work, doc gen is pretty much automatic.

We don't currently support installing dependencies with Homebrew but we may have that in place in a few weeks, if things go as planned.

The route with a linux base image is currently probably our best shot to get this working (and we support doc gen on Linux as well).

> @finestructure I'd like to move to DocC for the documentation and host it on the SPI, since I like to have the "Reference documentation" and articles/tutorials combined in one service, and as SPI offers that amazing, super simple approach to hosting it. I wanted to ask whether, as soon as we can fix the compatibility matrix problem, we can apply the same solution to the documentation generator? I don't know whether that is a good approach, but Homebrew is very fast with updating to the newest versions of libadwaita (I also won't update this package faster than Homebrew). Maybe we can install via Homebrew? The doc generation runs as an additional phase right after building, so once builds work, doc gen is pretty much automatic. We don't currently support installing dependencies with Homebrew but we may have that in place in a few weeks, if things go as planned. The route with a linux base image is currently probably our best shot to get this working (and we support doc gen on Linux as well).
finestructure commented 2024-03-30 21:45:26 +01:00 (Migrated from github.com)

@finestructure does it have to be Ubuntu? With e.g. Fedora 40 it's very simple (the Swift version is 5.8.1):


sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40

dnf install swiftlang -y

dnf install libadwaita-devel -y

dnf install git -y

git clone https://github.com/AparokshaUI/adwaita-swift

cd adwaita-swift

swift build

That would work in principle, yes, though it'd be a bit more complicated to set up than just extending our existing Linux base images.

Are there other Swift versions available on Fedora? As you can see from the linked repo we try to create base images for all supported Swift versions (5.7, 5.8, 5.9, 5.10), so it'd be good if that was possible.

> @finestructure does it have to be Ubuntu? With e.g. Fedora 40 it's very simple (the Swift version is 5.8.1): > > ``` > > sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40 > > dnf install swiftlang -y > > dnf install libadwaita-devel -y > > dnf install git -y > > git clone https://github.com/AparokshaUI/adwaita-swift > > cd adwaita-swift > > swift build > > ``` That would work in principle, yes, though it'd be a bit more complicated to set up than just extending our existing [Linux base images](https://gitlab.com/finestructure/spi-images/). Are there other Swift versions available on Fedora? As you can see from the linked repo we try to create base images for all supported Swift versions (5.7, 5.8, 5.9, 5.10), so it'd be good if that was possible.
david-swift commented 2024-03-31 08:37:17 +02:00 (Migrated from github.com)

@finestructure The downloads on the Swift website are probably the easiest way for using a specific version:

sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40

curl https://download.swift.org/swift-5.10-release/amazonlinux2/swift-5.10-RELEASE/swift-5.10-RELEASE-amazonlinux2.tar.gz --output swift.tar.gz
tar -xvzf swift.tar.gz

dnf install libadwaita-devel -y

dnf install git -y
git clone https://github.com/AparokshaUI/adwaita-swift
cd adwaita-swift
../swift-*.**-RELEASE-amazonlinux2/usr/bin/swift build
@finestructure The downloads on the Swift website are probably the easiest way for using a specific version: ``` sudo docker run --rm -it -v $PWD:/host -w /host --network="host" --entrypoint bash fedora:40 curl https://download.swift.org/swift-5.10-release/amazonlinux2/swift-5.10-RELEASE/swift-5.10-RELEASE-amazonlinux2.tar.gz --output swift.tar.gz tar -xvzf swift.tar.gz dnf install libadwaita-devel -y dnf install git -y git clone https://github.com/AparokshaUI/adwaita-swift cd adwaita-swift ../swift-*.**-RELEASE-amazonlinux2/usr/bin/swift build ```
finestructure commented 2024-04-02 10:56:05 +02:00 (Migrated from github.com)

Ok, great, this seems to work. I've set up a new base image and will re-trigger builds once it's done generating the images.

Ok, great, this seems to work. I've set up a [new base image](https://gitlab.com/finestructure/spi-images/-/merge_requests/24) and will re-trigger builds once it's done generating the images.
finestructure commented 2024-04-02 11:15:59 +02:00 (Migrated from github.com)

Well, actually it'll require a .spi.yml change, PR open.

Well, actually it'll require a `.spi.yml` change, PR open.
finestructure commented 2024-04-02 14:25:02 +02:00 (Migrated from github.com)

Builds retriggered and passing now:

CleanShot 2024-04-02 at 14 22 57@2x

BTW, note that the documentation link is broken. I believe it's because the ref in .spi.yml isn't a proper https link:

  documentation: "aparokshaui.github.io/adwaita-swift/"

(This should be fixed if you switch over the doc hosting as discussed.)

Builds retriggered and passing now: ![CleanShot 2024-04-02 at 14 22 57@2x](https://github.com/AparokshaUI/adwaita-swift/assets/65520/0c8d80e1-0989-44c4-89b9-fd3d6e38d582) BTW, note that the documentation link is broken. I believe it's because the ref in `.spi.yml` isn't a proper https link: ``` documentation: "aparokshaui.github.io/adwaita-swift/" ``` (This should be fixed if you switch over the doc hosting as discussed.)
david-swift commented 2024-04-02 14:31:26 +02:00 (Migrated from github.com)

Nice! It would be cool if you could inform me when installing dependencies from Homebrew is possible to make the macOS build work as well (that's why I reopened this issue).

About the docs: Should the link be https://aparokshaui.github.io/adwaita-swift/documentation/adwaita/ work? I'm happy with the GitHub actions approach I'm using now.

Nice! It would be cool if you could inform me when installing dependencies from Homebrew is possible to make the macOS build work as well (that's why I reopened this issue). About the docs: Should the link be `https://aparokshaui.github.io/adwaita-swift/documentation/adwaita/` work? I'm happy with the GitHub actions approach I'm using now.
finestructure commented 2024-04-02 14:42:07 +02:00 (Migrated from github.com)
I think it should, see https://swiftpackageindex.com/swiftpackageindex/spimanifest/1.4.1/documentation/spimanifest/commonusecases#Configure-a-documentation-URL-for-existing-documentation for details!
david-swift added the
enhancement
label 2024-10-07 12:16:07 +02:00
Sign in to join this conversation.
No Milestone
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aparoksha/adwaita-swift#6
No description provided.