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

[BUG] set_text_variables might not like non-1 return values (maybe a bug?) #673

Open
oliv3r opened this issue Sep 28, 2024 · 2 comments
Open
Assignees
Labels
needs more info Further information is requested

Comments

@oliv3r
Copy link

oliv3r commented Sep 28, 2024

I'm playing with the panelize to fab workflow, which I'm getting there. Running kibot with panelization (and baketext!) to generate an intermediate panel.kicad_pcb. Now things get more tricky, probably because the way I'm doing things ;)

In the pipeline, I do not want to know 'where' I am, and actually, I want all of kibot to run 'just as normally' on my project. However, I will override the board, to --board outputs/panels/new-panel.kicad_pcb. Because of this, I no longer have a file that is being tracked in git, this would be fine, if I didn't have a general set_text_variables (which I fully realize is useless in this case, as this is a generate intermediate file).

So in summary:

/workdir/world$  kibot --defs-from-env --stop-on-warnings  --schematic world.kicad_sch --plot-config '.kibot/kici_panelize.kibot.yaml'

which generates my panel and then

kibot --defs-from-env --no-warn 135,164 --stop-on-warnings  --schematic world.kicad_sch --plot-config '.kibot/kici_fab.kibot.yaml' --board 'outputs/panels/world-panel.kicad_pcb'

where it 135 (duplicate refs) and 164 (inconsistency on sch, which is odd, but could be related to multi-sheet schematics, it comlains about a missmatch on the U1 datasheet field, which doesn't happen for a regular run ...

will fail with the following set_text_variables

    - name: 'VCS_PCB_HASH'
      command: 'git log -1 --format="%H" "${KIBOT_PCB_NAME}" || echo "Unknown"'
      before: 'Git <'
      after: '>'

The strange thing is, if we wrap it in a sub-shell it works fine.

    - name: 'VCS_PCB_HASH'
      command: 'echo $(git log -1 --format="%H" "${KIBOT_PCB_NAME}" || echo "Unknown")'
      before: 'Git <'
      after: '>'

This is of course not an issue ("Unknown") because in panelize I have set baketext to ensure everything remains exactly the same as with a single PCB.

What's even weirder, is that

    - name: 'VCS_PCB_DATE'
      command: 'date -d @$(git log -1 --format="%at" "${KIBOT_PCB_NAME}") -Idate || echo "Unknown"'

does work (obviously, removing the || echo at the end fails for different reasons, as is expecte.d

The only difference I can note, is that date -d @bs fails with error code 1; but git log ... fails with 128. Though I don't get why this is even relevant, because any error is captured by the || echo which shouldn't (ever) produce an error ...

So while I have an ugly work-around, this shouldn't be a problem of course.

@set-soft set-soft added the needs more info Further information is requested label Sep 30, 2024
@set-soft
Copy link
Member

Hi @oliv3r !

Run KiBot using -L logfile and paste here the portion related to the execution of the external command, it will contain more information.

My guess is that something else is failing and you are overlooking it.

@oliv3r
Copy link
Author

oliv3r commented Oct 4, 2024

I will do so asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants