New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] maintain patchset without requiring rebuilding. #1326
Comments
Another approach I use is If it doesn't work, I rebuild everything. It takes less then hour to rebuild |
By the way, can you isolate your patches to a plugin to avoid rebasing? |
Thanks will try both suggestions (build and plugins). Will have to check out how the plugins thingy works. Isn't there some option/hack for |
I don't know about such an option. It would require to store checksums of all files. One more problem: MXE creates empty files in By the way, take a looks at |
Well, it's likely that such local patches would mostly touch make files, and so the files at the |
+1, unless the changes are small, in which case an @avih, I still need to document plugins but browse through the existing ones to get a feel for what they do - note they can be entirely local.
Indeed, see https://www.cmcrossroads.com/article/rebuilding-when-files-checksum-changes for an implementation from the author of the GNU Make Standard Library. It gets very complicated very quickly - it's one of the rare cases where I don't think |
Interesting. So I'm not the first to want checksum instead of date as a change indication ;) A bit weird that no proper solution exists so far for this. |
Yeah, for a long while I was only modifying Where should I put this include statement? |
I was thinking at the bottom of the package you're modifying, but on reflection, it isn't such a good idea. There's no easy way to toggle it on/off and it's a layer of unnecessary indirection. |
FWIW, I've solved it with the following script, and invoking it unconditionally at the beginning of the HASHSTAMP_DUMMY := $(shell (>&2 echo "[check timestamps]"))
HASHSTAMP_DUMMY := $(shell (>&2 $(TOP_DIR)/tools/hashstamp.sh $(TOP_DIR)/src/*))
HASHSTAMP_DUMMY := $(shell (>&2 echo "[done timestamps]")) It seems to be working well for me so far. In a nutshell: for every file it's invoked on, it creates another file with the hash of the original and the date of the original, but if such file already exist and contains the same hash as the original, then it copies (restores) its timestamp (if modified). Basically, FWIW, there are about 800 files at I put it as #!/usr/bin/env bash
STAMPSSUM="md5sum"
STAMPSDIR=".hashstamps"
v=$HASHSTAMPS_VERBOSE # 0 - quiet, 1 (def) - updates only, 2 - verbose
[ -z $v ] && v=1
updatestamp() {
while ! [ -z "$1" ]; do
if ! [ -d $1 ]; then # skip directories quietly
if ! [ -e $1 ]; then
>&2 echo "Cannot find '$1'. Skipping."
shift
continue
fi
local sum="$($STAMPSSUM $1 | cut -d ' ' -f1)"
local stampsdir="$(dirname $1)/$STAMPSDIR"
local stampfile="$stampsdir/$(basename $1).hashstamp"
local stamp=$( [ -e $stampfile ] && cat $stampfile || echo '' )
if [ "$sum" == "$stamp" ]; then
if [ $(stat -c "%Y" $1) != $(stat -c "%Y" $stampfile) ]; then
[ $v -ge 1 ] && echo "'$1' - Restoring timestamp from '$stampfile'."
touch -r $stampfile $1
else
[ $v -ge 2 ] && echo "'$1' - Not touching."
fi
else
if ! ( [ -d $stampsdir ] || mkdir $stampsdir >/dev/null 2>&1 ); then
>&2 echo "Cannot create dir '$stampsdir' for '$1'. Skipping."
shift
continue
fi
[ $v -ge 1 ] && echo "'$1' - Creating/updating stamp at '$stampfile'."
echo "$sum" > $stampfile
touch -r $1 $stampfile
fi
fi
shift
done
}
updatestamp "$@" |
I'm maintaining a small patchset at my local MXE repo and typically rebasing it on top on MXE master.
Till recently it was mostly for ffmpeg master, but I then added also mingw 5.0.
It turns out that after I pull+rebase now, it thinks mingw is out of date and rebuilds everything from scratch. I didn't try it enough times yet to be able to say that it always happens though.
If this is sort of by design (because
mingw-w64.mk
got touched from the rebase), is there any way to somehow work around it? I'd think that as long as the content of the file didn't change since the lastmake
, it shouldn't be considered outdated, but I don't know if/how that could be achieved.Help?
The text was updated successfully, but these errors were encountered: