Skip to content
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

Feature request: exclude files from Arduino CLI #631

Open
janjongboom opened this issue Mar 23, 2020 · 8 comments
Open

Feature request: exclude files from Arduino CLI #631

janjongboom opened this issue Mar 23, 2020 · 8 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@janjongboom
Copy link

I was contemplating whether this would be a request for the library format or something in Arduino CLI. We have a unified codebase for our embedded libraries, and deliver a configuration file per target that includes / excludes certain folders. E.g. we can deliver a Makefile, a Keil uVision project, or an .mbedignore file as part of the delivery mechanism. This works really well. However, for Arduino there does not seem to be a similar way to exclude files from the build process. I know others struggle with this too (e.g. @neil-tan when developing uTensor).

Adding this in the library format and in Arduino CLI would make it a lot easier to distribute upstream versions of libraries that we publish, rather than having to create separate builds just for Arduino.

@rsora rsora added the type: enhancement Proposed improvement label Mar 23, 2020
@alranel
Copy link
Contributor

alranel commented May 14, 2020

Hi @janjongboom!
If I understand correctly you're thinking about something like a couple of --include and --exclude options to tell the compiler which .c, .cpp and .ino files to consider. Did I get it right?

If so, maybe is this something that can be achieved with a clever Makefile that copies the relevant files/folders for the selected target to a temporary build directory and then launches arduino-cli?

@janjongboom
Copy link
Author

janjongboom commented May 18, 2020

@alranel Correct, and yes, that's one way of doing it, e.g. this is how we're doing it right now:

https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/create-arduino-library.sh

But that always requires a second step, e.g. we need to do this every time someone wants to include our library as an Arduino lib.

@alranel
Copy link
Contributor

alranel commented May 19, 2020

What about setting up a CI action on your repo, that performs that cleanup and pushes the Arduino library to its own repo? That way users will have it ready like a normal Arduino library, always up-to-date with your upstream repo. Also you could include a library.properties file in there so that it can be indexed in the Arduino Library Manager.
Would this work for you?

@per1234
Copy link
Contributor

per1234 commented May 27, 2020

Hi @janjongboom. I'd be glad to assist with implementing alranel's proposal of using CI to generate the Arduino library from your unified code.

My idea is that on every change (push or PR) to the edgeimpulse/inferencing-sdk-cpp repository's relevant files, the CI system should:

  1. Run an expanded version of create-arduino-library.sh that takes all the steps to product a valid Arduino library.
  2. Do a compilation test using Arduino CLI to make sure the code will compile with the Arduino development software.
  3. If the test passes, and it was a push to the master branch, deploy the updated Arduino library to a dedicated repository.

@janjongboom
Copy link
Author

@per1234 Thanks, we already have this in our internal CI (and automatically test building a bunch of impulses for the Nano 33 BLE Sense), but it's still annoying that the Arduino CLI cannot do this yet.

@per1234
Copy link
Contributor

per1234 commented Jun 5, 2020

I'm glad to hear you have been able to automate this @janjongboom.

We will investigate whether the exclude functionality can be provided within a broader context as part of the ongoing development of Arduino CLI.

@per1234 per1234 reopened this Mar 30, 2021
@karelv
Copy link

karelv commented May 18, 2021

+1

@per1234 per1234 closed this as completed May 18, 2021
@per1234 per1234 added conclusion: declined Will not be worked on and removed conclusion: declined Will not be worked on labels May 18, 2021
@per1234 per1234 reopened this May 18, 2021
@alranel
Copy link
Contributor

alranel commented Aug 2, 2021

In case anyone is interested in this, I'm sure the Arduino team would be open to review any contribution that implements it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

6 participants