-
Notifications
You must be signed in to change notification settings - Fork 10
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
[WIP] OSX support #377
base: main
Are you sure you want to change the base?
[WIP] OSX support #377
Conversation
72be6ff
to
e986cd4
Compare
Context: The `sklib` file format is a ranlib archive that contains possible object files from C extensions, as well as skip-specific metadata. It can thus be passed straight to the linker, or be used by `skc`. Part of the required metadata is information about the defined (skip) symbols in the sklib. In practice, we pack the source code of all files from the package into the sklib. So far, the skip source files were embedded as members of the ranlib archive, which works fine on Linux as the linker seems to ignore files that are not ELF objects, but causes issues on OSX, where the linker complains about non Mach-O files. In order to work around this, the idea is to pack the source files of the package along with the metadata inside the `lib.skmeta` member of the archive. This would still be an issue, but the next step is to embed the `lib.skmeta` into a dummy object file, leaving a clean ranlib archive that should please any linker.
The previous implementation had a bug: it would lose track of the "analyzed" status of files not within the current invocation's dependency graph, causing it to keep stale analysis around in some cases. The new implementation is hopefully easier to follow, and although it does a bunch of O(n^2) operations on lists of known packages, it shouldn't matter much in the near future (they are still identified by a `FIXME` comment for further attention).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this isn't specific to macOS right? It would be better to divide into 2 PRs I think.
modified_files = mutable Vector[]; | ||
deleted_files = mutable Vector[]; | ||
|
||
// FIXME: This is O(n^2). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the srcs arrays already sorted? A linear traversal of new_srcs seems unavoidable. So perhaps the best that can be done is to sort old_srcs and use a binary search instead of Array.find. Maybe it would be better to also sort new_srcs and then be able to narrow the binary search of old_srcs at each step.
That's correct. The aim of this branch is to get OSX support down the line, and I made it a PR for visibility. I'll split self-contained commits out into separate PRs. |
No description provided.