ALT-F4-LLC / vorpal

Maintain your entire supply chain with one magical tool.
Apache License 2.0
69 stars 6 forks source link

Fix PackageTarget.from_str for linux systems #61

Open mcanueste opened 2 months ago

mcanueste commented 2 months ago

Starting the worker on linux systems (NixOS) makes the worker start with unknown target, which breaks the vorpal builds as well.

On linux, the get_default_system function here returns ARCH: x86_64, OS: linux -> 'x86_64-linux', which is then passed to the get_package_system function here.

The get_package_system function contains let target = system.to_lowercase().replace("_", "-"); line here, which converts x86_64-linux to x86-64-linux, which doesn't match any of the PackageTargets.

This PR removes the let target = system.to_lowercase().replace("_", "-"); line since it is not needed, fixing the issue. Also adds tests for the PackageTarget.from_str function on the scheme/src/lib.rs file.

P.S.: Sorry for the late PR :sweat_smile: