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

make 4.4 (oct 31 2022) causes issues with the git submodule resulting in an infinite loop #333

Closed
nitrocode opened this issue Dec 23, 2022 · 4 comments · Fixed by #335 or #336
Closed
Labels
bug Something isn't working

Comments

@nitrocode
Copy link
Member

nitrocode commented Dec 23, 2022

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

make 4.4 (oct 31 2022) and 4.4.1 causes issues with the git submodule resulting in an infinite loop

https://ftp.gnu.org/gnu/make/

cc: @Nuru

Expected Behavior

It should not be in an infinite loop

Steps to Reproduce

  1. Use the ancient OSX make which is 3.81 version
  2. /usr/bin/make init
  3. Notice that the target exits successfully
  4. Use the GNU make by doing brew install make to get the latest 4.4 version
  5. /usr/local/bin/make init
  6. Notice the infinite loop
✗ make SHELL='sh -x' init

+ pwd
+ pwd
+ '[' -d build-harness ']'
+ pwd
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ show -s --format=%aN
+ show -s --format=%aN
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url

Screenshots

N/A

Environment (please complete the following information):

  • OSX Ventura 13.0
  • GNU Make 4.4

Additional Context

Worked on debugging this with @dudymas on it! Thank you!

Downgrading back to make 4.3 is successful

Commenting out this line prevents the issue

include $(BUILD_HARNESS_PATH)/modules/*/bootstrap.Makefile*

And the git module is the specific one that seems to be failing which causes repeating the include.

export GIT_BRANCH ?= $(shell $(GIT) rev-parse --abbrev-ref HEAD 2>/dev/null)
export GIT_TAG ?= $(shell $(GIT) tag -l --sort -taggerdate --points-at HEAD 2>/dev/null | head -n 1)
export GIT_COMMIT_URL ?= $(shell $(GIT) config --get remote.origin.url 2>/dev/null | sed 's/\.git$$//g' | sed 's/git@\(.*\):/https:\/\/\1\//g' )/commit/$(GIT_COMMIT_SHORT)
export GIT_COMMIT_MESSAGE ?= $(shell $(GIT) show -s --format=%s%b 2>/dev/null)
export GIT_COMMIT_AUTHOR ?= $(shell $(GIT) show -s --format=%aN 2>/dev/null)
export GIT_COMMIT_TIMESTAMP ?= $(shell $(GIT) log -1 --format=%ct 2>/dev/null)

Workaround

Option 1: Use OSX make

/usr/bin/make --version
/usr/bin/make all

Option 2: Brew to pin GNU Make to 4.3

if you do not want to use the older make but also want to pin to 4.3 using homebrew

# uninstall 4.4 make
brew uninstall make
# find your make.rb file
find / -name make.rb
# override the make.rb file with the 4.3 version
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/9345e061435f18a91437cc5a3db34a90acbb9f1b/Formula/make.rb make.rb
# install
brew install make.rb
# finally pin
brew pin make
@nitrocode
Copy link
Member Author

nitrocode commented Jan 19, 2023

@dudymas this still fails for me

$ make --version
make --version
GNU Make 4.4
rm .build-harness
rm -rf build-harness/
make SHELL='bash -x' BUILD_HARNESS_AUTO_INIT=true all -n

Then the infinite loop ensues.

This loops

+ pwd
+ uname -s
+ tr '[:upper:]' '[:lower:]'
+ uname -s
+ tr '[:upper:]' '[:lower:]'
+ uname -m
+ sed s/x86_64/amd64/g
+ uname -m
+ sed s/x86_64/amd64/g
+ uname -s
+ tr '[:upper:]' '[:lower:]'
+ uname -m
+ sed s/x86_64/amd64/g
+ uname -s
+ tr '[:upper:]' '[:lower:]'

@nitrocode
Copy link
Member Author

I'm still running into this issue.

My workaround has been to use /usr/bin/make which is the old osx version of make. However, I keep forgetting to add /usr/bin so for now, I will pin back to 4.3 for now until we have a full fix.

@gurnben
Copy link

gurnben commented Dec 12, 2023

We also just bumped into this issue upon updating our CI to a newer Jenkins alpine agent!

@Nuru
Copy link
Contributor

Nuru commented Feb 2, 2024

Closing this because I cannot reproduce it with Gnu Make 4.4.1. Maybe it got fixed along the way, maybe you had something cached. If this problem recurs, please open a new issue with fresh details.

@Nuru Nuru closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants