Skip to contentSkip to conversation

configure: add sanity check to catch builds from "git archive"

PATCH Applied Daniel P. Berrangé 4 participants 5 messages Apr 18, 2018 – Jun 29, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 configure: add sanity check to catch builds from "git archive"

The "git archive" feature creates tarballs which are missing all submodule content. GitHub unhelpfully provides users with "Download" links that claim to give them valid source release tarballs. These GitHub archives will not be buildable as they are created by the "git archive" feature and so are missing content. The user gets unhelpful messages from make such as:

fatal error: ui/input-keymap-atset1-to-qcode.c: No such file or directory

By adding a sanity check we can give users an informative message about what they've done wrong.

---
 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure +18 -0
index 0a19b033bc..089b00068c 100755
@@ -296,6 +296,24 @@ then
 else
     git_update=no
     git_submodules=""
+
+    if ! test -f "$source_path/ui/keycodemapdb/README"
+    then
+        echo
+        echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+        echo
+        echo "This is not a GIT checkout but module content appears to"
+        echo "be missing. Do not use 'git archive' or GitHub download links"
+        echo "to acquire QEMU source archives. Non-GIT builds are only"
+        echo "supported with source archives linked from:"
+        echo
+        echo "  https://www.qemu.org/download/"
+        echo
+        echo "Developers working with GIT can use scripts/archive-source.sh"
+        echo "if they need to create valid source archives."
+        echo
+        exit 1
+    fi
 fi
 git="git"
 
Signature · 1 line
2.14.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 36 lines · On Wed, 18 Apr 2018 18:11:51 +0100 Daniel P. Berrangé <[email protected]>…

The "git archive" feature creates tarballs which are missing all submodule content. GitHub unhelpfully provides users with "Download" links that claim to give them valid source release tarballs. These GitHub archives will not be buildable as they are created by the "git archive" feature and so are missing content. The user gets unhelpful messages from make such as:

fatal error: ui/input-keymap-atset1-to-qcode.c: No such file or directory

By adding a sanity check we can give users an informative message about what they've done wrong.

---
 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure +11 -0
index 0a19b033bc..089b00068c 100755
@@ -296,6 +296,24 @@ then
 else
     git_update=no
     git_submodules=""
+
+    if ! test -f "$source_path/ui/keycodemapdb/README"
+    then
+        echo
+        echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+        echo
+        echo "This is not a GIT checkout but module content appears to"
+        echo "be missing. Do not use 'git archive' or GitHub download links"
+        echo "to acquire QEMU source archives. Non-GIT builds are only"
+        echo "supported with source archives linked from:"
+        echo

configure then · line 319

Quoted 10 lines
configure +7 -0
+        echo "  https://www.qemu.org/download/"
+        echo
+        echo "Developers working with GIT can use scripts/archive-source.sh"
+        echo "if they need to create valid source archives."
+        echo
+        exit 1
+    fi
 fi
 git="git"
 
Reviewed-by Tested-by on v2 1/1
#2 lore raw
In reply to Daniel P. Berrangé
Quoted 11 lines · Daniel P. Berrangé

The "git archive" feature creates tarballs which are missing all submodule content. GitHub unhelpfully provides users with "Download" links that claim to give them valid source release tarballs. These GitHub archives will not be buildable as they are created by the "git archive" feature and so are missing content. The user gets unhelpful messages from make such as:

fatal error: ui/input-keymap-atset1-to-qcode.c: No such file or directory

By adding a sanity check we can give users an informative message about what they've done wrong.

tested with https://github.com/philmd/qemu/archive/github_notag.tar.gz

github_notag$ ./configure

ERROR: missing file ./ui/keycodemapdb/README

This is not a GIT checkout but module content appears to be missing. Do not use 'git archive' or GitHub download links to acquire QEMU source archives. Non-GIT builds are only supported with source archives linked from:

https://www.qemu.org/download/

Developers working with GIT can use scripts/archive-source.sh if they need to create valid source archives.

Quoted 1 line
Quoted 34 lines
---
 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure +18 -0
index 0a19b033bc..089b00068c 100755
@@ -296,6 +296,24 @@ then
 else
     git_update=no
     git_submodules=""
+
+    if ! test -f "$source_path/ui/keycodemapdb/README"
+    then
+        echo
+        echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+        echo
+        echo "This is not a GIT checkout but module content appears to"
+        echo "be missing. Do not use 'git archive' or GitHub download links"
+        echo "to acquire QEMU source archives. Non-GIT builds are only"
+        echo "supported with source archives linked from:"
+        echo
+        echo "  https://www.qemu.org/download/"
+        echo
+        echo "Developers working with GIT can use scripts/archive-source.sh"
+        echo "if they need to create valid source archives."
+        echo
+        exit 1
+    fi
 fi
 git="git"
 
#3 lore raw
In reply to Daniel P. Berrangé

Opps, forgot to CC Paolo on this patch for the "misc" queue.

Quoted 49 lines · Daniel P. Berrangé

The "git archive" feature creates tarballs which are missing all submodule content. GitHub unhelpfully provides users with "Download" links that claim to give them valid source release tarballs. These GitHub archives will not be buildable as they are created by the "git archive" feature and so are missing content. The user gets unhelpful messages from make such as:

fatal error: ui/input-keymap-atset1-to-qcode.c: No such file or directory

By adding a sanity check we can give users an informative message about what they've done wrong.

---
 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure +18 -0
index 0a19b033bc..089b00068c 100755
@@ -296,6 +296,24 @@ then
 else
     git_update=no
     git_submodules=""
+
+    if ! test -f "$source_path/ui/keycodemapdb/README"
+    then
+        echo
+        echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+        echo
+        echo "This is not a GIT checkout but module content appears to"
+        echo "be missing. Do not use 'git archive' or GitHub download links"
+        echo "to acquire QEMU source archives. Non-GIT builds are only"
+        echo "supported with source archives linked from:"
+        echo
+        echo "  https://www.qemu.org/download/"
+        echo
+        echo "Developers working with GIT can use scripts/archive-source.sh"
+        echo "if they need to create valid source archives."
+        echo
+        exit 1
+    fi
 fi
 git="git"
 
Signature · 1 line
2.14.3

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#4 lore raw
In reply to Daniel P. Berrangé
Quoted 37 lines · Daniel P. Berrangé

The "git archive" feature creates tarballs which are missing all submodule content. GitHub unhelpfully provides users with "Download" links that claim to give them valid source release tarballs. These GitHub archives will not be buildable as they are created by the "git archive" feature and so are missing content. The user gets unhelpful messages from make such as:

fatal error: ui/input-keymap-atset1-to-qcode.c: No such file or directory

By adding a sanity check we can give users an informative message about what they've done wrong.

---
 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure +11 -0
index 0a19b033bc..089b00068c 100755
@@ -296,6 +296,24 @@ then
 else
     git_update=no
     git_submodules=""
+
+    if ! test -f "$source_path/ui/keycodemapdb/README"
+    then
+        echo
+        echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+        echo
+        echo "This is not a GIT checkout but module content appears to"
+        echo "be missing. Do not use 'git archive' or GitHub download links"
+        echo "to acquire QEMU source archives. Non-GIT builds are only"
+        echo "supported with source archives linked from:"
+        echo

configure then · line 319

Quoted 10 lines
configure +7 -0
+        echo "  https://www.qemu.org/download/"
+        echo
+        echo "Developers working with GIT can use scripts/archive-source.sh"
+        echo "if they need to create valid source archives."
+        echo
+        exit 1
+    fi
 fi
 git="git"
 

Queued, thanks.

Paolo