Skip to contentSkip to conversation

Yet another git submodule rant

Qemu-devel Thomas Huth 8 participants 21 messages Nov 8, 2017 – Nov 20, 2017

lore
Share & tools
lore
#0 lore raw

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

... ok, sorry for the harsh words, ... but now that I've written this down, I feel at least a little bit better ...

Thomas

#1 lore raw
Quoted 6 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

Excluding the .git dir will be a problem - that needs to exist, unless you are building from tar.xz (where we will bundled all the submodule sources together in the tar.xz).

If you really want to exclude the .git directories, then instead of doing an rsync, then use the scripts/archive-source.sh tool to create an archive of all the sources (which bundles required submodules) and unpack that on your target machine. Then all submodule handling on the target will be skipped.

Quoted 8 lines

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I think it got confused from you deleting the .git directory

Quoted 3 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

We *have* to modify SRC_PATH, as that's where git submodule checkouts live. If we didn't do that, then people would end up having failed build due to submodules not existing, or even worse, having a silently incorrect build due to using the wrong checked out version.

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 :|
#2 lore raw
Quoted 12 lines · On Wed, 8 Nov 2017 10:25:29 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

Excluding the .git dir will be a problem - that needs to exist, unless you are building from tar.xz (where we will bundled all the submodule sources together in the tar.xz).

Quoted 5 lines

If you really want to exclude the .git directories, then instead of doing an rsync, then use the scripts/archive-source.sh tool to create an archive of all the sources (which bundles required submodules) and unpack that on your target machine. Then all submodule handling on the target will be skipped.

This probably does not work because it archives committed sources and not actual sources.

Quoted 18 lines
Quoted 10 lines

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I think it got confused from you deleting the .git directory

Quoted 4 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Quoted 4 lines

We *have* to modify SRC_PATH, as that's where git submodule checkouts live. If we didn't do that, then people would end up having failed build due to submodules not existing, or even worse, having a silently incorrect build due to using the wrong checked out version.

And that's another reason why submodules are bad thing.

So again, can this be done without submodules?

Let somebody else do the testing and polishing of this pre-alpha git feature.

Thanks

Michal

#3 lore raw
Quoted 15 lines · Michal Suchánek
Quoted 12 lines · On Wed, 8 Nov 2017 10:25:29 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

Excluding the .git dir will be a problem - that needs to exist, unless you are building from tar.xz (where we will bundled all the submodule sources together in the tar.xz).

Quoted 8 lines
Quoted 5 lines

If you really want to exclude the .git directories, then instead of doing an rsync, then use the scripts/archive-source.sh tool to create an archive of all the sources (which bundles required submodules) and unpack that on your target machine. Then all submodule handling on the target will be skipped.

This probably does not work because it archives committed sources and not actual sources.

Actually that's not quite correct - if it sees you have non-comitted changes, and will use 'git stash create' to capture them in the archive it creates. So it would only miss brand new files which have not yet been 'git add'ed

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

We *have* to modify SRC_PATH, as that's where git submodule checkouts live. If we didn't do that, then people would end up having failed build due to submodules not existing, or even worse, having a silently incorrect build due to using the wrong checked out version.

Quoted 6 lines

And that's another reason why submodules are bad thing.

So again, can this be done without submodules?

Let somebody else do the testing and polishing of this pre-alpha git feature.

Honestly I think the submodule stuff is working pretty well - a handful of people have mentioned problems and we've addressed most of them or illustrated alternative approaches to deal with it. For most developers it has been pretty much transparent and just works, or we would have seen alot more noise.

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
Quoted 22 lines · On Wed, 8 Nov 2017 12:34:17 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 21 lines · Michal Suchánek
Quoted 17 lines · On Wed, 8 Nov 2017 10:25:29 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

Excluding the .git dir will be a problem - that needs to exist, unless you are building from tar.xz (where we will bundled all the submodule sources together in the tar.xz).

If you really want to exclude the .git directories, then instead of doing an rsync, then use the scripts/archive-source.sh tool to create an archive of all the sources (which bundles required submodules) and unpack that on your target machine. Then all submodule handling on the target will be skipped.

Quoted 7 lines
Quoted 2 lines

This probably does not work because it archives committed sources and not actual sources.

Actually that's not quite correct - if it sees you have non-comitted changes, and will use 'git stash create' to capture them in the archive it creates. So it would only miss brand new files which have not yet been 'git add'ed

So there really isn't a good solution.

Quoted 33 lines
Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

We *have* to modify SRC_PATH, as that's where git submodule checkouts live. If we didn't do that, then people would end up having failed build due to submodules not existing, or even worse, having a silently incorrect build due to using the wrong checked out version.

Quoted 6 lines

And that's another reason why submodules are bad thing.

So again, can this be done without submodules?

Let somebody else do the testing and polishing of this pre-alpha git feature.

Honestly I think the submodule stuff is working pretty well - a handful of people have mentioned problems and we've addressed most of them or illustrated alternative approaches to deal with it. For most developers it has been pretty much transparent and just works, or we would have seen alot more noise.

On 11/08/2017 06:57 AM, Thomas Huth wrote:

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

Quoted 8 lines

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

<cota> [...] you might want to do "git submodule init && git submodule update"

.. you call that transparent.

Yeah, right.

Please don't pretend that something is working when it clearly isn't.

Repositories using submodules are far from first class citizens as far as support from git is concerned.

Therefore projects that don't have git development at least as secondary focus should not use them until that changes.

Thanks

Michal

#5 lore raw
Quoted 81 lines · Michal Suchánek
Quoted 22 lines · On Wed, 8 Nov 2017 12:34:17 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 21 lines · Michal Suchánek
Quoted 17 lines · On Wed, 8 Nov 2017 10:25:29 +0000 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

Excluding the .git dir will be a problem - that needs to exist, unless you are building from tar.xz (where we will bundled all the submodule sources together in the tar.xz).

If you really want to exclude the .git directories, then instead of doing an rsync, then use the scripts/archive-source.sh tool to create an archive of all the sources (which bundles required submodules) and unpack that on your target machine. Then all submodule handling on the target will be skipped.

Quoted 7 lines
Quoted 2 lines

This probably does not work because it archives committed sources and not actual sources.

Actually that's not quite correct - if it sees you have non-comitted changes, and will use 'git stash create' to capture them in the archive it creates. So it would only miss brand new files which have not yet been 'git add'ed

So there really isn't a good solution.

Quoted 33 lines
Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

We *have* to modify SRC_PATH, as that's where git submodule checkouts live. If we didn't do that, then people would end up having failed build due to submodules not existing, or even worse, having a silently incorrect build due to using the wrong checked out version.

Quoted 6 lines

And that's another reason why submodules are bad thing.

So again, can this be done without submodules?

Let somebody else do the testing and polishing of this pre-alpha git feature.

Honestly I think the submodule stuff is working pretty well - a handful of people have mentioned problems and we've addressed most of them or illustrated alternative approaches to deal with it. For most developers it has been pretty much transparent and just works, or we would have seen alot more noise.

On 11/08/2017 06:57 AM, Thomas Huth wrote:

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

Quoted 8 lines

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

<cota> [...] you might want to do "git submodule init && git submodule update"

.. you call that transparent.

Yeah, right.

Quoted 7 lines

Please don't pretend that something is working when it clearly isn't.

Repositories using submodules are far from first class citizens as far as support from git is concerned.

Therefore projects that don't have git development at least as secondary focus should not use them until that changes.

That's really overstating the problem. There are some caveats with use of submodules, but they are hardly showstoppers that prevent their usage entirely. There are plenty of projects using GIT with submodules for *years* (libvirt has used them for 8 years).

Some of the problems pointed out have been clear bugs in the way we've integrated into QEMU's build system, which I've been addressing. Others have been due to usage scenarios I didn't anticipate, which I've attempted to provide solutions for, either by improving the build system, or suggesting alternative approaches. We'll continue to try to improve this, as we would for any other major change to the buildsystem we've been through, which caused problems for some workflows. I none the less believe this is working for the vast majority of developers of QEMU, given the size of our community vs the number of problems reported.

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 :|
#6 lore raw
In reply to Thomas Huth
Quoted 5 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there.

How about excluding all files listed in .gitignore from rsync? Which I guess would be a good idea anyway because you don't want sync over the build artifacts to the target machine if you want compile there. Might be as simple as "rsync --exclude-from .gitignore" (didn't test though).

Or syncronize using git instead of rsync. This is what I am doing.

cheers,
Gerd

#7 lore raw
Quoted 11 lines · Gerd Hoffmann
Quoted 5 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there.

How about excluding all files listed in .gitignore from rsync? Which I guess would be a good idea anyway because you don't want sync over the build artifacts to the target machine if you want compile there. Might be as simple as "rsync --exclude-from .gitignore" (didn't test though).

That's a neat idea, thanks, I'll give it a try!

Quoted 1 line

Or syncronize using git instead of rsync. This is what I am doing.

Tried that in the past already, but it didn't really feel right (I don't want to check in each time before syncing my files)...

Thomas

#8 lore raw
Quoted 13 lines · Thomas Huth
Quoted 11 lines · Gerd Hoffmann
Quoted 5 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there.

How about excluding all files listed in .gitignore from rsync? Which I guess would be a good idea anyway because you don't want sync over the build artifacts to the target machine if you want compile there. Might be as simple as "rsync --exclude-from .gitignore" (didn't test though).

Quoted 6 lines

That's a neat idea, thanks, I'll give it a try!

Quoted 1 line

Or syncronize using git instead of rsync. This is what I am doing.

Tried that in the past already, but it didn't really feel right (I don't want to check in each time before syncing my files)...

TIL: git push --recurse-submodules=on-demand

GIT-PUSH(1)

--recurse-submodules=check|on-demand|only|no

[...] If check is used Git will verify that all submodule commits that changed in the revisions to be pushed are available on at least one remote of the submodule. If any commits are missing the push will be aborted and exit with non-zero status. If on-demand is used all submodules that changed in the revisions to be pushed will be pushed. If on-demand was not able to push all necessary revisions it will also be aborted and exit with non-zero status. [...]

GIT-CONFIG(1)

push.recurseSubmodules
Make sure all submodule commits used by the revisions to be pushed are available on a remote-tracking branch. If the value is check then Git will verify that all submodule commits that changed in the revisions to be pushed are available on at least one remote of the submodule. If any commits are missing, the push will be aborted and exit with non-zero status. If the value is on-demand then all submodules that changed in the revisions to be pushed will be pushed. If on-demand was not able to push all necessary revisions it will also be aborted and exit with non-zero status. [...]

#9 lore raw
In reply to Gerd Hoffmann
Quoted 7 lines · Gerd Hoffmann
Quoted 5 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there.

Quoted 6 lines

How about excluding all files listed in .gitignore from rsync? Which I guess would be a good idea anyway because you don't want sync over the build artifacts to the target machine if you want compile there. Might be as simple as "rsync --exclude-from .gitignore" (didn't test though).

Or syncronize using git instead of rsync. This is what I am doing.

Me too,

$ git push --mirror host:dir

(I don't mind having to commit first.)

Thanks,
Laszlo

#10 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

<cota> [...] you might want to do "git submodule init && git submodule update"

#11 lore raw
Quoted 22 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

Quoted 7 lines

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

Quoted 2 lines

<cota> [...] you might want to do "git submodule init && git submodule update"

This certainly should not be required - the build system should always take care of that, so it would be considered a bug if it didn't happen.

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 :|
#12 lore raw
Quoted 26 lines · Daniel P. Berrange
Quoted 25 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

Quoted 7 lines
Quoted 4 lines

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

Signature · 1 line
Alexey
#13 lore raw
Quoted 32 lines · Alexey Kardashevskiy
Quoted 31 lines · Daniel P. Berrange
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

Quoted 7 lines
Quoted 2 lines

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

That simply isn't the way submodules work, they are inherently part of the source tree, and the status file reflects that too.

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 :|
#14 lore raw
Quoted 36 lines · Daniel P. Berrange
Quoted 35 lines · Alexey Kardashevskiy
Quoted 33 lines · Daniel P. Berrange
Quoted 22 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

Quoted 7 lines

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

Quoted 7 lines
Quoted 4 lines

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

That simply isn't the way submodules work, they are inherently part of the source tree, and the status file reflects that too.

Sorry, I am missing the point here. What precisely does prevent us from checking out the required modules to the build directory and build them there? git provides a submodule repository url and sha1 for the current qemu branch.

Yes, the submodule tree inside the qemu tree might be different from the one in the build directory but the purpose of all of this is to always build the correct code - so this requirement is met. And it will still be better than changing the $SRC_PATH when a user specifically asked not to do that by calling "./configure --source-path='.

Signature · 1 line
Alexey
#15 lore raw
Quoted 3 lines · Alexey Kardashevskiy

And it will still be
better than changing the $SRC_PATH when a user specifically asked not to do that by calling "./configure --source-path='.

I'm not terribly happy with the submodule stuff either, but that configure rune is not making use of a documented or supported feature. --source-path is for telling configure where the source code is. Passing it an empty string should probably be rejected as an error.

thanks
-- PMM

#16 lore raw
Quoted 10 lines · Peter Maydell
Quoted 3 lines · Alexey Kardashevskiy

And it will still be
better than changing the $SRC_PATH when a user specifically asked not to do that by calling "./configure --source-path='.

I'm not terribly happy with the submodule stuff either, but that configure rune is not making use of a documented or supported feature. --source-path is for telling configure where the source code is. Passing it an empty string should probably be rejected as an error.

It is not empty, I just cut an example too much :) The script looks like:

cd /home/aik/pbuild/qemu-garrison2-ppc64/ /home/aik/p/qemu/configure --target-list=ppc64-softmmu --source-path=/home/aik/p/qemu/

Signature · 1 line
Alexey
#17 lore raw
In reply to Alexey Kardashevskiy
Quoted 42 lines · Alexey Kardashevskiy
Quoted 41 lines · Daniel P. Berrange
Quoted 39 lines · Alexey Kardashevskiy
Quoted 26 lines · Daniel P. Berrange
Quoted 25 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

Quoted 7 lines
Quoted 4 lines

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

Quoted 7 lines
Quoted 2 lines

That simply isn't the way submodules work, they are inherently part of the source tree, and the status file reflects that too.

Sorry, I am missing the point here. What precisely does prevent us from checking out the required modules to the build directory and build them there? git provides a submodule repository url and sha1 for the current qemu branch.

The build directory should never contain any of your version controlled source, as that will get irretrievably lost when the build dir is purged.

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 :|
#18 lore raw
Quoted 46 lines · Daniel P. Berrange
Quoted 45 lines · Alexey Kardashevskiy
Quoted 43 lines · Daniel P. Berrange
Quoted 32 lines · Alexey Kardashevskiy
Quoted 31 lines · Daniel P. Berrange
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

Quoted 7 lines
Quoted 2 lines

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

That simply isn't the way submodules work, they are inherently part of the source tree, and the status file reflects that too.

Quoted 7 lines
Quoted 4 lines

Sorry, I am missing the point here. What precisely does prevent us from checking out the required modules to the build directory and build them there? git provides a submodule repository url and sha1 for the current qemu branch.

The build directory should never contain any of your version controlled source, as that will get irretrievably lost when the build dir is purged.

I am not suggesting editing submodule sources from the build directory, I am suggesting not building them from the source directory, in order to keep them in sync, Makefile can rsync or "git push" them to the build directory. Yeah, fairly ugly but still more correct than the current solution.

And again, .git-submodule-status is not a source file, what is it doing in $SRC_PATH?

Now I cannot compile qemu pretty much 50% of time because of that enhancement. In the today's episode:

ssh aikhostos2 cd /home/aik/pbuild/qemu-aikhostos2-ppc64/ ; /home/aik/p/qemu/configure --target-list=ppc64-softmmu --source-path=/home/aik/p/qemu/ --enable-debug --enable-debug-info --disable-werror --disable-git-update --enable-trace-backend=log

All good. One detail:
capstone git

ssh aikhostos2 make -C /home/aik/pbuild/qemu-aikhostos2-ppc64/ -j24

make: Entering directory `/home/aik/pbuild/qemu-aikhostos2-ppc64'
GEN ppc64-softmmu/config-devices.mak.tmp
mkdir -p dtc/libfdt
mkdir -p dtc/tests
GEN config-host.h
GEN qemu-options.def
make[1]: *** No rule to make target `/home/aik/pbuild/qemu-aikhostos2-ppc64/capstone/libcapstone.a'. Stop.
make: *** [subdir-capstone] Error 2
make: *** Waiting for unfinished jobs....
GEN ppc64-softmmu/config-devices.mak

How, why, where are all these nice warning messages? Ah, there they are (added 'set -x' to the script):

+ substat=.git-submodule-status
+ command=status
+ shift
+ maybe_modules='ui/keycodemapdb dtc capstone'
+ test -z git
+ modules=
+ for m in '$maybe_modules'
+ git submodule status ui/keycodemapdb
+ test 128 = 0
+ echo 'warn: ignoring non-existent submodule ui/keycodemapdb'
+ for m in '$maybe_modules'
+ git submodule status dtc
+ test 128 = 0:m
+ echo 'warn: ignoring non-existent submodule dtc'
+ for m in '$maybe_modules'
+ git submodule status capstone
+ test 128 = 0
+ echo 'warn: ignoring non-existent submodule capstone'
+ test -n 'ui/keycodemapdb dtc capstone'
+ test -e .git
+ case "$command" in
+ test -z 'ui/keycodemapdb dtc capstone'
+ test -f .git-submodule-status
+ exit 1

I assume that 'warn' is not printed because of Makefile's 'quiet-command'.

And this fails because on the server the source directory is created with 'git worktree' which points to bare git repo outside of the source tree and the git on that build machine has no idea about worktrees (the repo is visible to the build machine).

[vpl1 ~]$ ssh -x aikhostos2 'cd p/qemu && pwd && git --version && ls -d ../qemu.git && git submodule status'
/home/aik/p/qemu
git version 1.8.3.1
../qemu.git
fatal: Not a git repository: /home/aik/p/qemu.git/worktrees/qemu

Again - ok, when I know what is the problem, I know how to fix it - simply move .git away when running ./configure and make (as it also runs ./configure some time) - but the messages... Firstly ./configure decides that 'capstone' comes from 'git', then it simply fails with no indication why it went wrong.

Ha. I just found another workaround - I can do ./configure --with-git=false and silently disable git updates. Pretty much pointing a gun to my leg, ready to shoot.

We could just check git submodule status every build and print a warning if it is out of sync but continue. This way I would look at the submodules list and decide what to do.

Signature · 1 line
Alexey
#19 lore raw
Quoted 139 lines · Alexey Kardashevskiy
Quoted 46 lines · Daniel P. Berrange
Quoted 45 lines · Alexey Kardashevskiy
Quoted 43 lines · Daniel P. Berrange
Quoted 32 lines · Alexey Kardashevskiy
Quoted 31 lines · Daniel P. Berrange
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Quoted 7 lines

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

Also yesterday on IRC:

<RaV3N> [...] I downloaded the qemu source from git and tried to compile it. I am getting this:

./configure --static && make && sudo make install
CC ui/input-keymap.o
ui/input-keymap.c:8:10: fatal error: ui/input-keymap-linux-to-qcode.c:
No such file or directory

Quoted 7 lines
Quoted 2 lines

I had a pull request merged yesterday later afternoon which possibly would address that problem, though hard hard to say for certain.

wow, already? :(

I still wonder why do not we checkout submodules into the build directory and why .git-submodule-status is not there too...

That simply isn't the way submodules work, they are inherently part of the source tree, and the status file reflects that too.

Quoted 7 lines
Quoted 4 lines

Sorry, I am missing the point here. What precisely does prevent us from checking out the required modules to the build directory and build them there? git provides a submodule repository url and sha1 for the current qemu branch.

The build directory should never contain any of your version controlled source, as that will get irretrievably lost when the build dir is purged.

I am not suggesting editing submodule sources from the build directory, I am suggesting not building them from the source directory, in order to keep them in sync, Makefile can rsync or "git push" them to the build directory. Yeah, fairly ugly but still more correct than the current solution.

And again, .git-submodule-status is not a source file, what is it doing in $SRC_PATH?

Now I cannot compile qemu pretty much 50% of time because of that enhancement. In the today's episode:

ssh aikhostos2 cd /home/aik/pbuild/qemu-aikhostos2-ppc64/ ; /home/aik/p/qemu/configure --target-list=ppc64-softmmu --source-path=/home/aik/p/qemu/ --enable-debug --enable-debug-info --disable-werror --disable-git-update --enable-trace-backend=log

All good. One detail:
capstone git

ssh aikhostos2 make -C /home/aik/pbuild/qemu-aikhostos2-ppc64/ -j24

make: Entering directory `/home/aik/pbuild/qemu-aikhostos2-ppc64'
GEN ppc64-softmmu/config-devices.mak.tmp
mkdir -p dtc/libfdt
mkdir -p dtc/tests
GEN config-host.h
GEN qemu-options.def
make[1]: *** No rule to make target `/home/aik/pbuild/qemu-aikhostos2-ppc64/capstone/libcapstone.a'. Stop.
make: *** [subdir-capstone] Error 2
make: *** Waiting for unfinished jobs....
GEN ppc64-softmmu/config-devices.mak

How, why, where are all these nice warning messages? Ah, there they are (added 'set -x' to the script):

+ substat=.git-submodule-status
+ command=status
+ shift
+ maybe_modules='ui/keycodemapdb dtc capstone'
+ test -z git
+ modules=
+ for m in '$maybe_modules'
+ git submodule status ui/keycodemapdb
+ test 128 = 0
+ echo 'warn: ignoring non-existent submodule ui/keycodemapdb'
+ for m in '$maybe_modules'
+ git submodule status dtc
+ test 128 = 0:m
+ echo 'warn: ignoring non-existent submodule dtc'
+ for m in '$maybe_modules'
+ git submodule status capstone
+ test 128 = 0
+ echo 'warn: ignoring non-existent submodule capstone'
+ test -n 'ui/keycodemapdb dtc capstone'
+ test -e .git
+ case "$command" in
+ test -z 'ui/keycodemapdb dtc capstone'
+ test -f .git-submodule-status
+ exit 1

I assume that 'warn' is not printed because of Makefile's 'quiet-command'.

And this fails because on the server the source directory is created with 'git worktree' which points to bare git repo outside of the source tree and the git on that build machine has no idea about worktrees (the repo is visible to the build machine).

[vpl1 ~]$ ssh -x aikhostos2 'cd p/qemu && pwd && git --version && ls -d ../qemu.git && git submodule status'
/home/aik/p/qemu
git version 1.8.3.1
../qemu.git
fatal: Not a git repository: /home/aik/p/qemu.git/worktrees/qemu

Again - ok, when I know what is the problem, I know how to fix it - simply move .git away when running ./configure and make (as it also runs ./configure some time) - but the messages... Firstly ./configure decides that 'capstone' comes from 'git', then it simply fails with no indication why it went wrong.

Quoted 7 lines

Ha. I just found another workaround - I can do ./configure --with-git=false and silently disable git updates. Pretty much pointing a gun to my leg, ready to shoot.

We could just check git submodule status every build and print a warning if it is out of sync but continue. This way I would look at the submodules list and decide what to do.

I assume that no response to this means my proposal is somehow worse that what we got now, correct? Thanks.

Signature · 1 line
Alexey
#20 lore raw
In reply to Thomas Huth
Quoted 15 lines · Thomas Huth

That automatic git submodule stuff now broke my workflow again. I usually keep the git repository on my laptop and then simply rsync the sources (without .git directories) to my target machine to compile it there. Used to work great for years. Now it's broken, the build process complains:

GIT submodule checkout is out of date. Please run
scripts/git-submodule.sh update
from the source directory checkout /home/thuth/devel/qemu

Running "scripts/git-submodule.sh update" did not fix the issue at all - I first had to tinker with it for a while to find out that I simply have to delete ".git-submodule-status" in my git tree to fix the issue.

Quoted 6 lines

I've got the feeling that all this submodule crap is constantly causing pain ... do we really need this? Can't we find another solution instead? Or at least stop modifying files automatically in the $SRC_PATH ?

... ok, sorry for the harsh words, ... but now that I've written this down, I feel at least a little bit better ...

Since there is resistance to add a way to disable changing $SRC_PATH, I guess the way to go is simply move .git folder outside of source tree and use $GIT_DIR or --work-dir only when you want git to manage the sources - this should make $git_submodules empty in ./configure and git-submodule.sh not to touch anything.

Signature · 1 line
Alexey