Skip to content

"device type not defined" when testing without .arduino-ci.yml #158

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

Closed
jgfoster opened this issue Sep 8, 2020 · 6 comments
Closed

"device type not defined" when testing without .arduino-ci.yml #158

jgfoster opened this issue Sep 8, 2020 · 6 comments

Comments

@jgfoster
Copy link
Member

jgfoster commented Sep 8, 2020

System

See #149 for system details.

"device type not defined" errors

Based on ./REFERENCE.md I believe that .arduino-ci.yml is optional, but when I left it out I got an error. I added it back and gave it the values found in misc/default.yml and the error reproduced. By making changes to the file I gradually reduced it to see that the error reproduces with zero as the only entries in the platforms section. I don't need zero (I only use Mega2560) but I was trying to do something that was generalized.

There are many errors, but following is the first:

Requested unittest platform 'zero' is defined in 'platforms' YML...            ✓
Unit testing test.cpp with g++... 

Last command:  $ g++ -std=c++0x -o /Users/jfoster/Documents/Arduino/libraries/Blink/unittest_test.cpp.bin -DARDUINO=100 -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -D__SAMD21G18A__ -DARDUINO_SAMD_ZERO -I/Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino -I/Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/unittest -I/Users/jfoster/Documents/Arduino/libraries/Blink /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Arduino.cpp /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Godmode.cpp /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/stdlib.cpp /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/unittest/ArduinoUnitTests.cpp /Users/jfoster/Documents/Arduino/libraries/Blink/Blink.cpp /Users/jfoster/Documents/Arduino/libraries/Blink/test/test.cpp

In file included from /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Arduino.cpp:1:
In file included from /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Godmode.h:2:
In file included from /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/ArduinoDefines.h:3:
In file included from /Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/avr/pgmspace.h:17:
/Users/jfoster/Documents/Arduino/libraries/Blink/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/avr/io.h:623:6: warning: "device type not defined" [-W#warnings]
#    warning "device type not defined"

Arduino or Unit Test Code, Illustrating the Problem

Arduino Architecture(s) Affected

  • zero
@ianfixes
Copy link
Collaborator

ianfixes commented Sep 8, 2020

Can you post the contents of the config file that produced errors?

@jgfoster
Copy link
Member Author

jgfoster commented Sep 8, 2020

.arduino-ci.yaml

compile:
  libraries: ~
  platforms:
    - zero

unittest:
  libraries: ~
  platforms:
    - zero

@ianfixes
Copy link
Collaborator

ianfixes commented Sep 9, 2020

I can think of 2 things that could be going wrong here.

  1. There is a bug in the library and I'm not actually pulling in default.yml as the "base" configuration. But I'm pretty sure I test for this.
  2. .arduino-ci.yml files can exist in multiple places in the directory structure, such that deeper ones override shallower ones. Perhaps you copied this example configuration containing the entry zero: ~ into your project somewhere?

@jgfoster
Copy link
Member Author

jgfoster commented Sep 9, 2020

Should zero work? When I use mega2560 as the platform, the test passes; but when I use zero as the platform I get the error. So, yes, it only happens if I explicitly (with my own config file) or implicitly (by using the default) include zero as a platform.

@ianfixes
Copy link
Collaborator

ianfixes commented Sep 9, 2020

I would expect that either all the platforms in default.yml work in a CI context, or none of them. But I'm looking again... and

Requested unittest platform 'zero' is defined in 'platforms' YML... ✓

So this was a red herring, my fault. Also:

Should zero work?

Now that you mention it... this is indeed a bug. But a duplicate bug of #140 😞

@ianfixes ianfixes closed this as completed Sep 9, 2020
@ianfixes
Copy link
Collaborator

ianfixes commented Sep 9, 2020

In the short term I'm wondering if I should just disable the entry in default.yml, but that really won't help all the gem versions that are already in the wild.

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

No branches or pull requests

2 participants