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
Rework build system v2 #71
Conversation
The initial reasoning for having auto library detection was that minimalist distros might benefit from it, but now as it turns out this might've actually harmed those distro users who are using non-gnu system. I think this should be a good lesson for us moving forward, while certain things might seem "smart" or "convenient" it actually does more harm by bringing unnecessary dependencies. |
I don't believe Since the entire rational behind auto-detection was that it might benefit minimalist distros, but in reality these non standard Makefile might end up harming these minimalist distros, I think we may just want to revert the auto-detection all together given the fact that it will make our build more portable and running |
Since we auto create the config.mk in the file version, I believe we can drop the
I don't want to special case any single package manager/distro, but the reason that this is helpful for KISS Linux, is that the packager generally provides the bare minimum build script/dependencies needed to build the package. So they either have to forcibly list libgif and friends as mandatory or not use them. Something like |
AFIAK Kiss packages are just shell/build scripts, so adding
If we can make it portable without using anything non-standard then, I'm okay with that. |
Yes it is trivial but requires everyone who wants a different set of depends to fork which is also trivial but extra, unneeded work for when I claim we know the correct behavior. It isn't that I want to choose between portability and convenience but think we can get both.
So we agree to just drop the "-". It is leftover from the draft where there was an optional configure script. Is there any other portability concerns. Should we also include EDIT: |
I couldn't find any info about |
Well I found mention that
So you are probably right. If we want to be as portable as possible on principle, then I don't object to removing the auto detection. Still think the we should build with minimal dependencies by default. |
Wait how would optional libs even work then. We need |
We don't. We can add
|
Since you don't oppose it any longer, I've pushed the change. There's now two more things we need to address,
Are they standard? It seems like |
wait, doesn't that mean that idef and include are present in bsd? |
Yes, as non standard extensions. The |
Hmm i would preffer to not give up on the auto detection tho, ah btw you can assign variables to the result of shell commands with the syntax: Edit: |
Taap, I see where you're coming from, and I honestly agree that user's should have to turn optional dependancies on manually. However consider this, if someone is coming over from One of our project goals is to not break backwards compatibility, I'm not sure if this case qualifies but it's still something we should consider more deeply. |
looking around include is actually POSIX, on the regard of dealing with libraries we could use pkg-config which is supported by all unix like OSes from mac to bsd and the syntax seems easy enough to use.
|
I don't believe
Can you link the source? |
I suspected the backwards compatibility argument would be made to an attempt to change the defaults which is why I went with auto-detection. But auto-detection was just a means to achieve the goal of not having to explicitly disable the growing list of optional dependencies. |
If We should change the output to something else, maybe |
Not POSIX and isn't available on all systems (but probably is on most). Not saying the program itself sucks, but suckless.com promotes a less sucky alternative to pkg-config. I went with using the compiler because we could guarantee it was there. But it really is the same end result either way assuming things are installed in a standard location |
Does this imply we are reverting to enabling all optional deps by default? |
so apparently |
Entirely depends on if |
Welp, that gets me back to an earlier point about |
@TAAPArthur does this work for you? I think the comments should take care of the confusion. Also I think you misunderstood the manpage, it's talking about options which used to be extensions but are now included in posix. Finally now the only remaining concern is |
Related: https://github.com/nsxiv/nsxiv/issues/70#issuecomment-922286267
|
Regardless number of commits we cannot take this as a personal pet project, we always have to have users in mind, a balance between what users want and need and hwta the developer wants is the space where a project thrives, projects with toxic devs out there are a dime the dozen. |
Was this statement made in response to something I said? Or was it just a general comment? |
in general really, i do think every decision that affects the codebase in any significant way a consideration should be made of how benefitial it is to the userbase not just for ourselves. |
Imo that should be avoided as it just fractures the build time configuration. If we do want to go for some
Can this be done inside the Makefile POSIX-ly ? If so then I'm on board. |
I don't understand what you mean by "fractures". It optionally allows users to use a config file. I don't see the problem with giving people extra options that can opt-in to. Feel like a similar argument can be made for Xresource and some cli args along with the same counterargument that they don't hurt people who don't care about them. Sticking I don't object to including more things than just libs. Users could add whatever they wanted into it as stated. We could create it with all the default args that are in the Makefile to better show what users can override I guess.
Wouldn't it be something like:
And this is just my personal opinion here, but with this, I don't think we'd need a make minimal. I'd be content with just dropping |
I was thinking more in terms of something like But if we allow a var to disable all deps, then I don't see much reason to also add |
By that logic shouldn't every config.mk not exist since the any var could also be exported? Exporting everything either risks polluting the user's env namespace and passing vars on the command line is more key strokes when building. Nothing fatal, but at least that's why I see benefit in this extra line. You just drop the settings in and don't have to keep thinking about them if you don't want to but are free to specify them every time too. Also helps if you want something inbetween all off or all on like if you want just the set that sxiv needed or something. It isn't specific to dependencies. You could also set What's the downside of adding the extra line? |
It's including a file that won't exist. Why not just go full suckless mode with a |
Including a file that may not exists. It is a harmless if it doesn't exist and has merit if it does. Also opens the downs for a more sane As for why this may be more convient than including a config.mk in the repo... same reason config.def.h is more convenient than having config.h directly in the repo. So people can just drop their own settings in. |
Potential confusion as this file doesn't exist nor will it be generated by anything. I guess we'll just have to deal with it via adding a comment. So are we just going with |
Still not fully sold on having Other than this, if there are no other objections then I'll proceed to squash everything and then rebase on top of master. |
You may avoid
Since |
That works nicely, thanks. I guess we're not doing any ghost includes in the Makefile then. |
Squashed, rebased and ready for review. If there's any remaining concerns, please raise them now. After this, the build system should not receive any major changes. We can't keep changing our build system and making life harder for package maintainers. |
This is a great solution. I completely forgot make checks other things besides |
* Remove non-POSIX extensions and commands * Drop autodetection in favor of OPT_DEP_DEFAULT * Use += for LDLIBS as some BSD distros need to add extra flags * Change DOCPREFIX -> EGPREFIX * Use ?= for MANPREFIX and EGPREFIX * Update docs With this, we should have a stable build system. No further significant changes should be needed.
As discussed in #66 (comment) , this PR takes care of any remaining cleanups on the makefile and cleans
version.h
uponmake clean
.Also revert back to using
mkdir -> cp -> chmod
sinceinstall
is not posix.We may want to reconsider reverting
ifeq
as well, see: xyb3rt/sxiv@5155d52