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

Makefile.in: stop running distclean on dist #5142

Merged
merged 1 commit into from
May 19, 2022

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented May 13, 2022

distclean erases user-made modifications to the files generated by the
configure script; it is not obvious that a non-"clean" target would ever
run it.

That is, instead of:

./configure --enable-foo && make distclean && make dist

It would probably be safer (and more maintainable) to do:

make distclean && ./configure --enable-foo && make dist

So drop the distclean call and the file-moving hacks around it.

Added on commit 1379851 ("Baseline firejail 0.9.28", 2015-08-08).

Relates to commit 6849191 ("bug: preserve config.status during make
dist", 2016-09-19) and commit 31dc121 ("fixups", 2020-07-19).

distclean erases user-made modifications to the files generated by the
configure script; it is not obvious that a non-"clean" target would ever
run it.

That is, instead of:

    ./configure --enable-foo && make distclean && make dist

It would probably be safer (and more maintainable) to do:

    make distclean && ./configure --enable-foo && make dist

So drop the distclean call and the file-moving hacks around it.

Added on commit 1379851 ("Baseline firejail 0.9.28", 2015-08-08).

Relates to commit 6849191 ("bug: preserve config.status during make
dist", 2016-09-19) and commit 31dc121 ("fixups", 2020-07-19).
@kmk3 kmk3 marked this pull request as draft May 19, 2022 01:31
@kmk3 kmk3 added WIP: DON'T MERGE A PR that is still being worked on and removed WIP: DON'T MERGE A PR that is still being worked on labels May 19, 2022
@kmk3 kmk3 marked this pull request as ready for review May 19, 2022 17:03
@kmk3 kmk3 merged commit 528fa2a into netblue30:master May 19, 2022
@kmk3 kmk3 deleted the stop-distclean-on-dist branch May 19, 2022 17:03
@kmk3
Copy link
Collaborator Author

kmk3 commented May 19, 2022

Misc: Used a normal merge for this because I refer to this PR on other commits.

kmk3 added a commit to kmk3/firejail that referenced this pull request May 20, 2022
Add the following missing generated files to DISTFILES:

* Makefile
* mkdeb.sh

To make the dist archive contain all of the files that are generated by
the configure script, which removes the need to run ./configure after
unpacking the archive (as is currently done on `make deb`).

Relates to netblue30#5142.
kmk3 added a commit to kmk3/firejail that referenced this pull request May 20, 2022
On firejail 0.9.68, one would run `./configure` (to generate Makefile
from Makefile.in) and then running `make deb` would end up running
something akin to:

    make distclean && make dist && ./configure --prefix=/usr && mkdeb.sh

As of netblue30#5142, `make dist` does not run `make distclean` anymore, but
`make deb` still overrides any configure options that the user might
have set.

Stop doing that and do just `make dist && mkdeb.sh` on `make deb`.

To build everything from scratch as `make deb` would do on 0.9.68 (but
without it overriding the configure options), one can run:

    make distclean && ./configure --prefix=/usr && make deb

Note that this is basically what the "build_debian_package" job on
.gitlab-ci.yml does (see also the "build_apparmor" job).

Should fully fix netblue30#3523.

Relates to netblue30#772 netblue30#1205.
kmk3 added a commit to kmk3/firejail that referenced this pull request May 20, 2022
On firejail 0.9.68, one would run `./configure` (to generate Makefile
from Makefile.in) and then running `make deb` would end up running
something akin to:

    make distclean && make dist && ./configure --prefix=/usr &&
      ./mkdeb.sh

As of netblue30#5142, `make dist` does not run `make distclean` anymore, but
`make deb` still overrides any configure options that the user might
have set.

Stop doing that and do just `make dist && ./mkdeb.sh` on `make deb`.

To build everything from scratch as `make deb` would do on 0.9.68 (but
without it overriding the configure options), one can run:

    make distclean && ./configure --prefix=/usr && make deb

Note that this is basically what the "build_debian_package" job on
.gitlab-ci.yml does (see also the "build_apparmor" job).

Should fully fix netblue30#3523.

Relates to netblue30#772 netblue30#1205.
kmk3 added a commit to kmk3/firejail that referenced this pull request May 27, 2022
This (mostly) restores the behavior from before commit 1fb814e
("Makefile.in: stop running distclean on dist", 2022-05-13) / PR netblue30#5142.
./configure still has to be called before calling ./contrib/fj-mkdeb.py
(to generate Makefile from Makefile.in before calling `make distclean`).
kmk3 added a commit to kmk3/firejail that referenced this pull request May 27, 2022
This (mostly) restores the behavior from before commit 1fb814e
("Makefile.in: stop running distclean on dist", 2022-05-13) / PR netblue30#5142.
./configure still has to be called before calling ./contrib/fj-mkdeb.py
(to generate Makefile from Makefile.in before calling `make distclean`).
kmk3 added a commit to kmk3/firejail that referenced this pull request Jun 8, 2022
This reverts commit 1fb814e.

If distclean is not executed before copying the files on dist, then the
generated files inside src/ are included in the dist archive:

    $ ./configure >/dev/null && make distclean >/dev/null &&
      ./configure >/dev/null && make dist | grep 'Makefile$' | wc -l
    26

This happens because src/ is copied wholesale on dist (see DISTFILES).
Revert the commit to ensure that only the input files (such as the
"Makefile.in" files) are archived.

Related discussion:
netblue30#5154 (review)

Relates to netblue30#5142.
kmk3 added a commit to kmk3/firejail that referenced this pull request Jul 27, 2023
The clean target is currently enough to remove all generated files other
than the ones directly in the root directory, so to simplify the dist
target, make it depend on clean instead of distclean.

See commit 5f27852 ("build: remove unnecessary distclean targets",
2023-07-15) / PR netblue30#5911.

Relates to netblue30#5142 netblue30#5182.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (RELNOTES N/A)
Development

Successfully merging this pull request may close these issues.

2 participants