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

Nix/Darwin NativePaths: Nix ignore -F flags and .tbl files #19880

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SkamDart
Copy link

@SkamDart SkamDart commented May 7, 2024

Suggested fix for #19879

@@ -33,6 +33,10 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths {
break;
};
try self.addFrameworkDir(framework_path);
} else if (mem.startsWith(u8, word, "-F")) {
// Ignore this argument.
// Nix provides the same framework path through -iframework
Copy link
Member

Choose a reason for hiding this comment

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

There is no harm in including duplicated paths, and it's strictly safer than outright ignoring -F arg. What if suddenly the sets are disjoint between everything passed via -iframework and -F?

Copy link
Author

Choose a reason for hiding this comment

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

Valid point. I updated the PR to include that path instead of ignore it

@@ -67,6 +71,8 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths {
try self.addRPath(lib_path);
} else if (mem.startsWith(u8, word, "-l")) {
// Ignore this argument.
} else if (mem.endsWith(u8, word, ".tbd")) {
// Ignore this argument.
Copy link
Member

Choose a reason for hiding this comment

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

This should not be ignored, and actually handled in the linker. tbd is a textualised format for a dylib on macOS and skipping those may result in unexpected link failures.

@SkamDart SkamDart force-pushed the skamdart/nix-darwin-ignore-flags branch from 8ca42c7 to 9c6d2fb Compare May 13, 2024 21:33
@SkamDart SkamDart force-pushed the skamdart/nix-darwin-ignore-flags branch from 9c6d2fb to e27972b Compare May 13, 2024 21:36
@SkamDart
Copy link
Author

@kubkon - Thanks for the review. I addressed your comments and rebased.

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.

None yet

2 participants