-
Notifications
You must be signed in to change notification settings - Fork 31
improve: reset libgo.h atime/mtime to use rust side cache #90
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for resetting the generated Go header’s access and modification times to speed up rebuilds, exposes a new multi_param_test binding on the Go side, bumps the crate version, and renames example binaries for clarity.
- Introduce
multi_param_teston the Go interface and itsCTestCallexport - Update
build.rsto read and restore header file timestamps around the Go build step - Bump
rust2goto v0.4.2, addfs-set-timesdependency, and rename example binary targets
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/go/gen.go | Add multi_param_test to TestCall and implement its CTestCall export function |
| rust2go/src/build.rs | Rename filename→lib_filename, add header_filename and read_header_file, and restore .h atime/mtime |
| rust2go/Cargo.toml | Bump version to 0.4.2, add optional fs-set-times dependency, include it in build feature |
| examples/*/Cargo.toml | Rename example binaries (e.g., example→example-tokio-cgo, etc.) |
Comments suppressed due to low confidence (4)
test/go/gen.go:153
- [nitpick] Variable name
_new_useris unconventional in Go—consider renaming touserValoruserArgto follow Go naming conventions and improve readability.
_new_user := newUser(user)
rust2go/src/build.rs:357
LIB_EXTis not defined or imported here, leading to a compilation error. Define or import the correct constant (e.g.,".a") or replace with the appropriate static-library suffix.
LinkType::Static => format!("{DLL_PREFIX}go{LIB_EXT}"),
test/go/gen.go:151
- No tests are added to cover the new
multi_param_testexport path—consider adding a Go-side or integration test to ensure this path is exercised and prevent regressions.
//export CTestCall_multi_param_test
rust2go/src/build.rs:370
- [nitpick] Helper
read_header_filewould benefit from a doc comment explaining its return tuple (header bytes and optional access/modify times) to improve maintainability.
fn read_header_file(
|
@zhongxinghong Could you have a look at if this branch work? Thank you |
lirenjie95
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Hi~ I've tested the rust2go regen the fn main() {
rust2go::Builder::new()
.with_go_src("../wrapper")
.with_regen_arg(RegenArgs {
src: "./src/idl.rs".into(),
dst: "../wrapper/gen.go".into(),
go118: true,
..Default::default()
})
.build();
}My solution on the issue is to reset the times of |
Fixes #83