-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The base coreXX snap is needed for things like determining the package cutoff and classic linting/fixing. Instead of adding the whole snap we cherry-pick things that we know will be needed, so it's possible that the list is at the moment incomplete.
- Loading branch information
Showing
7 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- Mode: Makefile; indent-tabs-mode:t; tab-width: 4 -*- | ||
.PHONY: all | ||
|
||
all: hello-classic | ||
|
||
install: hello-classic | ||
install -d $(DESTDIR)/bin/ | ||
install -D $^ $(DESTDIR)/bin/ | ||
|
||
hello-classic: hello-classic.c | ||
$(CC) hello-classic.c -o hello-classic -lcurl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
#include <curl/curl.h> | ||
|
||
int main() { | ||
curl_global_init(CURL_GLOBAL_DEFAULT); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: patchelf | ||
version: "1.0" | ||
summary: test | ||
description: patchelf | ||
grade: devel | ||
confinement: classic | ||
base: SNAPCRAFT_BASE | ||
build-base: SNAPCRAFT_BUILD_BASE | ||
|
||
parts: | ||
hello: | ||
source: . | ||
plugin: make | ||
build-packages: | ||
- gcc | ||
- libc6-dev | ||
- libcurl4-openssl-dev | ||
build-attributes: | ||
- enable-patchelf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
summary: Check the building and linting of classic snaps | ||
|
||
execute: | | ||
# pack the snap | ||
run_snapcraft pack 2>&1 | tee output.txt | ||
# Check that the rpath was fixed | ||
expected_rpath="Proposed rpath=\['/snap/${SNAPCRAFT_BASE}/current/lib/x86_64-linux-gnu'\]" | ||
MATCH "$expected_rpath" < output.txt | ||
# Check that the linter is working (by declaring that libcurl was not found) | ||
expected_libcurl="library: bin/hello-classic: missing dependency 'libcurl" | ||
MATCH "$expected_libcurl" < output.txt | ||
# Check that libraries that are *not* packed on the snap but *are* present on | ||
# the base snap are not listed as missing | ||
unexpected_libresolv="library: bin/hello-classic: missing dependency 'libresolv.so" | ||
NOMATCH "$unexpected_libresolv" < output.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# NOTE: This project comes from snapcraft | ||
# (tests/spread/core24/snap-creation/package-cutoff) | ||
name: package-cutoff | ||
base: SNAPCRAFT_BASE | ||
build-base: SNAPCRAFT_BUILD_BASE | ||
version: '1.0' | ||
summary: 'test' | ||
description: test | ||
grade: devel | ||
confinement: devmode | ||
|
||
# The parts defined here will be in conflict if the package-cutoff is not working; | ||
# Without the cutoff, part-1's staging of libpng16-16 will pull in libc6, which | ||
# will create a directory called "lib64/". part-2's python plugin will also create | ||
# "lib64", but as a symlink to "lib". The regular directory and the symlink will | ||
# then be in conflict and the build will fail. | ||
parts: | ||
part-1: | ||
source: . | ||
plugin: nil | ||
stage-packages: | ||
- libpng16-16 | ||
part-2: | ||
source: . | ||
plugin: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
summary: Test package cutoff due to base snap | ||
|
||
|
||
execute: | | ||
# pack the snap | ||
run_snapcraft pack | ||
# Make sure the packed snap does *not* have a bundled libc6 | ||
unsquashfs -l package-cutoff_1.0_amd64.snap | NOMATCH libc\.so |