-
Notifications
You must be signed in to change notification settings - Fork 426
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
Fix runfiles test: Macos runfiles are quite different #66
Fix runfiles test: Macos runfiles are quite different #66
Conversation
Adding mhlopko@ to see if there might be more context behind this discrepancy in the behavior of runfiles. |
In any case, maybe it's better to keep the rule modifications without the example, if the actual location of runfiles is ill-defined. |
Apparently "data" was not a quirk of macos, but rather the directory that the data file was in originally. I've moved that part of the pathbuilding accordingly. I'm starting to suspect that the discrepancy isn't in how the runfiles dir is structure, but rather where "current_exe" points to.
Whoops, you're right. Updated description and fixed accordingly. I don't have a strong opinion either way regarding the test but I do want to know why runfiles isn't consistent. |
Sorry for radio silence. Had hard time to find free evenings lately. In general I don't think you should hardcode runfiles location in your source code. Paths change depending on the platform (I'm not sure why there is a difference between mac and linux, I can find out if anybody cares :) but e.g. on windows we don't use symlinks at all and instead we provide runfiles.manifest that binary should read and use to find absolute paths. @laszlocsomor did a ton of work on runfiles lately and provided libraries that your code can use to compute absolute runfile path in a reliable way. I'll try to find the documentation. |
FTR: Source here: We would want to add a zero-dependency rust library there that does something analogous to cpp. |
FYI, state of runfiles libraries:
|
Apparently runfiles under macos have an important difference from Unix (and I presume, windows): I believe they live directly in the working directory, not "$target_name.runfiles"
This is a sloppy fix that changes the mechanics of the test according to the target os.
Notice: @mfarrugi
EDIT: Fix silly mistake regarding runfiles explanation: "data" is the data file itself.