Skip to content

List usable targets with a targets subcommand #1361

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 2 commits into from
Sep 9, 2020
Merged

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Sep 6, 2020

This is something that should be useful for autocomplete and similar tools.

@aykevl aykevl requested review from deadprogram and sago35 September 6, 2020 16:42
Comment on lines +945 to +949
if spec.FlashMethod == "" && spec.FlashCommand == "" && spec.Emulator == nil {
// This doesn't look like a regular target file, but rather like
// a parent target (such as targets/cortex-m.json).
continue
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nintendoswitch.json is not listed, so either change the conditions a bit or put a trick in the json.

My only concern is that it may be difficult to keep this rule in place in the future.
If I have trouble in the future, I will consider it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have same issue, which is that the nintendoswitch target does not appear in the list.

Instead of specifying the emulator command in atmega328p.json, specify
it in the two boards based on it (arduino and arduino-nano). This makes
the configuration consistent with the machine package, which only
defines the CPUFrequency function in the board files (and not in
machine_atmega328p.json).
This patch adds the `tinygo targets` command, which lists usable
targets (targets that can be used in the `-target` flag).

The assumption here is that usable targets can either be flashed or
emulated by TinyGo. There is one exception where it doesn't work yet:
the nintendoswitch target. Right now it requires some manual steps to
build a .nro file which can then be run by yuzu, hence why it doesn't
show up in the list.
@aykevl
Copy link
Member Author

aykevl commented Sep 8, 2020

Yes, I'm aware of the Nintendo Switch limitation:

This patch adds the tinygo targets command, which lists usable targets (targets that can be used in the -target flag).

The assumption here is that usable targets can either be flashed or emulated by TinyGo. There is one exception where it doesn't work yet: the nintendoswitch target. Right now it requires some manual steps to build a .nro file which can then be run by yuzu, hence why it doesn't show up in the list.

I looked into adding emulator support, but it's hard to test with the issue I hit here: #1226 (comment)

@deadprogram
Copy link
Member

I propose we merge this PR now, and then once the 2 nintendoswitch related PRs are merged, another PR can be created that adds it to the list.

@aykevl
Copy link
Member Author

aykevl commented Sep 9, 2020

Yes, that was what I was trying to suggest.

@deadprogram
Copy link
Member

OK, now merging. Let the awesome tooling commence!

@deadprogram deadprogram merged commit e7227df into dev Sep 9, 2020
@deadprogram deadprogram deleted the list-targets branch September 9, 2020 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants