You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:41:26 UTC
[buildstream] 01/03: git: Do not checkout submodules by default
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch jjardon/kubernetes_test
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 3bcbcaff7363f47507003126fd81f0b4366f89cf
Author: Javier Jardón <jj...@gnome.org>
AuthorDate: Sat Apr 18 14:08:49 2020 +0100
git: Do not checkout submodules by default
This makes repeatibility more difficult
We do not want download things from internet when building and
the user have not explicity specify those in any .bst file
Fixes #783
---
NEWS | 2 ++
src/buildstream/_gitsourcebase.py | 2 +-
src/buildstream/plugins/sources/git.py | 9 ++-------
tests/sources/git.py | 4 ++--
tests/sources/git/project-override/project.conf | 2 +-
5 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/NEWS b/NEWS
index 95bcb2e..1815921 100644
--- a/NEWS
+++ b/NEWS
@@ -265,6 +265,8 @@ CLI
Plugins
-------
+ o BREAKING CHANGE: The git plugin does not checkout submodules by default anymore
+
o BREAKING CHANGE: cmake, make, makemaker, meson, modulebuild and qmake
plugins have been moved to the bst-plugins-experimental repository.
diff --git a/src/buildstream/_gitsourcebase.py b/src/buildstream/_gitsourcebase.py
index 1f74bb9..d54bfb0 100644
--- a/src/buildstream/_gitsourcebase.py
+++ b/src/buildstream/_gitsourcebase.py
@@ -533,7 +533,7 @@ class _GitSourceBase(Source):
"{}: Git sources require a ref and/or track".format(self), reason="missing-track-and-ref"
)
- self.checkout_submodules = node.get_bool("checkout-submodules", default=True)
+ self.checkout_submodules = node.get_bool("checkout-submodules", default=False)
# Parse a dict of submodule overrides, stored in the submodule_overrides
# and submodule_checkout_overrides dictionaries.
diff --git a/src/buildstream/plugins/sources/git.py b/src/buildstream/plugins/sources/git.py
index d04ccfe..80ade03 100644
--- a/src/buildstream/plugins/sources/git.py
+++ b/src/buildstream/plugins/sources/git.py
@@ -25,11 +25,6 @@ git - stage files from a git repository
* git
-.. attention::
-
- Note that this plugin **will checkout git submodules by default**; even if
- they are not specified in the `.bst` file.
-
**Usage:**
.. code:: yaml
@@ -58,8 +53,8 @@ git - stage files from a git repository
# Optionally specify whether submodules should be checked-out.
# This is done recursively, as with `git clone --recurse-submodules`.
- # If not set, this will default to 'True'
- checkout-submodules: True
+ # If not set, this will default to 'False'
+ checkout-submodules: False
# If your repository has submodules, explicitly specifying the
# url from which they are to be fetched allows you to easily
diff --git a/tests/sources/git.py b/tests/sources/git.py
index 033db1b..d8de0b7 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -118,7 +118,7 @@ def test_submodule_fetch_checkout(cli, tmpdir, datafiles):
# Assert we checked out both files at their expected location
assert os.path.exists(os.path.join(checkoutdir, "file.txt"))
- assert os.path.exists(os.path.join(checkoutdir, "subdir", "ponyfile.txt"))
+ assert not os.path.exists(os.path.join(checkoutdir, "subdir", "ponyfile.txt"))
@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
@@ -192,7 +192,7 @@ def test_submodule_fetch_source_enable_explicit(cli, tmpdir, datafiles):
# Assert we checked out both files at their expected location
assert os.path.exists(os.path.join(checkoutdir, "file.txt"))
- assert os.path.exists(os.path.join(checkoutdir, "subdir", "ponyfile.txt"))
+ assert not os.path.exists(os.path.join(checkoutdir, "subdir", "ponyfile.txt"))
@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
diff --git a/tests/sources/git/project-override/project.conf b/tests/sources/git/project-override/project.conf
index 299992f..e614642 100644
--- a/tests/sources/git/project-override/project.conf
+++ b/tests/sources/git/project-override/project.conf
@@ -3,7 +3,7 @@ name: foo
sources:
git:
config:
- checkout-submodules: False
+ checkout-submodules: True
elements:
manual:
config: