Skip to content

Conversation

@yuluo-yx
Copy link
Contributor

@yuluo-yx yuluo-yx requested a review from a team as a code owner November 15, 2025 14:08
@github-actions github-actions bot added the scope:feat A new feature being added label Nov 15, 2025
@kakkoyun kakkoyun requested a review from y1yang0 November 18, 2025 13:08
}

// TestInstrumentWithHooks tests FuncRules and StructRules instrumentation
func TestInstrumentWithHooks(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please clarify the rationale for splitting this into two tests? I was thinking we could handle the entire process—injection, compilation, linking, and result verification—within a single test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@y1yang0
Copy link
Contributor

y1yang0 commented Nov 20, 2025

Thank you for your contribution. I'm sorry, but let's put this patch on hold for the time being.

The workflow I was expecting is: compile test.a + compile hook.a => link test.a hook.a => a.out => exec a.out.

This is different from the current approach of using go build . to build the program and capture its output. That process is essentially an integration test, which we already have covered.

Perhaps there's a fundamental issue with this requirement itself. The linking step (link test.a hook.a) cannot proceed without runtime.a. However, we are finding it difficult to get ahold of runtime.a in a reliable way. Since Go 1.20, modules cause runtime.a to be placed in the build cache (the go-build directory, i.e., GOCACHE) instead of the old $GOPATH/pkg location. This change further complicates the task.

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

Labels

scope:feat A new feature being added

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link the instrumented binary and run it and further check output content in instrument_test.go

3 participants