all: instrument library loading #1328

Merged
TristanCrawford merged 1 commit from main into main 2025-01-01 02:03:59 +00:00
TristanCrawford commented 2024-12-31 22:33:48 +00:00 (Migrated from github.com)

Potential fix for #1327

TL;DR This instruments the calls to DynLib.open to log exactly what libraries are missing and returns a consistent LibraryNotFound error.

image


As for the issue I was running into earlier: The open call in src/sysgpu/vulkan.zig was not catching and returning in the same manner as the other library loads, which is why I was getting that non-descript FileNotFound error.

One caveat is that some libraries that aren't really required will still log an error, but it's definitely better than the ambiguous errors from before imo.

There may be a better name and/or a better place to put the loadLibrary function, so I'm open to shifting some things around if y'all see fit. Cheers!


  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Potential fix for #1327 TL;DR This instruments the calls to `DynLib.open` to log exactly what libraries are missing and returns a consistent `LibraryNotFound` error. ![image](https://github.com/user-attachments/assets/726b0be1-4f6c-47a7-b62d-f57268dcb22b) --- As for the issue I was running into earlier: The open call in `src/sysgpu/vulkan.zig` was not catching and returning in the same manner as the other library loads, which is why I was getting that non-descript `FileNotFound` error. One caveat is that some libraries that aren't _really_ required will still log an error, but it's definitely better than the ambiguous errors from before imo. There may be a better name and/or a better place to put the `loadLibrary` function, so I'm open to shifting some things around if y'all see fit. Cheers! --- - [x] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
emidoots (Migrated from github.com) reviewed 2024-12-31 22:41:55 +00:00
emidoots (Migrated from github.com) commented 2024-12-31 22:41:55 +00:00

Can you move this here instead and call it dynLibOpen, so usages look like mach.dynLibOpen(...)?

Can you move this [here](https://github.com/hexops/mach/blob/main/src/main.zig#L37) instead and call it `dynLibOpen`, so usages look like `mach.dynLibOpen(...)`?
emidoots (Migrated from github.com) reviewed 2024-12-31 22:42:46 +00:00
emidoots (Migrated from github.com) commented 2024-12-31 22:42:46 +00:00

not sure what the \x00 is for?

not sure what the `\x00` is for?
emidoots commented 2024-12-31 22:43:12 +00:00 (Migrated from github.com)

Two small comments, looks good otherwise! Thanks for improving this!

Two small comments, looks good otherwise! Thanks for improving this!
TristanCrawford (Migrated from github.com) reviewed 2024-12-31 22:55:02 +00:00
TristanCrawford (Migrated from github.com) commented 2024-12-31 22:55:02 +00:00

Updated!

Updated!
TristanCrawford (Migrated from github.com) reviewed 2024-12-31 22:56:42 +00:00
TristanCrawford (Migrated from github.com) commented 2024-12-31 22:56:42 +00:00

Brain rot on my part. Fixed lol.

Brain rot on my part. Fixed lol.
emidoots (Migrated from github.com) approved these changes 2025-01-01 02:03:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!1328
No description provided.