Skip to content
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

stack build --skip doesn't skip anything #3827

Open
dpwiz opened this issue Jan 30, 2018 · 7 comments
Open

stack build --skip doesn't skip anything #3827

dpwiz opened this issue Jan 30, 2018 · 7 comments

Comments

@dpwiz
Copy link

dpwiz commented Jan 30, 2018

--skip ARG Skip given component, can be specified multiple times

Steps to reproduce

mkdir stackholder
cd stackholder
stack new this
stack new that
rm {this,that}/stack.yaml
stack init
stack build --skip this
stack build --test --skip this

Expected

Package this does not gets built and its tests are skipped.

Actual

Package this is building and then its tests are running.

Stack version

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@mgsloan
Copy link
Contributor

mgsloan commented Jan 30, 2018

Hmm, indeed, this appears to be a bug. Original implementation is https://github.com/commercialhaskell/stack/pull/3148/files#diff-d43656b6dccca5b1708eaf03ea8bd1daR187

Looks like everything but libraries can be filtered with --skip currently.

@mgsloan mgsloan added this to the P1: Must milestone Jan 30, 2018
@vanceism7
Copy link
Contributor

I can do this one

@dbaynard
Copy link
Contributor

OK — @qrilka is working on a complete rewrite of how stack works out what to build; @qrilka this shouldn't interfere, right?

@qrilka
Copy link
Contributor

qrilka commented Dec 13, 2018

CLI args parsing logic wasn't supposed to be touched by refactoring in #4412 but maybe that PR could give some merge conflicts as some functions got moved a bit.

@dbaynard
Copy link
Contributor

OK — I was thinking that skipping the library may have some knock on impact, but I think I'm misunderstanding the --skip flag's purpose.

@vanceism7 Go for it and we can deal with #4421 after it's working on master.

@vanceism7
Copy link
Contributor

Ok, so I think I've basically got skip for libraries working, but just to check, what exactly is the behavior for the skip flag supposed to be?

With my fix in place, currently what I'm seeing based on the original issue's steps to reproduce, is that calling stack build --skip this would not skip the this package anyways since by default stack new creates packages that are both libs and exes.

In order to skip the this package, I need to supply two skip flags, e.g: stack build --skip this --skip this-exe.
Also, when running stack test, I need to supply three skip flags this, this-exe, and this-test. Is this the intended behavior?

@dbaynard
Copy link
Contributor

dbaynard commented Dec 13, 2018

Yes — --skip should skip a component. So in addition, if you have multiple libraries/executables/test suites you should be able to skip them individually. e.g. For two test suites (light, very-long-integration-test), running stack test --skip very-long-integration-test should build the library, the executable, the test suite light and run the tests for light. It should neither build nor run tests for very-long-integration-test.

I'm not actually sure what the value is of not building the library, though — perhaps you wish to avoid recompilation, or run a test suite on a binary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants