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

Translate paths in compilepkg output. #5

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

mari-crl
Copy link

@mari-crl mari-crl commented Apr 4, 2022

When cgo2 is involved in a build, the go srcs are linked/copied
into a temporary directory to keep everything in the same
directory. Those paths are unrecognizable to IDEs, being absolute
paths outside the project directory.

This adds a translation step to replace paths in the compiler output,
translating them back to the input paths that were given to the tool
in the first place.

This doesn't affect -trimpath, which affects runtime error messages
but not compilation-time error messages; for the same reason, this
change can't use that flag to do its dirty work.

Fixes cockroachdb/cockroach#76377.

Release note: None

Copy link

@rickystewart rickystewart left a comment

Choose a reason for hiding this comment

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

This looks fine but I'm interested in why tweaking the -trimpath argument in the compiler invocation is not what we're doing, primarily because that would be less code. Does that not work for some reason?

@mari-crl
Copy link
Author

mari-crl commented Apr 7, 2022 via email

When cgo2 is involved in a build, the go srcs are linked/copied
into a temporary directory to keep everything in the same
directory. Those paths are unrecognizable to IDEs, being absolute
paths outside the project directory.

This adds a translation step to replace paths in the compiler output,
translating them back to the input paths that were given to the tool
in the first place.

This doesn't affect -trimpath, which affects runtime error messages
but not compilation-time error messages; for the same reason, this
change can't use that flag to do its dirty work.

Fixes cockroachdb/cockroach#76377.

Release note: None
@mari-crl
Copy link
Author

mari-crl commented Apr 7, 2022

Okay, updated comments (pull request, commit, and the one from the issue itself). Merging now!

@mari-crl mari-crl merged commit 58cb947 into cockroachdb:master Apr 7, 2022
mari-crl added a commit to mari-crl/cockroach that referenced this pull request Apr 8, 2022
The rules_go version has been bumped to accept the new changes from
cockroachdb/rules_go#5.

Release note: None
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Apr 8, 2022
79245: ci: build and publish cockroach-sql r=rickystewart a=rail

This patch adds `cockroach-sql` as a separate artifact published to S3.
The binary is not stripped (TBD).

Fixes #75800

Release note: None

79651: test: fix bazel sqllite invocation r=cucaroach a=cucaroach

Release note: None

79661: WORKSPACE: update rules_go version r=mari-crl a=mari-crl

The rules_go version has been bumped to accept the new changes from
cockroachdb/rules_go#5.

Finishing blow for #76377.

Release note: None

Co-authored-by: Rail Aliiev <[email protected]>
Co-authored-by: Tommy Reilly <[email protected]>
Co-authored-by: Mari Staib <[email protected]>
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.

bazel: compiler errors report a file path inside the sandbox, gets code editor confused
2 participants