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

generator.py: Restore pre-building gir with build/progress output #1613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarijnS95
Copy link
Contributor

In commit c6ba79e ("generator.py: Use cargo run instead of guessing path") the cargo build command on the default (hardcoded) "gir" directory was replaced with a single cargo run for correctly finding the right executable.

This isn't an issue given that cargo run also builds the tool, and above all makes it easier / more correct to find the binary as the primary reason for that commit, but it does make us lose the build log as a progress indicator (thanks to --quiet and capturing stderr). In addition, it causes the first => Looking in path `xxx` item to take a very long time without aforementioned progres indication, making the user wonder what is going on.

By building gir again with a separate cargo build invocation before running, this issue is alleviated somewhat.

In commit c6ba79e ("generator.py: Use cargo run instead of guessing
path") the `cargo build` command on the default (hardcoded) `"gir"`
directory was replaced with a single `cargo run` for correctly finding
the right executable.

This isn't an issue given that `cargo run` also builds the tool, and
above all makes it easier / more correct to find the binary as the
primary reason for that commit, but it does make us lose the build log
as a progress indicator (thanks to `--quiet` and capturing `stderr`).
In addition, it causes the first `` => Looking in path `xxx` `` item
to take a very long time without aforementioned progres indication,
making the user wonder what is going on.

By building `gir` again with a separate `cargo build` invocation before
running, this issue is alleviated somewhat.
@sdroege
Copy link
Member

sdroege commented Nov 6, 2024

@sophie-h What do you think?

@@ -7,7 +7,7 @@
import asyncio

DEFAULT_GIR_FILES_DIRECTORY = Path("./gir-files")
DEFAULT_GIR_DIRECTORY = Path("./gir/")
DEFAULT_GIR_DIRECTORY = Path("./gir/") # TODO: This is typically the directory _of this Python script_ (which external projects symlink to)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The TODO here means: should we come up with a different way, instead of "guessing/hardcoding" this relative directory?

@MarijnS95
Copy link
Contributor Author

@sophie-h what are your thoughts on this?

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.

2 participants