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: prepare override scripts to allow rebuilding #2223
Conversation
This projects snapcraft.yaml does not allow for easy rebuilding given the use of linking and patching to make ctypes work properly and the required patches to PyYAML. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
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.
This seems alright, although I have a few suggestions.
snap/snapcraft.yaml
Outdated
@@ -54,9 +54,15 @@ parts: | |||
snapcraftctl build | |||
TRIPLET_PATH="$SNAPCRAFT_PART_INSTALL/usr/lib/$(gcc -print-multiarch)" | |||
LIBSODIUM=$(readlink -n $TRIPLET_PATH/libsodium.so.18) | |||
# Remove so the link can be recreated on re-builds | |||
[ -f "$TRIPLET_PATH/libsodium.so" ] && rm "$TRIPLET_PATH/libsodium.so" |
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.
Just rm -f "$TRIPLET_PATH/libsodium.so"
is simpler and results in the same thing.
snap/snapcraft.yaml
Outdated
patch -d $SNAPCRAFT_PART_INSTALL/lib/python3.5/site-packages -p1 < $SNAPCRAFT_STAGE/pyyaml-support-high-codepoints.diff | ||
patch $SNAPCRAFT_PART_INSTALL/usr/lib/python3.5/ctypes/__init__.py $SNAPCRAFT_STAGE/ctypes_init.diff | ||
# These checks are ugly but allow us to rebuild. | ||
[ -f $SNAPCRAFT_PART_INSTALL/lib/python3.5/site-packages/yaml/emitter.py.orig ] && mv $SNAPCRAFT_PART_INSTALL/lib/python3.5/site-packages/yaml/emitter.py.orig $SNAPCRAFT_PART_INSTALL/lib/python3.5/site-packages/yaml/emitter.py |
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 see no stage
or prime
filter to remove these, nor do I see logic in override-prime
to remove them-- probably best not to ship .orig files in the snap, no?
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 thought it would be rather harmless, but sure.
Codecov Report
@@ Coverage Diff @@
## master #2223 +/- ##
==========================================
- Coverage 91.09% 90.66% -0.44%
==========================================
Files 211 212 +1
Lines 13466 13453 -13
Branches 2008 2000 -8
==========================================
- Hits 12267 12197 -70
- Misses 816 861 +45
- Partials 383 395 +12
Continue to review full report at Codecov.
|
patch -b "$PYTHON_PACKAGE_PATH/ctypes/__init__.py" patches/ctypes_init.diff | ||
patch -b -d "$SITE_PACKAGES_PATH/" -p1 < patches/pyyaml-support-high-codepoints.diff | ||
|
||
# Save patches to allow rebuilding |
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.
Clever, took me a second to figure out what you were doing here.
This projects snapcraft.yaml does not allow for easy rebuilding given the use of linking and patching to make ctypes work properly and the required patches to PyYAML. LP: #1789206 Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
This projects snapcraft.yaml does not allow for easy rebuilding
given the use of linking and patching to make ctypes work properly
and the required patches to PyYAML.
Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com
./runtests.sh static
?./runtests.sh tests/unit
?