mamedev / mame

MAME
https://www.mamedev.org/
Other
8.25k stars 2.02k forks source link

3rdparty leftover makes build "dirty" #4673

Closed katananja closed 5 years ago

katananja commented 5 years ago

As you update and compile the source it get to a point that git start to track deleted *.a files and flag the build as dirty even if you didn't change any part of the source code.

mame0206-472-gc0610d91fc-dirty

Checking the git status:

$ git status
Refresh index: 100% (29218/29218), done.
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    3rdparty/winpcap/Lib/libpacket.a
        deleted:    3rdparty/winpcap/Lib/libwpcap.a

no changes added to commit (use "git add" and/or "git commit -a")

.gitignore may need a review and update.

galibert commented 5 years ago

It's not a file you're supposed to delete, nothing rebuilds it afaik. Checkout it back in.

OG.

On Thu, Feb 21, 2019 at 11:44 AM katananja notifications@github.com wrote:

As you update and compile the source it get to a point that git start to track deleted .a files and flag the build as dirty even if you didn't change any part of the source code*.

mame0206-472-gc0610d91fc-dirty

Checking the git status:

$ git status Refresh index: 100% (29218/29218), done. On branch master Your branch is up to date with 'origin/master'.

Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

    deleted:    3rdparty/winpcap/Lib/libpacket.a
    deleted:    3rdparty/winpcap/Lib/libwpcap.a

no changes added to commit (use "git add" and/or "git commit -a")

.gitignore may need a review and update.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mamedev/mame/issues/4673, or mute the thread https://github.com/notifications/unsubscribe-auth/AI0i8QMkm7zuayoFu94QoZ0-Hkn_fRkEks5vPnh8gaJpZM4bHJiA .

katananja commented 5 years ago

That goes beyond me.

galibert commented 5 years ago

git checkout -f 3rdparty/winpcap/Lib/libpacket.a 3rdparty/winpcap/Lib/libwpcap.a and don't delete *.a files indiscriminatively.

OG.

On Thu, Feb 21, 2019 at 1:18 PM katananja notifications@github.com wrote:

That goes beyond me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mamedev/mame/issues/4673#issuecomment-465978953, or mute the thread https://github.com/notifications/unsubscribe-auth/AI0i8Y_Wbveq9YZ3Xe6dzeRGVZwbyfozks5vPo54gaJpZM4bHJiA .

katananja commented 5 years ago

Doing a git checkout 3rdparty/winpcap/Lib/libpacket.a 3rdparty/winpcap/Lib/libwpcap.a clear the status but it get dirty again after a few git pull's and make clean's.

galibert commented 5 years ago

Then the make clean smells buggy. I tend to do a rm -rf build, so I don't hit it.

OG.

On Thu, Feb 21, 2019 at 2:36 PM katananja notifications@github.com wrote:

Doing a git checkout 3rdparty/winpcap/Lib/libpacket.a 3rdparty/winpcap/Lib/libwpcap.a clear the status but it get dirty again after a few git pull's and make clean's.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mamedev/mame/issues/4673#issuecomment-466001798, or mute the thread https://github.com/notifications/unsubscribe-auth/AI0i8YA0TYRvrk_XMMf4MnYte2tkDJKxks5vPqDggaJpZM4bHJiA .

katananja commented 5 years ago

Hard o say, even forcing a git reset doesn't touch those files:

$ find . -name *.a|grep 3rdparty
./3rdparty/winpcap/Lib/libpacket.a
./3rdparty/winpcap/Lib/libwpcap.a
$ git clean -d -x -f
Removing 3rdparty/genie/bin/
Removing 3rdparty/genie/build/gmake.windows/obj/
Removing language/Afrikaans/strings.mo
Removing language/Albanian/strings.mo
Removing language/Arabic/strings.mo
Removing language/Basque/strings.mo
Removing language/Belarusian/strings.mo
Removing language/Bosnian/strings.mo
Removing language/Bulgarian/strings.mo
Removing language/Burmese/strings.mo
Removing language/Catalan/strings.mo
Removing language/Chinese_Simplified/strings.mo
Removing language/Chinese_Traditional/strings.mo
Removing language/Croatian/strings.mo
Removing language/Czech/strings.mo
Removing language/Danish/strings.mo
Removing language/Dutch/strings.mo
Removing language/English/strings.mo
Removing language/Estonian/strings.mo
Removing language/Finnish/strings.mo
Removing language/French/strings.mo
Removing language/French_Belgium/strings.mo
Removing language/French_Canada/strings.mo
Removing language/Georgian/strings.mo
Removing language/German/strings.mo
Removing language/Greek/strings.mo
Removing language/Hebrew/strings.mo
Removing language/Hindi/strings.mo
Removing language/Hungarian/strings.mo
Removing language/Indonesian/strings.mo
Removing language/Italian/strings.mo
Removing language/Japanese/strings.mo
Removing language/Korean/strings.mo
Removing language/Latvian/strings.mo
Removing language/Lithuanian/strings.mo
Removing language/Macedonian/strings.mo
Removing language/Norwegian/strings.mo
Removing language/Persian/strings.mo
Removing language/Polish/strings.mo
Removing language/Portuguese/strings.mo
Removing language/Portuguese_Brazil/strings.mo
Removing language/Romanian/strings.mo
Removing language/Russian/strings.mo
Removing language/Serbian/strings.mo
Removing language/Serbian_Cyrillic/strings.mo
Removing language/Slovak/strings.mo
Removing language/Slovenian/strings.mo
Removing language/Spanish/strings.mo
Removing language/Spanish_Mexico/strings.mo
Removing language/Swedish/strings.mo
Removing language/Thai/strings.mo
Removing language/Turkish/strings.mo
Removing language/Ukrainian/strings.mo
Removing language/Vietnamese/strings.mo
Removing scripts/build/png.pyc
$ make clean
GCC 8.2.1 detected
Cleaning genie
Cleaning...
make[1]: Entering directory '/src/mame/src/devices/cpu/m68000'
Cleaning...
make[1]: Leaving directory '/src/mame/src/devices/cpu/m68000'
$ find . -name *.a|grep 3rdparty
./3rdparty/winpcap/Lib/libpacket.a
./3rdparty/winpcap/Lib/libwpcap.a

An easy fix would be to add winpcap libs to a exclusion list so even if they are flushed/recycled/rebuilded git will not flag "the source code" as dirty since git complains about a commit on it.

cuavas commented 5 years ago

Those files haven't been deleted when I do make clean from the top-level project directory. If you can show how the files can be deleted by our build scripts, please post details here. Those files are not supposed to be deleted.

katananja commented 5 years ago

I'm not a developer @cuavas, I don't know how or why your build scripts are deleting those files, this are up to you or the developers responsible for it to figure it out.

What I know is that MAME has been flagged as "dirty" even if the source is clean and untouched, you can force the issue by manually deleting those files and looking in to your build scripts why they are flagging the build as dirty.

cuavas commented 5 years ago

Those files are logically part of the source. The build system is correct in flagging the build as dirty if those files are removed, whether you do that manually or it happens as a side effect of some make/GENie behaviour. It's no different to manually deleting any other checked-out file. It would be a bug if the build wasn't marked dirty if those files have been deleted from your clone/worktree.

Now if these files are being deleted by some make/GENie weirdness that can happen as part of a normal workflow, that's a bug. If this is the case, please explain how to repeatably trigger the behaviour. This hasn't happened to me or @galibert, and this is the first report we've had of this happening.

However, if the files are being deleted by some other part of your workflow, you need to adjust your workflow to not delete the files.

katananja commented 5 years ago

I'm just reporting a bug, my workflow is basic as everybody else, all I do is a make clean && make, once a while I notice a "dirty" flag on the build and it has been happening for a while, before it was the bgfx files and language files:

git status --short
M bgfx/shaders/essl/chains/crt-geom/fs_crt-geom-deluxe.bin
M bgfx/shaders/essl/chains/crt-geom/fs_crt-geom.bin
...
?? language/Afrikaans/strings.mo
?? language/Albanian/strings.mo

In general it happens after a git pull, you told me that this "only happens" if I mess with the source, I'm letting you know that something else is causing this, now my git it's clean and I don't know how to replicate it.

cuavas commented 5 years ago

Well the rest of us are not getting this when we make clean, and a git pull will not randomly remove files. Re-open this when you can provide instructions to reliably reproduce the issue.

katananja commented 5 years ago

Looks like somebody else discover problems with make clean 12 days later. https://github.com/mamedev/mame/issues/4722

Tafoid commented 5 years ago

To be fair, #4722 has been in effect since I started using RAMDISK for compiling back in September of last year and I've known about it for a long while. Very likely not related to your problem unless your build folder is not getting erased properly. My issue doesn't effect 3rdparty at all.

katananja commented 5 years ago

Without a further investigation it's hard to say why make clean has gone crazy Tafoid. I did my part reporting it, too bad I'm unable to fix it, I couldn't find any problems with the script.