You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/08/13 18:33:12 UTC

[buildstream-plugins] branch master updated: Enable setting build-dir

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c17a7a  Enable setting build-dir
     new ecdf3d4  Merge pull request #25 from nanonyme/nanonyme/autotools-defaults
6c17a7a is described below

commit 6c17a7a0f3c1f49c725413d34b0d5cfe83b46ae5
Author: Seppo Yli-Olli <se...@gmail.com>
AuthorDate: Sat Jul 30 23:45:40 2022 +0300

    Enable setting build-dir
    
    build-dir is disabled by default and can be enabled with project conf
    or through element
---
 src/buildstream_plugins/elements/autotools.py       | 8 ++++++++
 src/buildstream_plugins/elements/autotools.yaml     | 7 +++++--
 tests/cachekey/project/elements/autotools1.expected | 2 +-
 tests/cachekey/project/target.expected              | 2 +-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/buildstream_plugins/elements/autotools.py b/src/buildstream_plugins/elements/autotools.py
index 5d29870..f291bb7 100644
--- a/src/buildstream_plugins/elements/autotools.py
+++ b/src/buildstream_plugins/elements/autotools.py
@@ -51,6 +51,14 @@ an example of that:
          conf-global: |
            --disable-gtk-doc --disable-static
 
+By default build-dir is not used. To improve probability build does not
+tamper with sources, you can set build-dir like
+
+.. code:: yaml
+
+   variables:
+     build-dir: _builddir
+
 Here is the default configuration for the ``autotools`` element in full:
 
   .. literalinclude:: ../../../src/buildstream_plugins/elements/autotools.yaml
diff --git a/src/buildstream_plugins/elements/autotools.yaml b/src/buildstream_plugins/elements/autotools.yaml
index 85f7393..80f35e0 100644
--- a/src/buildstream_plugins/elements/autotools.yaml
+++ b/src/buildstream_plugins/elements/autotools.yaml
@@ -1,6 +1,7 @@
 # Autotools default configurations
 
 variables:
+  build-dir: "."
 
   autogen: |
     export NOCONFIGURE=1;
@@ -44,8 +45,8 @@ variables:
 
     %{conf-cmd} %{conf-args}
 
-  make: make
-  make-install: make -j1 DESTDIR="%{install-root}" install
+  make: make -C "%{build-dir}"
+  make-install: make -j1 -C "%{build-dir}" DESTDIR="%{install-root}" install
 
   # Set this if the sources cannot handle parallelization.
   #
@@ -93,6 +94,8 @@ config:
   - |
     %{autogen}
   - |
+    mkdir -p "%{build-dir}"
+    cd "%{build-dir}"
     %{configure}
 
   # Commands for building the software
diff --git a/tests/cachekey/project/elements/autotools1.expected b/tests/cachekey/project/elements/autotools1.expected
index 0dc7777..37031e1 100644
--- a/tests/cachekey/project/elements/autotools1.expected
+++ b/tests/cachekey/project/elements/autotools1.expected
@@ -1 +1 @@
-53651f0c81d32341b4cc46f12fb4a1123f66e2e65111d2176b5c5102e96de2e2
\ No newline at end of file
+184b5a595a9c7a56d7e58d3268de441b25ef4d02c46a0e2fd389238bc57aa467
\ No newline at end of file
diff --git a/tests/cachekey/project/target.expected b/tests/cachekey/project/target.expected
index 407d30c..0bd64a4 100644
--- a/tests/cachekey/project/target.expected
+++ b/tests/cachekey/project/target.expected
@@ -1 +1 @@
-c32929ce4692a7a87664b3245a7740fc518679979972c2d221c4ee6a802b12c3
\ No newline at end of file
+e93e7c247744177a6c603f9cb3cd1b02a477d706c29d5a56461a8e58c8bea552
\ No newline at end of file