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

go.mk: use as a plain repo instead of a submodule #575

Conversation

sauterp
Copy link
Member

@sauterp sauterp commented Feb 16, 2024

Description

We remove the go.mk as a submodule and ensure that it is automatically cloned and kept up to date with make.

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing

If go.mk doesn't exist, it will be cloned:

❯ make build
Cloning into 'go.mk'...
remote: Enumerating objects: 308, done.
remote: Counting objects: 100% (194/194), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 308 (delta 130), reused 135 (delta 91), pack-reused 114
Receiving objects: 100% (308/308), 60.52 KiB | 911.00 KiB/s, done.
Resolving deltas: 100% (173/173), done.
mkdir -p '/home/sauterp/src/github.com/exoscale/cli/bin'
'/home/sauterp/bin/go' build \
   \
  -ldflags "-X main.commit=5890d142 -X main.branch=philippsauter/sc-88913/go-mk-provide-alternative-to-submodule-approach -X main.buildDate=2024-02-16T13:57:06+0000 -X main.version=dev " \
   \
  -o '/home/sauterp/src/github.com/exoscale/cli/bin/exo' \
  '.'

Once it exists, it will not be cloned anymore, but make ensures, that the same ref is checked out in go.mk even if it was changed before.

❯ cd go.mk
❯ git checkout HEAD^
❯ cd ..
❯ make build
mkdir -p '/home/sauterp/src/github.com/exoscale/cli/bin'
'/home/sauterp/bin/go' build \
   \
  -ldflags "-X main.commit=13af661a -X main.branch=philippsauter/sc-88913/go-mk-provide-alternative-to-submodule-approach -X main.buildDate=2024-02-16T15:23:06+0000 -X main.version=dev " \
   \
  -o '/home/sauterp/src/github.com/exoscale/cli/bin/exo' \
  '.'

Copy link

This pull request has been linked to Shortcut Story #88913: go.mk: provide alternative to submodule approach.

@sauterp sauterp changed the title go.mk: use as a plain repo instead of submodule go.mk: use as a plain repo instead of a submodule Feb 16, 2024
@sauterp sauterp marked this pull request as ready for review February 16, 2024 15:26
@sauterp sauterp merged commit cea91f5 into master Feb 19, 2024
1 check passed
@sauterp sauterp deleted the philippsauter/sc-88913/go-mk-provide-alternative-to-submodule-approach branch February 19, 2024 15:33
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.

3 participants