Skip to content

The cmake scripts do not rebuild scanners.c from scanners.re #580

Closed

Description

@AndersonTorres

A cursory reading of install instructions suggests that both cmake and makefile methods of installation take care of updating scanners.c from scanners.re.

However, the instructions for doing it are not present on cmake scripts, only in the handwritten Makefile.

Activity

  1. jgm commented on Jul 19, 2025

    @jgm
    Member

    I guess there are two possible solutions, and I am open to either:

    • clarify the docs so that it's clear you have to use make when you modify scanners.re
    • add something to the cmake script that handles this
  2. nwellnhof commented on Jul 21, 2025

    @nwellnhof
    Contributor

    scanners.c and some other pieces of generated code are under version control. Users never have to rebuild these files.

  3. AndersonTorres commented on Jul 22, 2025

    @AndersonTorres
    Author

    Arguably it doesn't matter for end users, but it is important for developers and package maintainers, especially source-based ones..

    Anyway, I will try something after refreshing my memory on cmake.

  4. nwellnhof commented on Jul 22, 2025

    @nwellnhof
    Contributor

    These files are under version control and updated by cmark contributors. Downstream developers and package maintainers don't have to rebuild these files.

  5. robertocarlosllamashernandez5-code commented on Aug 28, 2025

    @robertocarlosllamashernandez5-code
  6. AndersonTorres commented on Sep 29, 2025

    @AndersonTorres
    Author

    Downstream developers and package maintainers don't have to rebuild these files.

    They don't have to, but some want to, and others may even need it.

    I do not know about how other distros deal with bootstrappability and Trusting Trust issues, especially given the XZ Incident.

    But specifically Guix is deadly serious about it - they strive to get rid of machine-generated inputs for their build scripts, from "earlier version of this compiler" bootstrap binaries to minified Javascript files.

  7. nwellnhof commented on Sep 29, 2025

    @nwellnhof
    Contributor

    I don't think CMake offers a clean way to update generated code in the source tree. I'd simply stick with our current Makefile rules.

  8. nwellnhof commented on Sep 11, 2026

    @nwellnhof
    Contributor

    I still don't understand what this issue is trying to solve and I'd suggest to close it.

  9. gemmaro commented on Sep 12, 2026

    @gemmaro

    For a future reference, this change for the cmark package definition of GNU Guix shows how to build in a bootstrappable way.


    I think the following two would be helpful for packaging in particular:

    1. a way to quickly remove generated files.
      • In the change, it is the snippet section.
    2. a way to automatically regenerate files when they are missing/removed, due to the first point.
      • In the change, it is the (add-before 'configure 'generate part.

    I tried to solve the second point and made #630.
    I understand this can be bypassed with some adjustments in package recipes, so this is for those who is in a similar situation :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions