ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

Replace git downloads with downloads of source tarball #23

Closed WebDrake closed 7 years ago

WebDrake commented 7 years ago

This should probably save some time as well as avoiding the need for the user to have git installed. It should also work around a problem with the Launchpad build setup not being able to clone a git repo.

In support of https://github.com/ldc-developers/ldc2.snap/issues/21.

WebDrake commented 7 years ago

Rebased on master, and switched the downloads to files that actually contain all the source (the previous patch downloaded files that did not include druntime or phobos source code):

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 8e6b08b..fd217d7 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -22,7 +22,7 @@ apps:

 parts:
   ldc:
-    source: https://github.com/ldc-developers/ldc/archive/v1.1.1.tar.gz
+    source: https://github.com/ldc-developers/ldc/releases/download/v1.1.1/ldc-1.1.1-src.tar.gz
     plugin: cmake
     configflags:
     - -DD_COMPILER=../../ldc-bootstrap/build/bin/ldmd2
@@ -50,7 +50,7 @@ parts:
       ldc2.conf: etc/ldc2.conf

   ldc-bootstrap:
-    source: https://github.com/ldc-developers/ldc/archive/v0.17.3.tar.gz
+    source: https://github.com/ldc-developers/ldc/releases/download/v0.17.3/ldc-0.17.3-src.tar.gz
     plugin: cmake
     configflags:
     - -DCMAKE_BUILD_TYPE=Release
WebDrake commented 7 years ago

Note, this patch as-is is problematic because of CMakeLists.txt's rules for comparing LDC_VERSION to the output of git describe. The downloaded source tarballs of course contain no git history, but since the snap package definition itself is in a git tree (and the .git directory is included in the data handed over to the cleanbuild container), the git describe function picks up on the git history of the snap package definition (!) and introduces consequent changes to the LDC_VERSION string. Looking to see if I can work around that by disabling the git describe lookup via cmake options.

WebDrake commented 7 years ago

Options I've tried:

dnadlinger commented 7 years ago

We can always add an option to our CMake script that disables the auto-detection.

WebDrake commented 7 years ago

We can always add an option to our CMake script that disables the auto-detection.

Sounds good. But if you're up for accepting patches to existing releases, a simpler (or complementary) option might be to just replace the git:// submodule URLs with https:// (see https://github.com/ldc-developers/ldc2.snap/issues/21#issuecomment-287575769), which would avoid the need to use the tarballs entirely.

If that would be workable, to which branch should I submit patches for the 1.1.x release series?

WebDrake commented 7 years ago

... ping on the above questions...?