All of lore.kernel.org
 help / color / mirror / Atom feed
* [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git
@ 2021-07-09 18:03 Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 1/5] config-build-env: Move the oe-layer-setup to a variable Nishanth Menon
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:03 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

Here are a series of patches that are meant to:
a) be more paranoid in checking the environment it runs in
b) additional cleanups in case of weird corner cases where build folder
   is left in weird state
c) Finally switch over to git.ti.com tree instead of arago-project.org
   tree for the new location of oe-layer-setup

Nishanth Menon (5):
  config-build-env: Move the oe-layer-setup to a variable
  config-build-env: Lets make sure we are really in a build folder
  config-build-env: Refactor to cleanup messed up build folder
  config-build-env: Make sure that the git url points correctly
  config-build-env: Switch arago-project git repo to ti git repo

 lib/oesdk/config-build-env | 46 +++++++++++++++++++++++++++++---------
 1 file changed, 36 insertions(+), 10 deletions(-)

-- 
2.32.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [tisdk-build-scripts PATCH 1/5] config-build-env: Move the oe-layer-setup to a variable
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
@ 2021-07-09 18:03 ` Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 2/5] config-build-env: Lets make sure we are really in a build folder Nishanth Menon
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:03 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

Lets first start preparing for cleanup by moving the git url to a
variable.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 lib/oesdk/config-build-env | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
index 8bbd0df28c63..11fab2de6097 100644
--- a/lib/oesdk/config-build-env
+++ b/lib/oesdk/config-build-env
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git"
+
 # This script is intended to be called only from the top-level build-oesdk.sh
 # script which parses the configuration file and sets necessary variables.
 # So check if it is being called from any other context and if so exit.
@@ -21,7 +23,7 @@ checkout_layer_scripts() {
 
     if [ ! -d $name ]
     then
-        git clone http://arago-project.org/git/projects/oe-layersetup.git $name
+        git clone "$TI_SDK_OELAYER_SETUP" $name
     elif [ -d $name/.git ]
     then
         #This looks to be a git repo.  Hopefully it is the right one :)
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [tisdk-build-scripts PATCH 2/5] config-build-env: Lets make sure we are really in a build folder
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 1/5] config-build-env: Move the oe-layer-setup to a variable Nishanth Menon
@ 2021-07-09 18:03 ` Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 3/5] config-build-env: Refactor to cleanup messed up " Nishanth Menon
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:03 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

Lets make sure that we are really in a build folder if for some
reason we end up at a top layer script issue and we mess up the build
machine.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 lib/oesdk/config-build-env | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
index 11fab2de6097..058823562693 100644
--- a/lib/oesdk/config-build-env
+++ b/lib/oesdk/config-build-env
@@ -21,6 +21,13 @@ checkout_layer_scripts() {
 
     name=`basename $BUILD_ROOT`
 
+    # Paranoid check: Am I really a build folder?
+    amibuild=`echo $BUILD_ROOT|grep "build$"`
+    if [ -z "$amibuild" ]; then
+        echo "Something horrible has happened.. BUILD_ROOT=$BUILD_ROOT does'nt end with 'build'. maynot be build folder. Aborting!"
+        exit 1
+    fi
+
     if [ ! -d $name ]
     then
         git clone "$TI_SDK_OELAYER_SETUP" $name
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [tisdk-build-scripts PATCH 3/5] config-build-env: Refactor to cleanup messed up build folder
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 1/5] config-build-env: Move the oe-layer-setup to a variable Nishanth Menon
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 2/5] config-build-env: Lets make sure we are really in a build folder Nishanth Menon
@ 2021-07-09 18:03 ` Nishanth Menon
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly Nishanth Menon
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:03 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

In some weird, yet unknown cases, the build folder might be messed up.
Lets make sure we clean that up first prior to cloning or updating
the folder. This seems to happen when we force via jenkins to abort a
running job, leaving the system in a weird state on the remote build
machine. It is not clear what specifically is going on in the sequence,
but lets add some diagnostics on if any errant processes are sticking
around in the previous process (VM cleanup etc) that prevented a
proper system cleanup.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 lib/oesdk/config-build-env | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
index 058823562693..885fbcfb50d9 100644
--- a/lib/oesdk/config-build-env
+++ b/lib/oesdk/config-build-env
@@ -15,7 +15,7 @@ fi
 # conditions apply:
 #   1. The checkout creates the final directory of BUILD_ROOT
 #   2. If a git repo already exists then do a git pull
-#   3. If the directory is not empty and is not a git repo then bail
+#   3. If the directory is not empty and is not a git repo, then cleanup if unused
 checkout_layer_scripts() {
     cd `dirname $BUILD_ROOT`
 
@@ -28,18 +28,27 @@ checkout_layer_scripts() {
         exit 1
     fi
 
-    if [ ! -d $name ]
-    then
+    # If the scripts folder exists and is not a git repo, cleanup.
+    if [ -e $name -a ! -d $name/.git ]; then
+        echo "The $BUILD_ROOT directory is present and is not a git repo - attempting to wipe it off"
+        users=`lsof "$BUILD_ROOT"|wc -l`
+        if [ $users -gt 0 ]; then
+           echo "ERROR:: We have users for $BUILD_ROOT folder: Aborting!!!"
+           lsof $BUILD_ROOT
+           pstree -aplG
+           exit 1
+        fi
+        rm -rvf "$BUILD_ROOT" || exit 1
+    fi
+
+
+    if [ ! -d $name ]; then
         git clone "$TI_SDK_OELAYER_SETUP" $name
-    elif [ -d $name/.git ]
-    then
-        #This looks to be a git repo.  Hopefully it is the right one :)
+    else
+        # This looks to be a git repo.  Hopefully it is the right one :)
         cd $BUILD_ROOT
         git fetch
         git reset --hard origin
-    else
-        echo "The $BUILD_ROOT directory is not empty and is not a git repo"
-        exit 1
     fi
 }
 
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
                   ` (2 preceding siblings ...)
  2021-07-09 18:03 ` [tisdk-build-scripts PATCH 3/5] config-build-env: Refactor to cleanup messed up " Nishanth Menon
@ 2021-07-09 18:04 ` Nishanth Menon
  2021-07-10 13:15   ` Nishanth Menon
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo Nishanth Menon
  2021-07-13  3:34 ` [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Denys Dmytriyenko
  5 siblings, 1 reply; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:04 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

Make sure that the build scripts git url points to the correct location.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 lib/oesdk/config-build-env | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
index 885fbcfb50d9..cdfa6830eb51 100644
--- a/lib/oesdk/config-build-env
+++ b/lib/oesdk/config-build-env
@@ -47,6 +47,14 @@ checkout_layer_scripts() {
     else
         # This looks to be a git repo.  Hopefully it is the right one :)
         cd $BUILD_ROOT
+	# In case we have changed the location of our build scripts
+	# we should change our git url towards it.
+        mygit='git remote get-url  origin'
+        if [ "$mygit" != "$TI_SDK_OELAYER_SETUP"]; then
+            echo "$TI_SDK_OELAYER_SETUP Mismatch in git URL: $mygit vs $TI_SDK_OELAYER_SETUP. Force resetting the origin!"
+            git remote set-url origin $TI_SDK_OELAYER_SETUP
+        fi
+
         git fetch
         git reset --hard origin
     fi
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
                   ` (3 preceding siblings ...)
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly Nishanth Menon
@ 2021-07-09 18:04 ` Nishanth Menon
  2021-07-13  3:32   ` Denys Dmytriyenko
  2021-07-13  3:34 ` [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Denys Dmytriyenko
  5 siblings, 1 reply; 10+ messages in thread
From: Nishanth Menon @ 2021-07-09 18:04 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

Arago-project is on the way down, so flip over to git.ti.com repo

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 lib/oesdk/config-build-env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
index cdfa6830eb51..2514acbe6b38 100644
--- a/lib/oesdk/config-build-env
+++ b/lib/oesdk/config-build-env
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git"
+TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git"
 
 # This script is intended to be called only from the top-level build-oesdk.sh
 # script which parses the configuration file and sets necessary variables.
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly Nishanth Menon
@ 2021-07-10 13:15   ` Nishanth Menon
  0 siblings, 0 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-10 13:15 UTC (permalink / raw)
  To: denis, praneeth, yogeshs; +Cc: meta-arago

On 13:04-20210709, Nishanth Menon wrote:
> Make sure that the build scripts git url points to the correct location.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  lib/oesdk/config-build-env | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
> index 885fbcfb50d9..cdfa6830eb51 100644
> --- a/lib/oesdk/config-build-env
> +++ b/lib/oesdk/config-build-env
> @@ -47,6 +47,14 @@ checkout_layer_scripts() {
>      else
>          # This looks to be a git repo.  Hopefully it is the right one :)
>          cd $BUILD_ROOT
> +	# In case we have changed the location of our build scripts
> +	# we should change our git url towards it.
> +        mygit='git remote get-url  origin'
> +        if [ "$mygit" != "$TI_SDK_OELAYER_SETUP"]; then
There needs to be a space between "$TI_SDK_OELAYER_SETUP" and ]

if there are no further comments, and you can fix it when applying,
please do. Else, do comment so that I can send an updated
version.

> +            echo "$TI_SDK_OELAYER_SETUP Mismatch in git URL: $mygit vs $TI_SDK_OELAYER_SETUP. Force resetting the origin!"
> +            git remote set-url origin $TI_SDK_OELAYER_SETUP
> +        fi
> +
>          git fetch
>          git reset --hard origin
>      fi
> -- 
> 2.32.0
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D)/Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo Nishanth Menon
@ 2021-07-13  3:32   ` Denys Dmytriyenko
  2021-07-13 13:30     ` Nishanth Menon
  0 siblings, 1 reply; 10+ messages in thread
From: Denys Dmytriyenko @ 2021-07-13  3:32 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: meta-arago

On Fri, Jul 09, 2021 at 01:04:01PM -0500, Nishanth Menon wrote:
> Arago-project is on the way down, so flip over to git.ti.com repo
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  lib/oesdk/config-build-env | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
> index cdfa6830eb51..2514acbe6b38 100644
> --- a/lib/oesdk/config-build-env
> +++ b/lib/oesdk/config-build-env
> @@ -1,6 +1,6 @@
>  #!/bin/bash
>  
> -TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git"
> +TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git"

What's the preferred clone method on git.ti.com? I see Web UI shows these:

Clone
https://git.ti.com/git/arago-project/oe-layersetup.git
https://git.ti.com/cgit/arago-project/oe-layersetup
git://git.ti.com/arago-project/oe-layersetup.git
http://git.ti.com/git/arago-project/oe-layersetup.git


>  # This script is intended to be called only from the top-level build-oesdk.sh
>  # script which parses the configuration file and sets necessary variables.
> -- 
> 2.32.0
> 

-- 
Regards,
Denys Dmytriyenko <denis@denix.org>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git
  2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
                   ` (4 preceding siblings ...)
  2021-07-09 18:04 ` [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo Nishanth Menon
@ 2021-07-13  3:34 ` Denys Dmytriyenko
  5 siblings, 0 replies; 10+ messages in thread
From: Denys Dmytriyenko @ 2021-07-13  3:34 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: meta-arago

On Fri, Jul 09, 2021 at 01:03:56PM -0500, Nishanth Menon wrote:
> Here are a series of patches that are meant to:
> a) be more paranoid in checking the environment it runs in
> b) additional cleanups in case of weird corner cases where build folder
>    is left in weird state
> c) Finally switch over to git.ti.com tree instead of arago-project.org
>    tree for the new location of oe-layer-setup

Overall, changes look sane to me. Thanks.


> Nishanth Menon (5):
>   config-build-env: Move the oe-layer-setup to a variable
>   config-build-env: Lets make sure we are really in a build folder
>   config-build-env: Refactor to cleanup messed up build folder
>   config-build-env: Make sure that the git url points correctly
>   config-build-env: Switch arago-project git repo to ti git repo
> 
>  lib/oesdk/config-build-env | 46 +++++++++++++++++++++++++++++---------
>  1 file changed, 36 insertions(+), 10 deletions(-)
> 
> -- 
> 2.32.0
> 

-- 
Regards,
Denys Dmytriyenko <denis@denix.org>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo
  2021-07-13  3:32   ` Denys Dmytriyenko
@ 2021-07-13 13:30     ` Nishanth Menon
  0 siblings, 0 replies; 10+ messages in thread
From: Nishanth Menon @ 2021-07-13 13:30 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arago

On 23:32-20210712, Denys Dmytriyenko wrote:
> On Fri, Jul 09, 2021 at 01:04:01PM -0500, Nishanth Menon wrote:
> > Arago-project is on the way down, so flip over to git.ti.com repo
> > 
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> > ---
> >  lib/oesdk/config-build-env | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/oesdk/config-build-env b/lib/oesdk/config-build-env
> > index cdfa6830eb51..2514acbe6b38 100644
> > --- a/lib/oesdk/config-build-env
> > +++ b/lib/oesdk/config-build-env
> > @@ -1,6 +1,6 @@
> >  #!/bin/bash
> >  
> > -TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git"
> > +TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git"
> 
> What's the preferred clone method on git.ti.com? I see Web UI shows these:
> 
> Clone
> https://git.ti.com/git/arago-project/oe-layersetup.git
> https://git.ti.com/cgit/arago-project/oe-layersetup
> git://git.ti.com/arago-project/oe-layersetup.git
> http://git.ti.com/git/arago-project/oe-layersetup.git

Have'nt heard of any specific preference.

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-13 13:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 18:03 [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Nishanth Menon
2021-07-09 18:03 ` [tisdk-build-scripts PATCH 1/5] config-build-env: Move the oe-layer-setup to a variable Nishanth Menon
2021-07-09 18:03 ` [tisdk-build-scripts PATCH 2/5] config-build-env: Lets make sure we are really in a build folder Nishanth Menon
2021-07-09 18:03 ` [tisdk-build-scripts PATCH 3/5] config-build-env: Refactor to cleanup messed up " Nishanth Menon
2021-07-09 18:04 ` [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly Nishanth Menon
2021-07-10 13:15   ` Nishanth Menon
2021-07-09 18:04 ` [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo Nishanth Menon
2021-07-13  3:32   ` Denys Dmytriyenko
2021-07-13 13:30     ` Nishanth Menon
2021-07-13  3:34 ` [tisdk-build-scripts PATCH 0/5] config-build-env: Switch to arago-project git Denys Dmytriyenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.