-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add files needed to compile Ethernet library #180
Conversation
Is there a reason that the changes to |
The goal of the change was to add the define for But most of my hesitancy is because I don't understand what I'm doing very well, so reducing the impact of my changes seemed prudent! |
Aah, I think I see the significance of this, despite the conversation being spread out across a few issues. I think the root issue here is going to be #185 so I'll focus on that next and see if it simplifies this. |
You are right that this is a bit confusing because of the path I took that spread it across a few issues. While upgrading to 1.8.13 might reduce some of the issues I'm not sure that it would completely resolve the underlying issue. In another conversation you discussed the challenges of keeping an external library in sync with the core testing framework. On the one hand we like to have them separate (we rightly decided that we should not add all external libraries to Arduino CI), but we need to find out quickly if a change in the core framework breaks a dependent library. Does that mean creating a sample project that includes the external library? Should this have been in a new SampleProject directory rather than added as a (huge) .cpp file to |
There's a question you're implying here that is a good one, and one that I meant to reply to sooner. I'd phrase it in my own words like this:
I think the answer to this is to expose the value of the There are a lot of really great features being requested here at the same time and I apologize for the delay -- I'm trying to make sure that I'm adding them in a way that keeps things coherent. |
I'm not sure my implied question was quite so insightful, so it is good that you rephrased it. As you phrase it, it does cover one of the issues. But this PR really has several issues:
As to the The "real" Arduino libraries have the I think it would be better for you to upgrade Arduino CI periodically, especially when someone (like me!) needs to move from 100 to 106. But once you've done the upgrade, it seems that other libraries will only be tested against the version provided by the mocks. It seems to me that allowing testing of other mock versions would be best supported by using older versions of Arduino CI. (As I'm writing this, I'm wondering if Arduino CI should have versions that follow Arduino, with a custom extension; so the next would be 1.8.13.ci.0. That doesn't exactly follow Semantic Versioning, but does convey something quite useful!). But then I'm on a (relatively) new project and I like to be on the "bleeding edge" of new versions, so I don't have as much concern for those who want to be able to use a new version of the testing framework to test old libraries. By the way, how do you feel about a new issue deprecating In any case, I appreciate your responsiveness and respect the concern for keeping things coherent. I'm pretty excited about being able to build an application that has thorough testing. |
A few things to respond to
Yes, if there was a guaranteed version of
In truth I've never used an Ethernet library with an Arduino project, so I'm not familiar with whether the library here represents a native capability like
I think we should open a separate issue to track this. Apologies for the delay, it's been quite a busy week |
The other thing I'm noticing here is a lot of variation in the licenses prepended to those files. This project overall is |
You are probably right about the license concern. What source do you use for the mock? |
I'm not sure what this means, I wrote all the mocks by hand to match the public APIs I could find in the Arduino documentation. |
I see. I thought you had taken an existing set of files and replaced certain parts (much as I did). |
1d961b0
to
42d49e6
Compare
This depends on #197 (and helped in its development!). This is a major rewrite and relies on an import of the Ethernet library and provides brand-new, hand-crafted stubs for the required files (rather than bringing in the full copy from elsewhere (with the license issues). Now that we can compile the Ethernet library, we can start to work on actually testing it (and making it testable. |
I see that the |
I'm skimming this for now, and my first guess is that it has something to do with pulling in Ethernet as a dependency in the Maybe locally you have this file in your Arduino Libraries dir, but my initial reaction (without testing this) is that your install script is not getting the |
In general, this PR looks great. If you can add minimal unit tests for the new classes (just to ensure that the compiler is aware they exist), this will be ready for merging. |
I think we have some basic tests and the library is properly installed. It should be ready for another review! |
@@ -0,0 +1,7 @@ | |||
#!/bin/bash | |||
|
|||
# if we don't have an Ethernet library, then get the standard one |
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.
This seems like a bug in the core library, was it not able to fetch this by specifying a dependency in .arduino-ci.yml
?
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 dependency in .arduino-ci.yml
would bring in the official library (code here?). But for the purposes of this test in Arduino Ci, we'd like to test against our fork of the Ethernet library, since it is our fork that has arduino_ci
support.
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.
Unless I'm missing something, this behavior of "install a standard library if a local one does not exist" is also implemented in the core library:
https://github.com/Arduino-CI/arduino_ci/blob/master/exe/arduino_ci.rb#L170-L173
In other words, if you manually install your own ethernet library locally, then listing a library of the same name in .arduino-ci.yml
will not cause the CI runner to overwrite it. The check is simple directory existence: https://github.com/Arduino-CI/arduino_ci/blob/master/lib/arduino_ci/arduino_cmd.rb#L238-L240
So I think this entire script and the reference to it can be deleted
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 comment does not do a good job of explaining what I want, so I've revised it.
When we are running the CI tests (on Travis, Appveyor, or GitHub Actions), we won't have the Ethernet library present at first. We don't want arduino_ci
to install it because it will install the "standard" one and we want the "custom" one (my bad on the comment). But, I am running the CI tests on my development machine, I don't want it replacing my existing (development) Ethernet library. So, unless .arduino-ci.yml
can specify a source (like a Gemfile
), then I need the custom script. At least I think so! Does that make more sense?
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.
While the purpose was to use our custom Ethernet library (the reference to the "standard" library was a mistake), for purposes of validating that arduino_ci
has the required pieces to compile the custom library it is probably sufficient to compile against the standard library, so the above comment can be ignored.
Clarify comment to explain why we want to install a customer library if one isn't present.
Squashed into #183 and i've made my desired change to the NetworkLib install script |
I'm embarrassed to say that I am most definitely missing something. It looks like Ethernet gets installed (or requested for install via the IDE), but I don't see it getting listed in the directory:
If the "standard" Ethernet library is used, where would that directory be? |
The IDE comes with some bundled libraries: If the version of the bundled library is the latest version available from Library Manager, then the library won't be installed.
|
One solution (and the reason it didn't fail for me before submitting the PR), is to restore the code you removed that downloads our custom Ethernet library (my comment referring to the "standard" library was wrong). |
Perhaps this calls for a new issue addressing explicit inclusion of built-in (but hidden) libraries. |
Any issues caused by the IDE's built-in libraries would be made moot if you switched to using Arduino CLI, since it doesn't have any built-in libraries. |
This clears up a few things. I was looking at But with that out of the way I think I see what was happening. You have to download the Ethernet library manually into the libraries directory because I like @per1234 's suggestion about switching to the CLI. Will that work cross-platform? If yes, I'll pull in the install script workaround for now and open a new issue to remove it if/when we switch to the CLI. |
You are right, I was cloning the official library. What I though I was doing (and meant to do?) was |
Arduino CLI is available for Linux, Linux ARM, Windows, macOS. There are 32 and 64 bit versions available for the first three platforms: It's a much smaller download, since it doesn't have any need for the GUI code of the IDE. The command line interface is much more powerful than the Arduino IDE's CLI. Using the Arduino IDE's CLI for sketch compilation CI and it was frequently frustrating because when something went wrong it would start the GUI, which just means the headless Travis CI environment hangs until it times out, giving no information useful for troubleshooting. I have had a much more pleasant experience since I switched to using Arduino CLI for this purpose. |
Would the CLI solve #137? |
Yes. There's certainly nothing for it to splash! The Arduino IDE's CLI works well enough, but it was added on as an afterthought. Arduino CLI was designed from the start with this sort of use case in mind. |
Opened #206 to track the CLI, it should be straightforward if all the IDE functions have corresponding CLI functionality |
We tried adding the Ethernet library and found that some pieces were missing. This adds the missing pieces and a test to show that we have enough to work on Ethernet separately. The test doesn't implement Ethernet, but shows that the pieces needed are now provided. Comments and suggestions are welcome.