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

Remove generated files from the repository #642

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rhansen
Copy link
Contributor

@rhansen rhansen commented Jan 7, 2024

I am currently working on creating a Debian package for keyd, and would like to upstream some build system cleanup commits:

  • Use mkdir -p instead of ignoring return code
  • Teach make all to make everything
  • Remove generated files from the repository

Makefile Outdated
@@ -88,14 +88,14 @@ uninstall:
$(DESTDIR)$(PREFIX)/bin/keyd-usb-gadget.sh \
$(DESTDIR)$(PREFIX)/lib/systemd/system/keyd.service
clean:
-rm -rf bin keyd.service
rm -rf bin data/*.1.gz data/keyd.compose keyd.service
Copy link
Owner

@rvaiya rvaiya Feb 10, 2024

Choose a reason for hiding this comment

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

compose and run are not included the default/clean targets so the user doesn't need to have python or scdoc on their system. The generated assets are deliberately checked into the repo.

Copy link
Contributor Author

@rhansen rhansen Feb 27, 2024

Choose a reason for hiding this comment

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

Pros to removing generated files:

  • It simplifies the work of downstream packagers that have to tweak the input files or the build process.
  • It eliminates any chance that the checked-in generated files become out of sync with the checked-in input files.
  • The codebase is easier for potential contributors to understand.
  • No need to review changes to generated files when a pull request modifies the input files.

Cons to removing generated files:

  • Users building keyd will have to install python and scdoc. (Users running a pre-built binary package are unaffected.) Such users already have to know how to install a C compiler and dependency headers; adding python and scdoc to the list does not seem overly burdensome to me.
  • Building takes much more time now. (It's still sufficiently fast enough, in my opinion. Also, incremental build speed can be restored with some further tweaks to the Makefile.)

(Please let me know if anything was omitted.)

@rhansen rhansen changed the title Build system improvements Remove generated files from the repository Feb 28, 2024
The `-f` option causes `rm` to silently ignore files that don't exist,
so `rm -rf` will only fail if `rm` has trouble deleting a file that
exists.  We want `make` to fail in that situation.
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.

None yet

2 participants