Skip to content

Add support for .inc file extension in additional sketch code files #3083

Open

Description

@Yyax13

Describe the request

Add support for the use of code files with a .inc file extension in sketches:

https://arduino.github.io/arduino-cli/dev/sketch-specification/#additional-code-files

Describe the current behavior

If you compile a sketch that contains an #include directive for a file with a .inc extension that is present under the sketch folder, compilation fails with a "No such file or directory" error.

Arduino CLI version

1.4.0 Commit: b700097

the error can happen with arduino-cli Version: nightly-20260120 Commit: e394193 Date: 2026-01-20T01:37:42Z

Operating system

Linux

Operating system version

Linux howo-setup 6.17.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 24 Nov 2025 15:21:09 +0000 x86_64 GNU/Linux

Additional context

Forum discussion: https://forum.arduino.cc/t/help-arduino-cli-just-dont-compile-my-project/1424970

Additional requests

Related

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details

Activity

  1. cmaglie commented on Jan 21, 2026

    @cmaglie
    Member

    Can you provide an example to reproduce the error?

  2. Yyax13 commented on Jan 21, 2026

    @Yyax13
    Author

    yo

    Makefile:

    BOARD_FQBN 	:= digistump:avr:digispark-tiny
    PORT       	:= /dev/hidraw0
    BUILD_DIR  	:= build
    SKETCH     	:= .
    
    all: compile
    
    compile:
    	/tmp/arduino-cli compile \
    	--fqbn $(BOARD_FQBN) \
    	--output-dir $(BUILD_DIR) \
    	$(SKETCH)
    
    upload:
    	/tmp/arduino-cli upload \
    	--fqbn $(BOARD_FQBN) \
    	--port $(PORT) \
    	$(SKETCH)
    
    clean:
    	rm -rf $(BUILD_DIR)
    
    rebuild: clean compile
    
    .PHONY: all compile upload clean rebuild
    

    Tree:

    .
    ├── arduino.yaml
    ├── LICENSE
    ├── Makefile
    ├── README.md
    ├── SECURITY.md
    ├── SparkType.ino
    └── src
        ├── include
        │   └── main.h
        ├── infra
        │   ├── HID
        │   │   ├── CONNECTION
        │   │   │   ├── main.cpp
        │   │   │   └── main.h
        │   │   └── LEDS
        │   │       ├── main.cpp
        │   │       └── main.h
        │   ├── OS
        │   │   ├── main.cpp
        │   │   └── main.h
        │   └── TTY
        │       ├── main.cpp
        │       └── main.h
        ├── lib
        │   ├── arduino-libraries
        │   │   └── DigisparkKeyboard
        │   │       └── src
        │   │           ├── ArduinoNotes.txt
        │   │           ├── asm
        │   │           │   ├── asmcommon.inc
        │   │           │   ├── usbdrvasm128.inc
        │   │           │   ├── usbdrvasm12.inc
        │   │           │   ├── usbdrvasm15.inc
        │   │           │   ├── usbdrvasm165.inc
        │   │           │   ├── usbdrvasm16.inc
        │   │           │   ├── usbdrvasm18-crc.inc
        │   │           │   └── usbdrvasm20.inc
        │   │           ├── Changelog.txt
        │   │           ├── CommercialLicense.txt
        │   │           ├── DigiKeyboard.cpp
        │   │           ├── DigiKeyboard.h
        │   │           ├── examples
        │   │           │   └── Keyboard
        │   │           │       └── Keyboard.ino
        │   │           ├── keylayouts.h
        │   │           ├── keywords.txt
        │   │           ├── License.txt
        │   │           ├── oddebug.c
        │   │           ├── oddebug.h
        │   │           ├── osccal.c
        │   │           ├── osccal.h
        │   │           ├── osctune.h
        │   │           ├── Readme.txt
        │   │           ├── scancode-ascii-table.h
        │   │           ├── usbboardconfig.h
        │   │           ├── usbconfig.h
        │   │           ├── usbconfig-prototype.h
        │   │           ├── usbdrvasm.asm
        │   │           ├── usbdrvasm.S
        │   │           ├── usbdrv.c
        │   │           ├── usbdrv.h
        │   │           ├── USB-ID-FAQ.txt
        │   │           ├── USBID-License.txt
        │   │           ├── USB-IDs-for-free.txt
        │   │           └── usbportability.h
        │   └── SparkKeyboard
        │       ├── ascii-map.txt
        │       ├── base-mods.txt
        │       ├── layouts
        │       │   └── pt-br
        │       │       ├── main.cpp
        │       │       └── main.h
        │       └── main.h
        ├── main.cpp
        └── shared
            └── utils
                └── blink-alert
                    ├── main.cpp
                    └── main.h
    
    22 directories, 58 files
    

    Error:

    ➜  SparkType git:(main) ✗ make
    /tmp/arduino-cli compile \
    --fqbn digistump:avr:digispark-tiny \
    --output-dir build \
    .
    /home/yyax/Projects/SparkType/src/lib/arduino-libraries/DigisparkKeyboard/src/usbdrvasm.S:385:17: fatal error: asm/usbdrvasm16.inc: No such file or directory
     #       include "asm/usbdrvasm16.inc"
                     ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    
    Used platform Version Path
    digistump:avr 1.7.5   /home/yyax/.arduino15/packages/digistump/hardware/avr/1.7.5
    Error during build: exit status 1
    make: *** [Makefile:9: compile] Error 1
    ➜  SparkType git:(main) ✗
    
  3. Yyax13 commented on Jan 21, 2026

    @Yyax13
    Author

    if i use absolute path the problem solves
    but i can't as is a open source project

  4. cmaglie commented on Jan 21, 2026

    @cmaglie
    Member

    Thanks, can you run the compile with verbose enabled -v and copy the command that produces the include error?

    /home/yyax/Projects/SparkType/src/lib/arduino-libraries/DigisparkKeyboard/src/usbdrvasm.S:385:17: fatal error: asm/usbdrvasm16.inc: No such file or directory
     #       include "asm/usbdrvasm16.inc"
                     ^~~~~~~~~~~~~~~~~~~~~
    
  5. Yyax13 commented on Jan 21, 2026

    @Yyax13
    Author

    Thanks, can you run the compile with verbose enabled -v and copy the command that produces the include error?

    /home/yyax/Projects/SparkType/src/lib/arduino-libraries/DigisparkKeyboard/src/usbdrvasm.S:385:17: fatal error: asm/usbdrvasm16.inc: No such file or directory
     #       include "asm/usbdrvasm16.inc"
                     ^~~~~~~~~~~~~~~~~~~~~
    

    of course, but can you wait smt like 5 hours? i'm not in my lab so i can't run it now

  6. cmaglie commented on Jan 21, 2026

    @cmaglie
    Member

    can you wait smt like 5 hours? i'm not in my lab so i can't run it now

    Yes, there is no rush. I'm going AFK too; we could continue tomorrow.

  7. martin-eden commented on May 22, 2026

    @martin-eden
  8. per1234 commented on May 22, 2026

    @per1234
    Contributor

    Here is a minimal sketch to demonstrate the lack of .inc file support, without all the irrelevant complexity @Yyax13 crammed into their report:

    3083.zip

    3083/
    ├── 3083.ino
    └── foo.inc
    
    $ arduino-cli  version
    
    arduino-cli  Version: 1.5.0 Commit: dd407d42d Date: 2026-05-21T20:11:07Z
    
    $ arduino-cli  compile --fqbn arduino:zephyr:unoq
    
    E:\3083\3083.ino:1:10: fatal error: foo.inc: No such file or directory
        1 | #include "foo.inc"
          |          ^~~~~~~~~
    compilation terminated.
    
    [...]
    

    The contents of the sketch build folder:

    sketch/
    └── 3083.ino.cpp.merged
    

    (note foo.inc was not copied to the build folder)

  9. changed the title [-]Please add support to #include "file.inc". We need .inc[/-] [+]Add support for `.inc` file extension in additional sketch code files[/+] on May 22, 2026
  10. per1234 commented on May 22, 2026

    @per1234
    Contributor

    Note this is specific to sketch code files. #include directives for local files with any arbitrary extensions work in libraries. So those who use the "DigisparkKeyboard" library as intended would not experience any problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions