-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Make AppImageTool OSX friendlier #466
Make AppImageTool OSX friendlier #466
Conversation
653a8e3
to
dfa45a6
Compare
Please remove LGPL |
The entire I'll post a more detailed review when I get to it. |
About osx_elf : done. I am not sure if this changes anything license wise though. About tabs, I hate tabs too, but this is how the original source and patch is. I'd prefer not to change anything on a code that is outside the scope of this codebase. |
I created also a patch to support gpg & shashum, which are almost the same with their equivalent gpg2 and sha256sum. My only question is how to display the name to the user. I preferred the gpg[2] and sha[256]sum, which is more condensed. Ideas welcome. |
1b9f560
to
6df5fc0
Compare
2698d10
to
2416bce
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.
I see a lot of potential for improvements in this PR. You tried to follow the overall code style at least in the files which were existing already, but the new file breaks with the existing style.
At some point I stopped analyzing the PR, as the review got quite long. Many of the mentioned points are valid for other sections as well, e.g., my words about the architecture code.
I'd ask you to fix some of the issues, or to start a discussion. After fixing these points, I'd review the PR again.
appimagetool.c
Outdated
#define fARCH_i386 0 | ||
#define fARCH_x86_64 1 | ||
#define fARCH_arm 2 | ||
#define fARCH_aarch64 3 |
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 should be an enum
. Even if it stayed a set of defines, the alignment of numbers should be fixed.
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.
Correct.
appimagetool.c
Outdated
|
||
if ((sp = strstr(line, search))) { | ||
replacestr(line, search, replace); | ||
char* readFile(char* filename, int* size) { |
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.
As said before, I don't like this function's signature. It should be changed to void
. Or, while I think about it, a bool
would be a lot better, that returns false
in case of errors.
appimagetool.c
Outdated
// sprintf (guessed_bin_path, "%s/usr/bin/%s", source, g_strsplit_set(get_desktop_entry(kf, "Exec"), " ", -1)[0]); | ||
// archfile = guessed_bin_path; | ||
archfile = "/proc/self/exe"; | ||
char archs[4]; |
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.
Why is this a char
array?
appimagetool.c
Outdated
{ | ||
printf("The architecture could not be determined, assuming 'all'\n"); | ||
arch="all"; | ||
if (archs[fARCH_x86_64]) { |
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.
I'm not very fond of this mix of representation and actual data gathering. I'd rather have used a little for loop to count the architectures, and then render the output. Also, you're overwriting the arch
variable even when there's multiple architectures. I'd rather have rendered the actually found architectures into the error message, and then created the arch
variable afterwards.
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.
Done
appimagetool.c
Outdated
char* data; | ||
if (runtime_file) { | ||
data = readFile(runtime_file, &size); | ||
if (!data) |
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.
As said above, I don't like the API of this function, and therefore don't like this kind of error handling. Comparing a pointer here can be really problematic, and is not really straightforward. If any, you need to do both, check for the pointer and check for a return value from a bool
ean function.
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.
Added a null check, as you asked
getsection.c
Outdated
@@ -1,4 +1,9 @@ | |||
#include <elf.h> | |||
#ifdef __APPLE__ | |||
#include "osx_elf.h" |
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.
See comment for elf.c
.
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.
Again, I didn't understand that
osx_elf.h
Outdated
@@ -0,0 +1,103 @@ | |||
/* This is a derivative work of the elf.h file from the GNU C Library */ |
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 line suggests that the file is licensed under the LGPL. This license is incompatible with the rest of the project. This is a major problem, and thus the PR cannot be merged.
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.
Correct, I'll copy the symbols from https://github.com/torvalds/linux/blob/master/include/uapi/linux/elf.h
is that better?
osx_elf.h
Outdated
/* This is a derivative work of the elf.h file from the GNU C Library */ | ||
|
||
#ifndef _ELF_H | ||
#define _ELF_H 1 |
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 tab needs to be removed.
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.
it were on the original file - now the whole file is properly indented.
osx_elf.h
Outdated
|
||
typedef struct | ||
{ | ||
unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ |
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.
Tabs for indentation are not used by the rest of the project. You will have to change the indentation of the entire file.
@@ -0,0 +1,434 @@ | |||
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c |
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.
You are right, the tabs in this file are totally justified by the fact that the upstream project uses them.
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.
:)
f68f1f5
to
4b0cb26
Compare
The changes have been applied... please have a look |
|
||
__END_DECLS | ||
|
||
#endif /* elf.h */ |
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 file is still licensed as GNU GPL. This license is not compatible with the rest of the code base. This is a really big problem, and we cannot risk a GPL violation by relicensing the extracted code. You will have to write it yourself, I guess, and change the variable and macro names etc. The file doesn't have to be compatible to any other code any more, especially since this is going to be used on both Linux and OS X.
0eee828
to
8db00f0
Compare
8db00f0
to
c7fe818
Compare
I have the feeling that #471 is mutually exclusive with this, patch, since it references the exact same location with memory management, while this patch also takes into account external binary files. My humble opinion is, if possible, to fix possible issues with this patch, apply it if you want and then take care of #471, who is indeed dependent on this tool being multi-platform first. Otherwise external files patch will not apply and maybe it will fail on other locations too. EDIT: I just saw that you have already applied the patches I was afraid of, thus this patch does not apply clean any more... |
#471 is not applied yet, since it doesn't build "green" yet... |
Thank you, great work @teras and throrough reviews @TheAssassin. It builds "green" now, and I'd really like to get this merged soon. But that will require all GPL code to be replaced by something that we can license under the MIT license. This is important for adoption of AppImage by some of our business users (yes, Microsoft and IBM are already using AppImage, too, and we don't want to scare them away.) |
@probonopd we had a discussion about that with @TheAssassin and we concluded that what the last thing I did was the best thing to do. Please if possible discuss with him about this. |
@teras, @probonopd, I should get to merging everything manually soon. I'll fix the remaining issues, merge #470 and #471, and then everything should work fine. @probonopd we will now have to provide runtimes for embedding built by Travis I guess. I'll implement that, too. |
Thank you @teras @TheAssassin |
Sorry for the delay. I'm going to review and most likely merge this tonight. |
Not sure what's going on in the |
As mentioned in #433, the builds are failing due to issues with SourceForge. We'll have to wait for this to get fixed. It also shows how fragile our build system is. We should mirror those tarballs. |
Looks like the checks are passing now. Ready to merge @TheAssassin? |
I have been working on the legal implications of the GPL code included in this repository. I have come up with the following explanation. The file is and will remain GPLv2. The copyright notice must stay, and should not be modified (although the file may be modified, but when it is modified will also remain GPLv2). Especially the year and author name are important information. The file only contains definitions of data types and other values. According to Richard Stallman [1], when using this file to create a program, it will not create a derivative work and therefore, appimagetool is not subject to the GPLv2. This is important to know, as this is what @probonopd warned about. I wanted to revise and explicitly state the situation again. (I know that @teras and I knew this already, based on [2].) So, shipping this GPLv2 file along with the MIT licensed code is okay. I will have to verify whether @teras made changes to the file, as then, we should update the copyright notice in the header file before merging. Sorry for the additional delay. [1] http://lkml.iu.edu/hypermail/linux/kernel/0301.1/0362.html |
@teras did make changes, and stated this implicitly. I've fixed this. As @probonopd forces Travis to run successfully before being able to merge, we'll have to wait before finally merging this PR (although this is not really necessary). |
Thank you very much @teras for your great work! I hope users will be able to make use of it. |
Hello all and thanks for accepting the patch!
The only thing I did with elf include file was to remove all not-required
content (as suggested) and keep only the dependencies.
BTW, if the embedded method catches on, this method could be eliminated
altogether I think.
…On Sat, Sep 30, 2017 at 2:41 PM, TheAssassin ***@***.***> wrote:
Thank you very much @teras <https://github.com/teras> for your great
work! I hope users will be able to make use of it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#466 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkKuGcLK_DbOfUVj2U6Kq3eoCIidZk4ks5snikCgaJpZM4PLAm9>
.
--
Panayotis Katsaloulis
|
@teras To build appimagetool (
right? |
To be able to use appimagetool on macOS, I need runtime, but no runtime files in the https://github.com/AppImage/AppImageKit/releases/tag/continuous (I can build it on Linux, of course, but it will be better if it will be provided to ensure that it is compiled on correct OS and so on). |
You are absolutely right, and I found so elsewhere, too. Would you like to create an issue or even a PR to build runtimes for download on Travis? |
Yes, I had to install a couple of things from vanilla brew, no issues or special treatment there. I can remove brew from my system and see what's missing. Of course, it would make more sense (and in accordance with the current procedure) to have a test environment that would download the packages on the fly and try them. This will save time, if a brew dependency package changes and breaks some things (instead of checking the procedure once - now). As a parallel feature, why not consider creating a brew especially for appimagekit? |
You can always do this, but I guess the AppImage team wouldn't officially support it. Also, I'd suggest to discuss this in a separate issue. |
No description provided.