nasa / fprime-tools

F´ Python tooling and helpers.
https://github.com/nasa/fprime
Apache License 2.0
21 stars 39 forks source link

Remove restrictions for the Build class to setup its platform #216

Closed weggert2 closed 1 month ago

weggert2 commented 2 months ago

Which allows users to call fprime-util generate several times without faiure

Related Issue(s) https://github.com/nasa/fprime/issues/2869
Has Unit Tests (y/n) yes
Documentation Included (y/n) yes

Change Description

Removes restrictions on calling Build.invent and Build.__setup_default more than once. I admit I don't understand the full implications of this, so I'd encourage the author @LeStarch to evaluate whether this breaks things. Anecdotally, locally installing this allows me to call generate in my fprime project several times without error.

Rationale

Fixes a (perceived) bug that fprime-util generate should not fail if a cache already exists

Testing/Review Recommendations

There is a very simple included unit test that shows that calling Builder.invent() twice does not raise an assertion. Please let me know what else I need to test.

thomas-bc commented 1 month ago

@weggert2 we went ahead with the implementation of fprime-util generate --force flag. This will purge and re-generate in a single command. The reason for not doing a re-generation without purging is that autocoded files can be leftover in the build cache, or not tracked correctly, which could cause issues.

Thank you for the contribution nonetheless! It brought up a good use-case, we just went with that alternate approach.

weggert2 commented 1 month ago

Sounds good to me! Thanks for tackling that!


From: Thomas Boyer-Chammard @.> Sent: Monday, October 14, 2024 6:32:13 PM To: nasa/fprime-tools @.> Cc: weggert2 @.>; Mention @.> Subject: Re: [nasa/fprime-tools] Remove restrictions for the Build class to setup its platform (PR #216)

@weggert2https://github.com/weggert2 we went ahead with the implementation of fprime-util generate --force flag. This will purge and re-generate in a single command. The reason for not doing a re-generation without purging is that autocoded files can be leftover in the build cache, or not tracked correctly, which could cause issues.

Thank you for the contribution nonetheless! It brought up a good use-case, we just went with that alternate approach.

— Reply to this email directly, view it on GitHubhttps://github.com/nasa/fprime-tools/pull/216#issuecomment-2412518729, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE2GMX6HLDRGZXWQOCXN5VTZ3RH73AVCNFSM6AAAAABOD62RYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJSGUYTQNZSHE. You are receiving this because you were mentioned.Message ID: @.***>