Skip to content

Update Makefile: Ensure make install respects DESTDIR and PREFIX, and Add make dist target for source tarball creation#34

Merged
kgiusti merged 2 commits into
containers:mainfrom
rosygmiki:make-update
Feb 23, 2026
Merged

Update Makefile: Ensure make install respects DESTDIR and PREFIX, and Add make dist target for source tarball creation#34
kgiusti merged 2 commits into
containers:mainfrom
rosygmiki:make-update

Conversation

@rosygmiki

Copy link
Copy Markdown
Collaborator
  1. PREFIX and DESTDIR paths in the makefile are separated for clear installation logic.
  • PREFIX is the target prefix, while DESTDIR can be optionally used for staging, in the install directory.
  1. Creates a make dist target that produces a distributable source tarball. This is needed for Fedora/RPM packaging workflows where source tarballs are the standard input format

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @rmiki-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the project's build and packaging capabilities by improving the make install target's adherence to standard installation practices, particularly regarding DESTDIR and PREFIX. Additionally, it introduces a make dist target to generate a source tarball, streamlining the process for creating distributable packages.

Highlights

  • Installation Path Handling: Modified the Makefile to correctly separate PREFIX and DESTDIR variables, ensuring make install properly stages files when DESTDIR is used.
  • Source Tarball Generation: Introduced a new make dist target that creates a distributable source tarball, which is essential for packaging workflows like Fedora/RPM.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Makefile
    • Defined project-specific variables (PROJECT, VERSION, PROJDIR, TARBALL, DIST_FILES) for better organization and reusability.
    • Updated the .PHONY declaration to include the new dist target.
    • Adjusted the PREFIX default value and modified INSTALLDIR to correctly combine DESTDIR and PREFIX for installation.
    • Extended the clean target to remove artifacts generated by the new dist target.
    • Added a new dist target that creates a directory, copies specified files into it, generates a compressed tarball, and then cleans up the temporary directory.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two main improvements to the Makefile: correctly handling DESTDIR and PREFIX for staging installations, and adding a dist target to create source tarballs for packaging. The changes are well-implemented. My only suggestion is to avoid hardcoding the version number in the Makefile to improve long-term maintainability, especially for the packaging use case mentioned.

Comment thread Makefile Outdated
@kgiusti kgiusti linked an issue Feb 16, 2026 that may be closed by this pull request
@kgiusti

kgiusti commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

git provides a handy tool for creating archive files that you might want to consider using: git-archive. The nice thing about git-archive is that you don't have to explicitly list files to tar up so things stay in sync automatically when files are added or removed from the repo.

Here's an example of how it's done: https://github.com/fido-device-onboard/go-fdo-server/blob/cf025fe5c72f78de1a3cc783aa15e718200f826f/Makefile#L56

@rosygmiki
rosygmiki force-pushed the make-update branch 3 times, most recently from 20ead63 to 41b56ca Compare February 17, 2026 19:45
Signed-off-by: Rosy-Glorious Miki <rmiki@redhat.com>
Comment thread Makefile Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated
.PHONY: all build clean fmt install lint test tools unit-test integration-test validate .install.golangci-lint
PROJECT := tar-diff
VERSION := $(shell go run ./cmd/tar-diff -version | cut -d' ' -f2)
PROJDIR := $(PROJECT).$(VERSION)

@knecasov knecasov Feb 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PROJDIR variable uses a dot, but git archive --prefix uses a hyphen. Should not it be unified, please? Anyway, this variable is not used so it seems that it could be removed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice, thank you. I'll have the folder match the file name. The PROJDIR var is currently being used in the clean target

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the standard convention is to use a hyphen for name-version formatting so I would recommend reflecting this in the PROJDIR, PROJ_TARBALL variable and in the git archive --prefix command.

Yes, the PROJDIR variable is used only in the clean target so I do not see a reason why it could not be removed. I am very sorry for my previous inaccurate comment ("this variable is not used").

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have switched to a hyphen for name-version, and took out PROJDIR since it is only used once.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see an underscore used for name-version formatting instead of a hyphen. Is that intentional, please?

@knecasov knecasov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I conducted the code review with AI assistance.

@rosygmiki
rosygmiki force-pushed the make-update branch 2 times, most recently from 2b9af6c to 47b1c7b Compare February 19, 2026 16:13

@mmartinv mmartinv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nitpicks, feel free to address them if you want. Either case it LGTM

Comment thread Makefile
Comment thread Makefile Outdated

@kgiusti kgiusti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Rosy-Glorious Miki <rmiki@redhat.com>
@kgiusti
kgiusti merged commit 02dd094 into containers:main Feb 23, 2026
3 checks passed
@semanticreleasebot-rmiki

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add make dist target for source tarball creation

5 participants