Skip to contentSkip to conversation

configure: Ensure tests/qemu-iotests exists before writing common.env

PATCH In review Peter Maydell 3 participants 6 messages May 14, 2014 – May 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Ensure tests/qemu-iotests exists before writing common.env

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

 configure | 1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index 6adfa72..c4e43ed 100755
@@ -4770,6 +4770,7 @@ fi
 
 iotests_common_env="tests/qemu-iotests/common.env"
 
+mkdir -p "$(dirname "$iotests_common_env")"
 echo "# Automatically generated by configure - do not modify" > $iotests_common_env
 echo >> $iotests_common_env
 echo "PYTHON='$python'" >> $iotests_common_env
Signature · 1 line
1.9.2
#1 lore raw

Am 14.05.2014 um 16:26 hat Peter Maydell geschrieben:

Quoted 16 lines

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

 configure | 1 +
 1 file changed, 1 insertion(+)
configure +0 -0
index 6adfa72..c4e43ed 100755

configure fi · line 4776

Quoted 7 lines
configure +1 -0
@@ -4770,6 +4770,7 @@ fi
 
 iotests_common_env="tests/qemu-iotests/common.env"
 
+mkdir -p "$(dirname "$iotests_common_env")"
 echo "# Automatically generated by configure - do not modify" > $iotests_common_env
 echo >> $iotests_common_env
 echo "PYTHON='$python'" >> $iotests_common_env

We already have an mkdir -p, in the section at line 5161ff. Perhaps we should just move that to further above?

But as this is a build fix, I don't want to start bikeshedding, so I'm not objecting to your patch.

Kevin

#2 lore raw
Quoted 28 lines · Kevin Wolf

Am 14.05.2014 um 16:26 hat Peter Maydell geschrieben:

Quoted 16 lines

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

 configure | 1 +
 1 file changed, 1 insertion(+)
configure +0 -0
index 6adfa72..c4e43ed 100755

configure fi · line 4776

Quoted 7 lines
configure +1 -0
@@ -4770,6 +4770,7 @@ fi
 
 iotests_common_env="tests/qemu-iotests/common.env"
 
+mkdir -p "$(dirname "$iotests_common_env")"
 echo "# Automatically generated by configure - do not modify" > $iotests_common_env
 echo >> $iotests_common_env
 echo "PYTHON='$python'" >> $iotests_common_env

We already have an mkdir -p, in the section at line 5161ff. Perhaps we should just move that to further above?

Quoted 2 lines

But as this is a build fix, I don't want to start bikeshedding, so I'm not objecting to your patch.

Yes, there are other mkdirs scattered through the configure script that we could perhaps collect up and move to the top with that whole section of mkdir/symlink code, as a later cleanup.

thanks
-- PMM

#3 lore raw

Am 14.05.2014 um 16:46 hat Peter Maydell geschrieben:

Quoted 29 lines · Kevin Wolf
Quoted 28 lines

Am 14.05.2014 um 16:26 hat Peter Maydell geschrieben:

Quoted 16 lines

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

 configure | 1 +
 1 file changed, 1 insertion(+)
configure +0 -0
index 6adfa72..c4e43ed 100755

configure fi · line 4776

Quoted 7 lines
configure +1 -0
@@ -4770,6 +4770,7 @@ fi
 
 iotests_common_env="tests/qemu-iotests/common.env"
 
+mkdir -p "$(dirname "$iotests_common_env")"
 echo "# Automatically generated by configure - do not modify" > $iotests_common_env
 echo >> $iotests_common_env
 echo "PYTHON='$python'" >> $iotests_common_env

We already have an mkdir -p, in the section at line 5161ff. Perhaps we should just move that to further above?

Quoted 7 lines
Quoted 2 lines

But as this is a build fix, I don't want to start bikeshedding, so I'm not objecting to your patch.

Yes, there are other mkdirs scattered through the configure script that we could perhaps collect up and move to the top with that whole section of mkdir/symlink code, as a later cleanup.

Sounds good to me.

Kevin

#4 lore raw
In reply to Peter Maydell
Quoted 16 lines · Peter Maydell

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

  configure | 1 +
  1 file changed, 1 insertion(+)
configure +0 -0
index 6adfa72..c4e43ed 100755

configure fi · line 4776

Quoted 7 lines
configure +1 -0
@@ -4770,6 +4770,7 @@ fi
 
  iotests_common_env="tests/qemu-iotests/common.env"
 
+mkdir -p "$(dirname "$iotests_common_env")"
  echo "# Automatically generated by configure - do not modify" > $iotests_common_env
  echo >> $iotests_common_env
  echo "PYTHON='$python'" >> $iotests_common_env

If we do this, we'd have a commen.env which we cannot use, as all the tests are still in the original source tree.

I'd rather use "$source_path/tests/qemu_iotests/common.env" instead, or, if that is unacceptable as it modifies the original source tree (which is probably not desired when doing an out-of-tree build), write common.env only if this is an in-tree build.

Max

#5 lore raw
Quoted 13 lines · Max Reitz
Quoted 12 lines · Peter Maydell

Before we write common.env to the tests/qemu-iotests directory, ensure that it exists. This fixes out-of-tree builds from clean.

---
If somebody would like to review this I'll apply it to master as a buildfix...

  configure | 1 +
  1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 11 lines
configure +0 -0
index 6adfa72..c4e43ed 100755
@@ -4770,6 +4770,7 @@ fi
    iotests_common_env="tests/qemu-iotests/common.env"
  +mkdir -p "$(dirname "$iotests_common_env")"
  echo "# Automatically generated by configure - do not modify" >

$iotests_common_env
echo >> $iotests_common_env
echo "PYTHON='$python'" >> $iotests_common_env

If we do this, we'd have a commen.env which we cannot use, as all the tests are still in the original source tree.

OK, this is busted then. We need to revert your original patch; when we've figured out how to do it properly we can apply a corrected version.

Quoted 4 lines

I'd rather use "$source_path/tests/qemu_iotests/common.env" instead, or, if that is unacceptable as it modifies the original source tree (which is probably not desired when doing an out-of-tree build), write common.env only if this is an in-tree build.

You're correct, we must not write to the original source tree. We mustn't behave differently on in-tree and out-of-tree builds either.

thanks
-- PMM