yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.25k stars 121 forks source link

Cannot install IBLinter with latest Mint #255

Closed vincentisambart closed 1 year ago

vincentisambart commented 1 year ago

With previous versions of Mint, installing IBLinter was working fine, but with the latest Mint the installation fails.

$ mint install --force IBDecodable/IBLinter
🌱 Finding latest version of IBLinter
🌱 Cloning IBLinter 0.5.0
🌱 Resolving package
🌱 Building package
🌱  Couldn't find executable "iblinter"

It ends in error but afterwards IBLinter is considered "installed":

$ mint install IBDecodable/IBLinter      
🌱 IBLinter 0.5.0 already installed

Even though it is not:

$ mint run IBDecodable/IBLinter iblinter
🌱  Executable product not found in IBLinter 0.5.0

Looking at the Mint target directory, there is just an empty build directory.

Looking at IBLinter's Package.swift, it has 2 executables: iblinter and iblinter-tools, but if you run mint install with the -v option, it seems only iblinter-tools gets built.

Looking at recent Mint changes, it seems the problem is in #251: IBLinter now gets built with swift build -v -c release --product iblinter --product iblinter-tools, but trying running this command by hand on the IBLinter repo, it does not build both iblinter and iblinter-tools, only the last one specified on the command line (swift build -v -c release --product iblinter --product iblinter-tools only builds iblinter-tools, swift build -v -c release --product iblinter-tools --product iblinter only builds iblinter).

Unfortunately, looking at Swift Package Manager's source code, swift build doesn't seem to have a way to specify multiple targets to build at one (you either build all targets with or without tests, or just one product/target), so if you want to keep the behavior change from #251, you probably need to run swift build once per executable target.

yonaskolb commented 1 year ago

Fixed in 0.17.5