Skip to content

Stop versionning the configure script#11343

Open
shindere wants to merge 1 commit intoocaml:trunkfrom
shindere:no-configure
Open

Stop versionning the configure script#11343
shindere wants to merge 1 commit intoocaml:trunkfrom
shindere:no-configure

Conversation

@shindere
Copy link
Copy Markdown
Contributor

Follow-up to #11294 (comment)

Since this file is generated, storing it means either having to
ensure it remaiins synchronized with the files it is generated from,
or leaving it be not synchronised, which is not satisfactory.

This PR removes configure from the repository, but configure will still
be generated as part of the release process and will thus be in the
release tarballs.

The PR also gets rid of the GitHub actions used to verify that
configure was in sync with configure.ac.

@kit-ty-kate
Copy link
Copy Markdown
Member

This requires a change in the opam file.

@xavierleroy
Copy link
Copy Markdown
Contributor

Let me play "grumpy old developer" once more. I feel this PR is making my life as a core OCaml developer more difficult. Is it worth my suffering?

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 21, 2022 via email

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 22, 2022 via email

@damiendoligez
Copy link
Copy Markdown
Member

tools/ci/actions/runner.sh needs to be updated too (for the basic-compiler action).

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 22, 2022 via email

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

Back in 4.08 when we switched to autoconf, it felt like too many changes at once to be pulling in autoconf as a dev dependency. That said, it's a lot of effort that goes into checking that the committed configure script is actually correct - it may briefly take some getting used to, but I expect this will be simpler in the long-run.

There are two other changes in addition to the various comments:

  • tools/pre-commit-githook needs HOOK_VERSION bumped and then lines 87-193 deleted
  • The release notes need updating: on a release tag, configure should be removed from .gitignore and then configure committed (in order to get it into the GitHub release tarball) and then on the commit following the line should be restored .gitignore and configure removed.

Comment on lines -41 to -55
- name: configure correctly generated
run: >-
tools/ci/actions/check-configure.sh
'${{ github.ref }}'
'${{ github.event_name }}'
'${{ github.event.pull_request.base.ref }}'
'${{ github.event.pull_request.base.sha }}'
'${{ github.event.pull_request.head.ref }}'
'${{ github.event.pull_request.head.sha }}'
'${{ github.event.ref }}'
'${{ github.event.before }}'
'${{ github.event.ref }}'
'${{ github.event.after }}'
if: ${{ always() }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#11346 proposes a replacement check to ensure it's not accidentally committed in future.

INSTALL.adoc Outdated

* A POSIX-compatible `diff` is necessary to run the test suite.

* GNU `autoconf`, if compiling from the git repository
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: capital G on Git

INSTALL.adoc Outdated
command from its root directory:

./configure
tools/autogen
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: the previous command was indented 6 spaces (as the next one is)

@echo "- In file README.win32.adoc for Windows systems."
@echo "On Unix systems, if you've just unpacked the distribution,"
@echo "something like"
@echo " tools/autogen (needed only for git clones)"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This whole thing has been broken since 4.13 (see #11347!), so I'm hesitant suggesting, but this could be:

Suggested change
@echo " tools/autogen (needed only for git clones)"
ifeq "$(wildcard configure)" ""
@echo " tools/autogen"
endif

and only suggest the command if it's clearly needed. This would stop the command being suggested if you extracted a release tarball and just ran make, for example.

@@ -12,6 +12,7 @@ depends: [
conflict-class: "ocaml-core-compiler"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GitHub won't let me add the comment in the correct place, but "conf-autoconf" should be added to the list in depends above.

@avsm
Copy link
Copy Markdown
Member

avsm commented Jun 22, 2022

To echo @xavierleroy from an opam perspective, this proposal would make the installation of trunk switches for users slightly more complicated, as they would also need to have the right version of autoconf installed (and a particular version, no less! #11294).

The status quo seems fine to me with configure checked in, and some scripting magic in the CI that seems to work reasonably already...

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 22, 2022 via email

@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 22, 2022

To echo @xavierleroy from an opam perspective, this proposal would make the installation of trunk switches for users slightly more complicated, as they would also need to have the right version of autoconf installed (and a particular version, no less! #11294).

If configure is removed, we wouldn't need a precise version of autoconf (in particular, #11294 would be dropped)

@avsm
Copy link
Copy Markdown
Member

avsm commented Jun 22, 2022

@dra27 wrote:

If configure is removed, we wouldn't need a precise version of autoconf (in particular, #11294 would be dropped)

I don't see how that follows. The problem in #11294 is that we need a particular version of autoconf in order for the generated ./configure file to be reproducible.

If we simply drop the autoconf version requirement for developers, don't we now expose them to the possibility of an inconsistent local configure script vs what they might have gotten from the checked in version?

And in complement, what is then generating the release tarball configure scripts such that they are reproducible vs what is tested in CI? If the configure script is in the repo, then you have less to trust with respect to verifying that the release tarball hasn't been compromised or corrupted.

I fear we are playing whac-a-mole with reproducibility here :-)

@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 22, 2022

We only cared about the reproducibility of configure because we commit it, because we need it be certain that a committed version was actually generated by autoconf and doesn’t contain any illicit sudo commands, etc. (same as with the boot artefacts). The requirement for a precise version just allowed that check to be automated.

With configure only committed in release tags, nothing stops the configure script on a release tag being checked in the same way as it is now?

There’s an ease of development argument against doing this, sure, but I’m not at all sure there’s a trust argument!

@xavierleroy
Copy link
Copy Markdown
Contributor

The release notes need updating: on a release tag, configure should be removed from .gitignore and then configure committed (in order to get it into the GitHub release tarball) and then on the commit following the line should be restored .gitignore and configure removed.

"Ca fait pitié" as we say in French. I feel sorry about the release manager who will have to put up with this. And I believe releases should be snapshots of the working sources, no more, no less. The more differences we introduce in releases, the more opportunities to get it wrong.

@Octachron
Copy link
Copy Markdown
Member

On the specific issue of the release process, the pre-release, release and post-release commits are already special because we need to change the version number and thus update configure anyway. Moreover, there is no need to change .gitignore to commit configure with the release script, we can use git commit --force with the finite number of files that needs updating.

So there is in fact a slight decrease in the number of command that needs to be run during release since there will be no need to update configure during the pre and post release commit.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 22, 2022

Moreover, there is no need to change .gitignore to commit configure with the release script, we can use git commit --force with the finite number of files that needs updating.

I was thinking of your heart, a la #10173, were we to merge #11346 to guard against accidentally recommitting configure as noted in #11346 (comment) 🙂

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 23, 2022 via email

@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Jun 23, 2022 via email

Since this file is generated, storing it means either having to
ensure it remaiins synchronized with the files it is generated from,
or leaving it be not synchronised, which is not satisfactory.
@shindere
Copy link
Copy Markdown
Contributor Author

shindere commented Sep 7, 2022

Also relevant to this discussion is this comment:

#11268 (comment)

@shindere shindere changed the title Stop shipping the configure script Stop versionning the configure script Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants