-
-
Notifications
You must be signed in to change notification settings - Fork 407
check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChanged's Run #1118
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bbf3a43
check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChange…
d-a-v fa9f4f6
+ debug message
d-a-v 82189d6
update from review: improve user message
d-a-v fbb8e61
fix per review
d-a-v 8d0038a
add check to buildOptionsJson too
d-a-v 023c9fc
panic'ing instead of keeping on with mess
d-a-v 7df8737
fix use of a constant
d-a-v 4d5a247
[skip changelog] Add compile with invalid build.options.json test
silvanocerza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add check to buildOptionsJson too
- Loading branch information
8000
commit 8d0038a613b43f73140b63d1aab98c22d429da15
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this message is confusing:
Because it's not the build.options.json file that's invalid, but rather the internal build options data.
Since this isn't something that should occur under any normal circumstances, I would lean toward just doing a
panic(err)
. Probably @silvanocerza would be able to tell us what is the preferred approach though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine like this, it seems to me that
ctx.BuildOptionsJson
is populated with data from thebuild.options.json
file only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
build.options.json
file is created fromctx.BuildOptionsJson
:arduino-cli/legacy/builder/store_build_options_map.go
Line 26 in 079bb6c
It's
ctx.BuildOptionsJsonPrevious
that is populated with data from thebuild.options.json
file:arduino-cli/legacy/builder/load_previous_build_options.go
Line 38 in 079bb6c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I leave it as it currently is,
or change the message,
or replace it by
panic(constants.BUILD_OPTIONS_FILE + " is invalid")
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to get @silvanocerza's response to my previous reply just to make sure everyone is on the same page here. After that, I'd recommend going with whatever Silvano think is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot about this.
@per1234 is right, probably a message like
build options are invalid
might be less confusing, it's not exactly transparent like this either but at least it won't confuse the user if thebuild.options.json
file doesn't exist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silvanocerza @per1234 I just proceeded with your suggestion.