-
Notifications
You must be signed in to change notification settings - Fork 52
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
Document the minimum version for dependencies #307
Comments
Aside from version, we might also have to document the specific features of the library as well. For example imlib2 allows for disabling text, filters and even X - but scrot requires them. Gentoo deals with this via USE flags for example. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@guijan Sorry for dodging the question earlier (it's a complex question and I didn't have a short answer) - I'll try to answer this here (since it's somewhat related to this issue).
In a vacuum supporting a large number of platforms sounds good, but it also has (sometimes non-trivial amount of) cost associated with it. For e.g I've seen some codebases with as many So in short, instead of trying to support specific implementation/platforms, we should support a specific baseline standard instead. More or less what this means is:
Special exceptions can always be made for platform support (e.g if multiple platform lack a standard function).
You perhaps already know this, but I'll point it out just in case: just because something built successfully doesn't mean it'll work as intended. For example, it's not uncommon to have stub functions that always return So just because we can build scort in a CI doesn't mean we can claim support for that platform. (Note that this is not discouraging adding more niche platforms to our CI - that'd be nice. But we should be careful about claiming actual support since that means more than just "it compiles".) |
It's really not bad at all if you do it like this: https://www.openbsd.org/papers/portability.pdf Portability code should be hidden away in some compatibility layer. The entire program, save for a compat/ directory, has little to no The problem with sticking to a standard is that the program will run into platforms that have incomplete or broken implementations and avoid the interface on all platforms, or the program will refrain from using a good vendor function and opt for the bad standard function. Instead of elevating the bad platforms to the program's good practices, the program lowers itself to the worst of every platform, on all platforms. I'd really love to save some filesize on NetBSD by using its |
Just a quick reply to one of the points above (I'll read the pdf and reply to the rest later):
Removing the $ git diff src/util.h
diff --git a/src/util.h b/src/util.h
index 6cc7c78..eec771d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -60,9 +60,9 @@ typedef struct {
size_t off, cap;
} Stream;
-char *estrdup(const char *);
-void *ecalloc(size_t, size_t);
-void *erealloc(void *, size_t);
+#define estrdup strdup
+#define ecalloc calloc
+#define erealloc realloc
void streamReserve(Stream *, size_t);
void streamChar(Stream *, char);
$ gcc -o scrot-extern src/*.c $(pkg-config --cflags --libs ./scrot-deps.pc) -Oz -flto -march=native
$ git restore .
$ gcc -o scrot-intern src/*.c $(pkg-config --cflags --libs ./scrot-deps.pc) -Oz -flto -march=native
$ wc -c scrot-*
49912 scrot-extern
49944 scrot-intern Even on IMO, this is not even worth thinking about - let alone an |
Edit: I was thinking about the wrong thing, I rewrote this comment. Makes sense, the |
text is required due to --note filters is required due to --script ref: #307
this avoids misleading people due to the issues described in resurrecting-open-source-projects#315. and packagers can already check the output of the configure script or config.log to see if libbsd was checked for or not. additionally, document which bsd extension we require in the README so that maintainers can make more informed decision (e.g using more lightweight `sys/queue.h` in musl instead of heavyweight libbsd). ref: resurrecting-open-source-projects#307 Fixes: resurrecting-open-source-projects#315
this avoids misleading people due to the issues described in resurrecting-open-source-projects#315. and packagers can already check the output of the configure script or config.log to see if libbsd was checked for or not. additionally, document which bsd extension we require in the README so that maintainers can make more informed decision (e.g using more lightweight `sys/queue.h` in musl instead of heavyweight libbsd). ref: resurrecting-open-source-projects#307 Fixes: resurrecting-open-source-projects#315
this avoids misleading people due to the issues described in #315. and packagers can already check the output of the configure script or config.log to see if libbsd was checked for or not. additionally, document which bsd extension we require in the README so that maintainers can make more informed decision (e.g using more lightweight `sys/queue.h` in musl instead of heavyweight libbsd). ref: #307 Fixes: #315
I was testing out lowest known imlib2 version for It seems that the lowest confirmed imlib2 version Going by the git history of XComposite, Whether XFixes uses semantic versioning is not clear. But in any case, there was a CVE fix in 5.0.1 related to XFixesGetCursorImage() (which is the only function from XFixes scrot uses). And it doesn't seem like version 6.0.0 broke anything regarding XFixesGetCursorImage() so go ahead and settle on Xinerama v1.1.3 was released 10 years ago and seems to contain a CVE fix. So let's go for that. |
Scrot currently has a bunch of library dependencies. But there's no indication of what's the minimum version we require. I highly doubt we'll be able to build and work fine on any versions of those libraries.
As such, we should try to figure out what our the minimum version requirement really is (or use a version that's reasonably high but not too bleeding-edge) and document them accordingly.
Lowest known/likely working versions of scrot's dependencies:
build dependencies:
The text was updated successfully, but these errors were encountered: