-
-
Notifications
You must be signed in to change notification settings - Fork 125
Added nostrip to CONFIG to avoid illegal binary strips on WSL #1071
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
Conversation
9536256
to
b9a9a48
Compare
I don't think we want to just remove it everywhere. The best solution would be to do this only for WSL. The second best would be to do that via qmake/makefile option and document the case properly. |
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.
@sgourdas Have you found a way to detect WSL properly?
@sgourdas Thx, I will give a try and verify if it works fine for Linux at least. |
a19f6b3
to
299f9fd
Compare
@sgourdas This piece of code deserves a small code comment explaining the situation/solution |
@kelson42 is this fine? |
kiwix-desktop.pro
Outdated
#Determine if the host system is WSL based on the existence of "/proc/sys/fs/binfmt_misc/WSLInterop" | ||
WSL_CHECK = $$system(test -f /proc/sys/fs/binfmt_misc/WSLInterop && echo true || echo false) | ||
equals(WSL_CHECK, "true"): CONFIG += nostrip | ||
|
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.
This comment is not so useful. We already see that we are checking existence of /proc/sys/fs/binfmt_misc/WSLInterop
in the code. With a small variable renaming we can easily give the hint about what we are checking.
If we add comment, it should be why we do this, not what or how we are doing it.
I suggest:
# install script fails to detect if file is a binary or not on wsl and then try to strip all
# installed files, which obviously not work for all files. So don't strip on WSL.
ARE_WE_IN_WSL = $$system(test -f /proc/sys/fs/binfmt_misc/WSLInterop && echo true || echo false)
equals(ARE_WE_IN_WSL, "true"): CONFIG += nostrip
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.
Totally agree.
Should we make it smaller, with something like:
# Avoid stripping incompatible files, due to false identification as executables, on WSL
DETECT_WSL = $$system(test -f /proc/sys/fs/binfmt_misc/WSLInterop && echo true || echo false)
equals(DETECT_WSL , "true"): CONFIG += nostrip
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.
LGTM, please do and squash everything in one commit so we can merge.
26696b1
to
fe22b94
Compare
fe22b94
to
54a3f25
Compare
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.
LGTM
Fixes #1059
Added the
nostrip
flag toCONFIG
in thekiwix-desktop.pro
in case of WSL