question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$(query_targets) parsing error

See original GitHub issue

I have a genrule that looks like this:

genrule (
  name = 'dist-server',
  bash = """echo $(query_targets "kind('prebuilt_jar', deps(attrfilter(labels, 'server', '//...')))") >$OUT """,
  out = 'dist-server.txt',
)

This rule generates the following error from Buck:

BUILD FAILED: Error parsing target expression //... for target //:dist-server

However, this interactive command from the shell works:

bash$ buck query "kind('prebuilt_jar', deps(attrfilter(labels, 'server', '//...')))"
//ThirdParty/deps:lucene-memory
//ThirdParty/deps:lucene-queries
//ThirdParty/deps:lucene-sandbox
...
//ThirdParty/deps:gson

The documentation states:

The query_* macros accepts a quoted query expression which supports the following query functions:

  • attrfilter
  • deps
  • except
  • classpath
  • intersect
  • filter
  • kind
  • set
  • union

Of which the above expression appears to conform.

Ultimately, our goal is to generate a rule that depends (dynamically) on labeled java_library targets, and queries their respective outputs via $(query_outputs ...) for the purposes of copying them into a distribution folder.

Am I missing something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
brettwooldridgecommented, Mar 31, 2017

@asp2insp Thanks. We sliced the cake in a different way to solve our use case.

0reactions
alexshtincommented, Nov 20, 2018

@brettwooldridge, can you share your code snippet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query parsing errors - IBM
This error is commonly caused by incorrect percent-encoding of characters in the query. For details of how to percent-encode characters, see Retrieving ...
Read more >
Parse Cloud Code Queries Return Nothing - Stack Overflow
This is the current code I've put together: var queryGoals = new Parse.Query(Parse.Object.extend ...
Read more >
Parse Error: What It Is and How to Fix It - Lifewire
A parse error is an error message you sometimes get on Android devices when an app fails to install. The message itself is...
Read more >
[SERVER-10891] Commands don't return "ok" field if targeting ...
The command subsystem is only invoked when a query targets the collection "$cmd". ... cmd" as the namespace (which fails namespace parsing, ...
Read more >
#1293 (Induced condenser doesn't work with where clause ...
rasdaman error 300: Parsing error 300 in line 3, column 4: Unexpected name ... error 361 in line 1, column 1, near token...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found