Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

chore: ensure leading prefix of stack trace paths is stripped#5338

Merged
alecthomas merged 1 commit intomainfrom
aat/shorter-stack-traces
May 5, 2025
Merged

chore: ensure leading prefix of stack trace paths is stripped#5338
alecthomas merged 1 commit intomainfrom
aat/shorter-stack-traces

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

@alecthomas alecthomas commented May 5, 2025

The alecthomas/errors package attempts to reduce the size of paths by stripping the main package, but this requires that all Go binaries are built with "-trimpath". This has been added to the Hermit environment as a default compile flag.

Also added a test for ZipRelativeToCaller.

Before:

/Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:379: /Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:434: test harness failed to call verb mysql.insert: /Users/aat/dev/ftl/internal/deploymentcontext/module_context.go:360: /Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:450: /Users/aat/dev/ftl/go-runtime/server/server.go:153: /Users/aat/dev/ftl/common/reflection/verb.go:87: /Users/aat/dev/ftl/go-runtime/server/server.go:187: /Users/aat/dev/ftl/go-runtime/server/server.go:232: mysql.createRequest: /Users/aat/dev/ftl/internal/deploymentcontext/module_context.go:360: /Users/aat/dev/ftl/go-runtime/server/server.go:339: /Users/aat/dev/ftl/go-runtime/server/server.go:153: /Users/aat/dev/ftl/common/reflection/verb.go:87: /Users/aat/dev/ftl/go-runtime/server/query.go:116: /Users/aat/dev/ftl/go-runtime/server/query/client.go:100: /Users/aat/dev/ftl/go-runtime/server/query/client.go:136: failed to execute query: /Users/aat/dev/ftl/go-runtime/server/query/client.go:201: failed to execute query: /Users/aat/dev/ftl/backend/runner/query/service.go:119: /Users/aat/dev/ftl/backend/runner/query/service.go:146: not_found: database connection for testdb not found

After:

go-runtime/ftl/ftltest/ftltest.go:379: go-runtime/ftl/ftltest/ftltest.go:434: test harness failed to call verb mysql.insert: internal/deploymentcontext/module_context.go:360: go-runtime/ftl/ftltest/ftltest.go:450: go-runtime/server/server.go:153: common/reflection/verb.go:87: go-runtime/server/server.go:187: go-runtime/server/server.go:232: mysql.createRequest: internal/deploymentcontext/module_context.go:360: go-runtime/server/server.go:339: go-runtime/server/server.go:153: common/reflection/verb.go:87: go-runtime/server/query.go:116: go-runtime/server/query/client.go:100: go-runtime/server/query/client.go:136: failed to execute query: go-runtime/server/query/client.go:201: failed to execute query: backend/runner/query/service.go:119: backend/runner/query/service.go:146: not_found: database connection for testdb not found

@alecthomas alecthomas requested a review from a team as a code owner May 5, 2025 01:17
@alecthomas alecthomas requested review from wesbillman and removed request for a team May 5, 2025 01:17
@alecthomas alecthomas mentioned this pull request May 5, 2025
@alecthomas alecthomas force-pushed the aat/shorter-stack-traces branch from c7c16aa to ac216e2 Compare May 5, 2025 01:19
The alecthomas/errors package attempts to reduce the size of paths by stripping
the main package, but this requires that all Go binaries are built with
"-trimpath". This has been added to the Hermit environment as a default compile
flag.

Before:

> /Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:379: /Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:434: test harness failed to call verb mysql.insert: /Users/aat/dev/ftl/internal/deploymentcontext/module_context.go:360: /Users/aat/dev/ftl/go-runtime/ftl/ftltest/ftltest.go:450: /Users/aat/dev/ftl/go-runtime/server/server.go:153: /Users/aat/dev/ftl/common/reflection/verb.go:87: /Users/aat/dev/ftl/go-runtime/server/server.go:187: /Users/aat/dev/ftl/go-runtime/server/server.go:232: mysql.createRequest: /Users/aat/dev/ftl/internal/deploymentcontext/module_context.go:360: /Users/aat/dev/ftl/go-runtime/server/server.go:339: /Users/aat/dev/ftl/go-runtime/server/server.go:153: /Users/aat/dev/ftl/common/reflection/verb.go:87: /Users/aat/dev/ftl/go-runtime/server/query.go:116: /Users/aat/dev/ftl/go-runtime/server/query/client.go:100: /Users/aat/dev/ftl/go-runtime/server/query/client.go:136: failed to execute query: /Users/aat/dev/ftl/go-runtime/server/query/client.go:201: failed to execute query: /Users/aat/dev/ftl/backend/runner/query/service.go:119: /Users/aat/dev/ftl/backend/runner/query/service.go:146: not_found: database connection for testdb not found

After:

> go-runtime/ftl/ftltest/ftltest.go:379: go-runtime/ftl/ftltest/ftltest.go:434: test harness failed to call verb mysql.insert: internal/deploymentcontext/module_context.go:360: go-runtime/ftl/ftltest/ftltest.go:450: go-runtime/server/server.go:153: common/reflection/verb.go:87: go-runtime/server/server.go:187: go-runtime/server/server.go:232: mysql.createRequest: internal/deploymentcontext/module_context.go:360: go-runtime/server/server.go:339: go-runtime/server/server.go:153: common/reflection/verb.go:87: go-runtime/server/query.go:116: go-runtime/server/query/client.go:100: go-runtime/server/query/client.go:136: failed to execute query: go-runtime/server/query/client.go:201: failed to execute query: backend/runner/query/service.go:119: backend/runner/query/service.go:146: not_found: database connection for testdb not found
@alecthomas alecthomas force-pushed the aat/shorter-stack-traces branch from ac216e2 to 5dc58bf Compare May 5, 2025 01:21
@alecthomas alecthomas enabled auto-merge (squash) May 5, 2025 01:22
@alecthomas alecthomas disabled auto-merge May 5, 2025 01:22
@alecthomas alecthomas enabled auto-merge (squash) May 5, 2025 01:22
@alecthomas alecthomas merged commit d5c13a9 into main May 5, 2025
75 checks passed
@alecthomas alecthomas deleted the aat/shorter-stack-traces branch May 5, 2025 01:31
@wesbillman wesbillman added the approved Marks an already closed PR as approved label May 5, 2025
@wesbillman
Copy link
Copy Markdown
Collaborator

Nice! Much better :)

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

Labels

approved Marks an already closed PR as approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants