Giter VIP home page Giter VIP logo

Comments (3)

straight-shoota avatar straight-shoota commented on July 18, 2024

The bug is caused here:

shards/src/cli.cr

Lines 132 to 142 in 85b30b5

def self.parse_args(args)
targets = [] of String
options = [] of String
args.each do |arg|
if arg.starts_with?('-')
options << arg
else
targets << arg
end
end

All arguments that don't start with a dash are considered a target.

A simple workaround is to write flag and value as a single argument: --mcpu neoverse-n1. Or just use crystal build directly.

Related: crystal-lang/crystal#11136

from shards.

straight-shoota avatar straight-shoota commented on July 18, 2024

For a proper fix, I think it doesn't make sense to expect targets at arbitrary positions. Everything after the first flag argument (starting with dash) should simply be forwarded to crystal build.
There could also be a -- to separate targets from forwarding options.
Example: shards build mytarget othertarget -- --mcpu neoverse-n1. This should definitely be allowed, maybe even required.

from shards.

ziggythehamster avatar ziggythehamster commented on July 18, 2024

A simple workaround is to write flag and value as a single argument: --mcpu neoverse-n1

Did you mean --mcpu=neoverse-n1?

Example: shards build mytarget othertarget -- --mcpu neoverse-n1

I agree that this is how it should behave, because shards build --production target1 target2 -- --release --no-debug --some-other-args-which-shards-doesnt-care-about has a logical behavior that other CLI commands (e.g., git) follow. The "flags are forwarded to crystal build and don't show up in help" thing is a bit surprising, whereas stating that anything after -- is passed directly to crystal build isn't.

It also allows for Crystal to change without Shards having to. e.g., if Crystal added a --split-debug filename option so that debugging symbols can be generated as a separate file for dropping into /usr/lib/debug or whatever the OS prefers, then Shards doesn't have to know that.

from shards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.