Skip to content

Update kmir run to behave more like cargo run #524

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

Merged
merged 12 commits into from
Apr 14, 2025

Conversation

gtrepta
Copy link
Contributor

@gtrepta gtrepta commented Apr 10, 2025

  • Introduce CargoProject class which can be used to gather information about a cargo project.
  • kmir run now uses CargoProject which finds the .smir.json artifact in the target directory after invoking cargo build.

Note that currently either RUSTC will need to be set to the stable-mir-json install, or the smir json files should already have been built that way and exist in the target directory. Later, we can get rid of this requirement when we package stable-mir-json with kmir.

@gtrepta gtrepta marked this pull request as ready for review April 10, 2025 01:17
@gtrepta gtrepta requested review from dkcumming and jberthold April 10, 2025 01:17
Copy link
Collaborator

@dkcumming dkcumming left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 86 to 87
target = opts.bin if opts.bin else cargo.default_target
smir_file = cargo.smir_for(target)
Copy link
Member

Choose a reason for hiding this comment

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

This is where the --file option would be implemented: if given, smir_file is taken from there instead of asking cargo`.

@gtrepta gtrepta requested a review from jberthold April 11, 2025 23:37
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

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

LGTM

@automergerpr-permission-manager automergerpr-permission-manager bot merged commit 2e6c1b8 into master Apr 14, 2025
6 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the guy/rust-frontend branch April 14, 2025 18:29
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.

4 participants