Skip to content
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

Bug in Makefile when pulling from branch with "/" in name #13687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geezer09
Copy link

@geezer09 geezer09 commented Nov 11, 2024

The makeFile currently does not handle having merges from branches with "/" in them such as a branch named features/cool_feature. If the slashes are not removed from those branch names, subdirectories get created that then break the code. For example at line 191-192:

$(TMPDIR)/VASSAL-$(VERSION)-other.zip: $(TMPDIR)/other-$(VERSION)-build/VASSAL-$(VERSION)
pushd $(TMPDIR)/other-$(VERSION)-build ; zip -9rv ../../$@ VASSAL-$(VERSION) ; popd

Breaks becuase the "../../" part assumes no subdirectories are created by $(VERSION). The code also breaks at 209-210.

I'm surprised this bug hasnt been detected sooner. I recently had to rename I branch I was creating a PR from because of this issue.

Here is part of the log showing the errors caused by keeping slashes in branch name:

mkdir -p tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave
cp -a release-prepare/target/doc tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/doc
cp -a CHANGES LICENSE README.md tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave
cp -a release-prepare/target/lib tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/lib
cp dist/VASSAL.sh tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave
cp vassal-app/src/main/resources/icons/scalable/VASSAL.svg tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave
find tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave -type f -exec chmod 644 \{\} \+
find tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave -type d -exec chmod 755 \{\} \+
chmod 755 tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/VASSAL.sh
tar cjvf tmp/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-linux.tar.bz2 -C tmp/linux-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-build VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave
tar (child): tmp/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-linux.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: tmp/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-linux.tar.bz2: Cannot write: Broken pipe
tar: Child returned status 2
tar: Error is not recoverable: exiting now
VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/
VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/VASSAL.svg
VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave/LICENSE
make: *** [Makefile:209: tmp/VASSAL-3.8.0-SNAPSHOT-ea5e6a6-feature/log_autosave-linux.tar.bz2] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant