Hey Pants, we're seeing an error about using `--ch...
# general
r
Hey Pants, we're seeing an error about using
--changed-since
at the same time as target arguments but it's not in the command at all:
Copy code
./pants import-fixer --jobs=cross-imports --import-fixer-output-file=cross_imports_output.json app/::
17:27:47.34 [INFO] Initializing scheduler...
17:27:47.50 [INFO] Scheduler initialized.
17:27:47.53 [ERROR] You used `--changed-since` at the same tie as using target arguments. Please use only one.
Traceback (most recent call last):
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/ite-packages/pants/bin/daemon_pants_unner.py", line 125, in single_daemonized_run
    ​runner = LocalPantsRunner.create(
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py3/lib/python3.8/site-package/pants/bin/local_pants_runner.py", line 150, in create
    ​specs = calculate_specs(
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/pthon3.8/site-packages/pants/init/specs_calculator.py", line 47, in calculate_specs
    ​raise InvalidSpecConstraint(
pants.init.specs_calculator.InvalidSpecConstraint: You used `--changed-since` at the same time as using target arguments. Please use only one.
+ ./pants import-fixer --jobs=wildcard-imports --ignore-skip --json-output --import-fixer-output-file=wildcard_imports_output.json app/::
17:27:48.10 [ERROR] You used `--changed-since` at the same time as using target arguments. Please use only one.
Traceback (most recent call last):
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/daemon_pants_runner.py", line 125, in single_daemonized_run
    ​runner = LocalPantsRunner.create(
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/ocal_pants_runner.py", line 150, in create
    ​specs = calculatespecs(
  ​File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrp-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/init/specs_calculator.py", line 47, in calculat_specs
    ​raise InvalidSpecConstraint(
pants.init.specs_calculator.InvalidSpecConstraint: Youused `--changed-since` at the same time as using target arguments. Please use only one.
I tested the goal locally with no issues. Any ideas why this would happen?
h
I wonder if it's set via an env var or pantsrc file, perhaps? Do you reproduce on multiple machines?
r
I've only seen this happen in CI as of earlier today. We use the changed since option in line earlier in the build. This command above is invoked later in the build to run a custom plugin.
h
Huh. Did something change recently, like a pants upgrade or changes to your plugin?
r
the only thing we changed is on the main build we started running
./pants dependees --changed-since=${LAST_RELEASE_COMMIT} --dependees-output-file=pants_dependees.txt
this is called before the command above. Seems like it could have started happening around the same time actually
h
Might be worth experimenting with inverting the order, and possibly disabling Pantsd This should not be happening if it is, to be clear
r
and very specially we started running changed-since with a commit hash and not a remote branch name
okay yeah let me try disabling pantsd
h
Any luck?
r
I jsut wanted to get this output before disabling pantsd and share here: https://gist.github.com/njgrisafi/aa336771dfa4557b339de0c6926125e9 will try pantsd now
h
Thanks for running with ldebug!
215627.04 [DEBUG] specs are: Specs(address_specs=AddressSpecs(literals=(), globs=(DescendantAddresses(directory='app'),), filter_by_global_options=True), filesystem_specs=FilesystemSpecs(includes=(), ignores=()))
215627.04 [DEBUG] changed_options are: ChangedOptions(since='6db38768e8de2a4182a32b55d329e6c398800b77', diffspec=None, dependees=<DependeesOption.NONE: 'none'>)
fyi that maps to
app:: --changed-since=6db38768e8de2a4182a32b55d329e6c398800b77
👀 1
r
hmm idt that shouldn't happen. We're trying to run a completely separate command on the
app/::
targets. Maybe I can force it not to use the cache by running
::
instead?
h
Yeah it should not have the changed-since option still...did Pantsd make a difference? How are you setting --changed-since in the prior command?
r
but at this point I think pantsd should help. I just enabled the option when running these goals. Will see how it does
Here's the dependees goal we run prior
./pants dependees --changed-since=6db38768e8de2a4182a32b55d329e6c398800b77 --dependees-output-file=pants_dependees.txt
👍 1
ahh no luck with disbaling pantsd either
I think I'm going to try changing the target address to avoid using
app::
changing the target address is not working either: https://gist.github.com/njgrisafi/0a96aa4bd22abc19154d13f7b1f48b3d going to try disabling pantsd completely via pants.ci.toml
even after disabling pantd in config it still fails 🤔
I tried removing the cache and still no luck: https://gist.github.com/njgrisafi/6065b51ef6aa306a3b445b2917794823
I tried clearing everything mentioned here https://www.pantsbuild.org/docs/troubleshooting#cache-or-pantsd-invalidation-issues and still no luck https://gist.github.com/njgrisafi/78bd428ea730aef734644502db23f857 really not sure why this happening 🤕
h
Hmmm. I'm wondering what would happen if you ran a different, not custom goal after that dependees one? I'm wondering if somehow the custom goal is the culprit You said this doesn't reproduce locally?
r
maybe the goal is the issue but not sure how. It's similar to the one here: https://github.com/njgrisafi/pants-example/tree/import-fixer maybe we're holding something wrong?
haven't been able to repro locally just yet
we've been using this goal for about over a month now. The only thing we changed was running that dependees goal before and everything broke... let change the order of the goals and see
👀 1
confirmed locally running those two goals does not seem to cause an issue
re-ordering the commands fixed this. Very strange error and this adds complications with using pants we did not expect. I'd imagine we should be able to run as many goals as we need in our pipelines and not run into an issue like this. @hundreds-father-404 thank you so much for your help and suggestions on this. Please let me know if you need more details for investigation here. We'll continue investigation on our end too.
1
of course this happens on friday too 🤦
😂 1
h
So reordering fixed it. What about going back to bad order and adding an immediate goal that runs ./pants list app::?
👀 1
r
let me try that
Copy code
+ ./pants list app::

You used `--changed-since` at the same time as using target arguments. Please use only one.

Traceback (most recent call last):

  File "/home/ubuntu/workspace/rippling-main_PR-59021/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/pants_loader.py", line 100, in run_default_entrypoint

    exit_code = runner.run(start_time)

  File "/home/ubuntu/workspace/rippling-main_PR-59021/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/pants_runner.py", line 97, in run

    runner = LocalPantsRunner.create(

  File "/home/ubuntu/workspace/rippling-main_PR-59021/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 150, in create

    specs = calculate_specs(

  File "/home/ubuntu/workspace/rippling-main_PR-59021/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/init/specs_calculator.py", line 47, in calculate_specs

    raise InvalidSpecConstraint(

pants.init.specs_calculator.InvalidSpecConstraint: You used `--changed-since` at the same time as using target arguments. Please use only one.

script returned exit code 1
wow that's really odd
that's right after the dependees command
this does not happen locally on my mac
h
Well good news is that it is not related to your custom goal! Ik I'm a broken record, but it would be helpful to triple check your env vars and config file to see if they are setting PANTS_CHANGED_SINCE or [changed].since. Note that the CLI would override if that was the case, so that arg being set is not proof that the env var isn't also set Another thing you could try is run ./pants list at the beginning of the run, with no args. Does it give back results or does it warn no targets specified
1
r
haha yes good to know! We are not setting
PANTS_CHANGED_SINCE
in a config or as an env. We only ever add it as an option on the
dependees
goal.
Another thing you could try is run ./pants list at the beginning of the run, with no args. Does it give back results or does it warn no targets specified
sure I can give this a try too
running pants lint at the start of the run outputs this:
Copy code
./pants list

pants-plugins/import_fixer/import_fixer.py
the error still occurs
strange how it got targets when nothing was added tho
running locally:
Copy code
$ ./pants list
WARNING: No targets were matched in goal `list`.
I think I just found it 🤦
there was an env var
--changed-since=${PANTS_CHANGED_SINCE}
that is definitely the root of the chaos
1
this is most definitely the reason. that was a pretty bad user error. Thank you again @hundreds-father-404
h
Okay yay! You're welcome. I'm glad pants is not broken 🙌
💯 1