MSYS2-packages
MSYS2-packages copied to clipboard
makepkg/makepkg-mingw should always check that base-devel is an implicit build dependency of every package
Description / Steps to reproduce the issue
When running makepkg/makepkg-mingw
to build a package, that tool should always check whether base-devel
is installed as an implicit dependency of every package to avoid some unexpected issues. For example when building lua
one would install mingw-w64-ucrt-x86_64-cc
and make
and run makepkg-mingw
. Then, the following error occurs.
patch: command not found
This also happens to a lot of other packages such as nodejs
. For packages that don't even depend on a C compiler, when running makepkg/makepkg-mingw
there is a chance to get the following error.
==> ERROR: Cannot find the strip binary required for object file stripping.
This occurs when the strip
command isn't found. The strip command is found in the binutils
and llvm
packages. Every C compiler already depends on a package containing strip
, so this error disappears when installing a C compiler.
This all happens, when the base-devel
package isn't installed. The msys2 documentation points out to install this package when building packages with makepkg/makepkg-mingw
. But the bad thing is that this package isn't required and that it mostly kind of works without it. This unexpectedly leads to these above mentioned errors that are very confusing. Not everyone reads all the msys2 documentation to build some packages, so the base-devel
part of the documentation can easily be overlooked. This is especially true for some msys2 user who rebuilds certain packages to find some bugs. I think that base-devel
should always be installed when running makepkg/makepkg-mingw
so it's clear that every package has base-devel
as its build dependency. It's similar to how every package depends implicitly on base
. Also it would be nice that when base-devel
isn't installed makepkg/makepkg-mingw
would provide a different error message than Missing dependencies
, so its clear what bese-devel
is. It's a meta package required to build packages.
Additionally, the base-devel
package has 6 redundant dependencies that are now in base
.
Those are:
file
gawk
grep
pacman
sed
tar
I suggest to remove those from base-devel
, so it's easier to see what additional packages base-devel
provides over base
.
Expected behavior
Each package implicitly depends on base-devel
on building. makepkg/makepkg-mingw
checks whether base-devel
is installed and refuses to build a package if it isn't.
base-devel
has its redundant dependencies that are now in base
removed.
Actual behavior
Each package doesn't implicitly depend on base-devel
, but it's assumed to be. Therefore, having sometimes weird error messages such as patch: command not found
or ==> ERROR: Cannot find the strip binary required for object file stripping.
if base-devel
isn't installed while running makepkg/makepkg-mingw
.
Verification
- [X] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)
Windows Version
MINGW64_NT-10.0-22621
Are you willing to submit a PR?
No response
Thanks for the detailed write up. We just follow what Arch Linux does here, but I agree that it could be improved.
I checked out arch linux website and it turns out arch does have a base-devel
package. So I guess this issue applies to arch as well. But I don't know, because I don't use arch linux.
So I guess this issue applies to arch as well. But I don't know, because I don't use arch linux.
Because, it is assumed that the person already knows base-devel is required.
Why assume if it can be enforced? With the assumption that people who build packages know base-devel
is required, it's obvious that that assumption is not guaranteed. There is a logic with the dependency. If makepkg
requires base-devel
to be installed to build packages, then that concludes that every package implicitly depends on base-devel
. That needs to be checked. Otherwise it cannot be said that this is true. It's better with the base
package. base
is always installed after the initial setup. There is a guarantee there. It can be said that every package implicitly depends on base
.
@MehdiChinoune I don't think you understand what I'm saying. If base-devel
is required by makepkg
then makepkg
must check if base-devel
is installed to ensure the basic build tools are available. Simple as that. Also, RTFM is not a substitution for tools that don't properly work.
@MehdiChinoune As I said, RTFM is not a substitution for tools that don't properly work. You don't even try to understand the issue.