-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snap: Build snaps on Travis via remote-build #506
Conversation
An exemplary build: https://travis-ci.org/ppd1990/solvespace/builds/616292318 |
Great work refactoring the Travis config! I would prefer if it went in as a separate PR so we can get the benefits of it before snapcraft releases their changes. |
Do you think we should refine the Travis config further into |
That would be great! We definitely shouldn't publish packages that don't pass tests. |
We have no easy build artefact sharing between Travis stages though. Suppose we want something like this: Stage: Test
Stage: Deploy (run only if all jobs in Test succeed)
Then we need to do the OSX build twice. Also: Do we want to block snap builds if OSX fails? Do we want to block all deploy jobs when a single one of the test jobs fails? |
No.
The tests are supposed to be completely platform-independent. (There's a few tricky parts, mostly having to do with FP precision issues and such.) So I think we should run tests on every platform, but as a redundant mechanism to alert us if they somehow are not platform-independent; they ideally always should be. |
With the currently merged Travis config, we run sequentially like so:
Adding snap:
So OSX & Snap are blocked by Debian/Ubuntu test fails and of course by their own fails. I feel that Snap deployments are rather uncritical as we'd only ever manually promote revisions to |
.travis/install-macos.sh
Outdated
@@ -2,3 +2,4 @@ | |||
|
|||
brew update | |||
brew install freetype cairo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the macOS build is failing, and it might be fixed (and become faster) by removing the brew update & brew install statements.
I don't think we need to update brew and also don't need freetype & cairo since they are already bundled as git submodules.
It seems we only need git & cmake which should already be installed by default on Travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to update brew and also don't need freetype & cairo since they are already bundled as git submodules.
My position is that libraries that are available on the system should not be linked as submodules, and also should be linked dynamically, if possible at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, however, cairo and freetype are not installed by default as far as I know, so I think we should make sure they are included (on macOS and windows deliverables) also, the CI should probably test the dependencies that are linked as submodules to make sure they work.
I have seen many OSS failing on macOS due to some missing library and otool workarounds (even on this repo if I remember correctly) and I guess that is not what we want.
As an added bonus, I guess the libraries that are in use are not that big at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen many OSS failing on macOS due to some missing library and otool workarounds (even on this repo if I remember correctly) and I guess that is not what we want.
They're now linked statically instead, which is what I should have done in the first place.
the CI should probably test the dependencies that are linked as submodules to make sure they work.
Our CI is already quite slow and testing the dependency version that is updated once a few months at best is a waste of time.
Note to myself: |
Snapcraft 3.9.2 is in the stable channel Edit: It was rolled back due to a bug. Still waiting for 3.9.3 to hit stable today: https://forum.snapcraft.io/t/call-for-testing-snapcraft-3-9/13944/30?u=ppd Edit 2: And nothing yet. 3.9.3 seems to be blocked too. Edit 2020-01-08: Still nothing. Rest assured, this PR is not forgotten... |
We invoke builds on Launchpad in stage "deploy" and release it into the edge channel of the Snap Store. The deploy stage is blocked on fails of the test stage, so we don't release snaps with failing tests.
A little closer to the finish line: https://travis-ci.org/ppd1990/solvespace/builds/639505699 Nothing much left to do, I guess. Snapcraft 3.9.7 is stable, Launchpad is happy, Travis is happy. Are we happy? |
Yup all looks good. Let me know how I should merge this and we're done. |
./pkg/snap/build.sh remote-build \
--launchpad-user solvespace \
--launchpad-accept-public-upload \ You will now have those credentials stored in
snapcraft export-login --snaps=solvespace --channels=beta,edge snapcraft-login
travis env set SNAP_TOKEN "$(cat snapcraft-login)" Those are the credentials for pushing & releasing to the store. |
Re the failed to deploy error: I found this in def push_app
snaps = Dir.glob(snap)
case snaps.length
when 0
error "No snap found matching '#{snap}'"
when 1
snap_path = snaps.first
context.fold("Pushing snap") do
context.shell "snapcraft push #{snap_path} --release=#{channel}"
end
else
snap_list = snaps.join(', ')
error "Multiple snaps found matching '#{snap}': #{snap_list}"
end
end or v2 def validate
error :no_snaps if snaps.empty?
error :multiple_snaps if snaps.size > 1
end I guess the deployment is meant to only handle one snap at a time. |
@whitequark We can fix this by either a deployment script or by explicit deploy sections for each architecture (n = 4 x 2 = 8), which seems a little heavy-handed. What do you prefer? |
Deployment script seems fine. |
See #543 |
This PR introduces building & publishing of snaps into the CI pipeline.
Implements #483
A bit of refactoring while at it:Fix invalid osx_image xcode8.2Drop depreceated sudo keywordRun debian build on bionic image & re-enable building with uiSplit build stage into separate jobs for better separation of concernsI guess the unrelated changes should be split out into separate PRs if the general approach is considered sane.The above was merged in #510
What's left to do