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

Build fails if workspace is a submodule #275

Open
menehune23 opened this issue Jul 14, 2023 · 1 comment · May be fixed by #276
Open

Build fails if workspace is a submodule #275

menehune23 opened this issue Jul 14, 2023 · 1 comment · May be fixed by #276

Comments

@menehune23
Copy link

menehune23 commented Jul 14, 2023

If running pack with a workspace that is a submodule, the build will fail with a message:

Paketo Buildpack for Git 1.0.6
failed to execute 'git rev-parse HEAD': exit status 128
        fatal: not a git repository: /workspace/../../../../.git/modules/vendor/github.com/triggermesh/triggermesh-event-sources-bundle

For instance:

git clone https://gitlab.eng.vmware.com/tanzu-application-platform/runtime-program/eventing.git
cd eventing
git submodule update --init --recursive
pack build debug --path vendor/github.com/triggermesh/triggermesh-event-sources-bundle --builder paketobuildpacks/builder:tiny --env "BP_GO_TARGETS=cmd/awscloudwatchlogssource-adapter"

I think this might be because the .git file inside of a submodule is different in structure than when at the root of a repo.

I've found that if I simply delete the .git file inside of the submodule, the build will pass. However, this is not a feasible workaround for my scenario (I'll spare the details).

@menehune23
Copy link
Author

I'm thinking that this buildpack should probably check to see if the .git is a folder vs a file. If it's a file, we know we're in a submodule and can treat it the same as the .git folder not existing.

@menehune23 menehune23 linked a pull request Jul 14, 2023 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant