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

Fix build process failing on source archives #10769

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

Conversation

fvaleri
Copy link
Contributor

@fvaleri fvaleri commented Oct 28, 2024

Type of change

  • Bugfix

Description

This patch fixes the build process failing on source archives.

The build process fails when running on a source archive that does not contain the .git folder.

./.azure/scripts/check_docs.sh
make[1]: Entering directory '/home/fvaleri/Downloads/strimzi-kafka-operator-0.44.0-rc1'
documentation/snip-kafka-versions.sh > documentation/modules/snip-kafka-versions.adoc
documentation/version-dependent-attrs.sh > documentation/shared/version-dependent-attrs.adoc
documentation/snip-images.sh > documentation/modules/snip-images.adoc
make[1]: Leaving directory '/home/fvaleri/Downloads/strimzi-kafka-operator-0.44.0-rc1'
warning: Not a git repository. Use --no-index to compare two paths outside a working tree
usage: git diff --no-index [<options>] <path> <path>

Reproducer:

wget https://github.com/strimzi/strimzi-kafka-operator/archive/refs/tags/0.44.0-rc1.tar.gz
tar xzf strimzi-kafka-operator-0.44.0-rc1.tar.gz
cd strimzi-kafka-operator-0.44.0-rc1
make MVN_ARGS="-DskipTests" all

@fvaleri fvaleri added this to the 0.45.0 milestone Oct 28, 2024
@scholzj
Copy link
Member

scholzj commented Oct 28, 2024

There is no intention for this to be used this way. It is part of the Strimzi CI and should be used as part of the Strimzi CI.

@fvaleri
Copy link
Contributor Author

fvaleri commented Oct 28, 2024

It is part of the Strimzi CI and should be used as part of the Strimzi CI.

During releases, we provide source packages, and one should be able to build the project from there following the DEV_GUIDE.

@scholzj
Copy link
Member

scholzj commented Oct 28, 2024

I don't think there is any expectation like that. You are expected to build the project from the Github repository. If you wanna build some release, use the build tag.

@fvaleri
Copy link
Contributor Author

fvaleri commented Oct 28, 2024

You are expected to build the project from the Github repository.

But you can download the project as ZIP file from the GitHub repository, and that would also fail.

@ppatierno
Copy link
Member

During releases, we provide source packages, and one should be able to build the project from there following the DEV_GUIDE.

@fvaleri did we state to build the project from the source zip somewhere there? I can't find it.

Saying that, I think we should make a decision about stating in the DEV_GUIDE you can't build project from sources from zip but just cloning from GitHub or fixing the issue as this PR does.

@scholzj any drawbacks you see in this PR? I can't see anything which could hurt, or?

@scholzj
Copy link
Member

scholzj commented Oct 30, 2024

@scholzj any drawbacks you see in this PR? I can't see anything which could hurt, or?

Yes. It adds yet another complication to the tooling that someone needs to maintain, which has a risk of breaking down etc. It also does not seem to have any real use-case.

@ppatierno
Copy link
Member

It adds yet another complication to the tooling that someone needs to maintain

In reality the fix is just checking the we are inside a Git repo or not. My only doubt if it is a real fix or just a workaround.
If we don't want it, I think we should at least update the DEV_GUIDE clearly stating that the sources from the zip are not meant to be used to build the project but you should do from the GitHub repo instead.

This patch fixes the build process failing on source archives.

The build process fails when run on a source archive that does not contain the `.git` folder.

```sh
./.azure/scripts/check_docs.sh
make[1]: Entering directory '/home/fvaleri/Downloads/strimzi-kafka-operator-0.44.0-rc1'
documentation/snip-kafka-versions.sh > documentation/modules/snip-kafka-versions.adoc
documentation/version-dependent-attrs.sh > documentation/shared/version-dependent-attrs.adoc
documentation/snip-images.sh > documentation/modules/snip-images.adoc
make[1]: Leaving directory '/home/fvaleri/Downloads/strimzi-kafka-operator-0.44.0-rc1'
warning: Not a git repository. Use --no-index to compare two paths outside a working tree
usage: git diff --no-index [<options>] <path> <path>
```

Reproducer:

```sh
wget https://github.com/strimzi/strimzi-kafka-operator/archive/refs/tags/0.44.0-rc1.tar.gz
tar xzf strimzi-kafka-operator-0.44.0-rc1.tar.gz
cd strimzi-kafka-operator-0.44.0-rc1
make MVN_ARGS="-DskipTests" all
```

Signed-off-by: Federico Valeri <[email protected]>
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