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

Opening example with .pde file extension fails silently #2377

Closed
3 tasks done
per1234 opened this issue Feb 20, 2024 · 2 comments · Fixed by #2381
Closed
3 tasks done

Opening example with .pde file extension fails silently #2377

per1234 opened this issue Feb 20, 2024 · 2 comments · Fixed by #2381
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Feb 20, 2024

Describe the problem

If the example for a library has .pde file extension, Arduino IDE will silently fail to open it.

To reproduce

  1. Use Library Manager to install version "1.64.0" of the "AccelStepper" library from Library Manager
  2. Select File > Examples > AccelStepper > AFMotor_ConstantSpeed

🐛 The example doesn't open. There is no communication of a problem.

Expected behavior

Arduino IDE opens all valid example sketches, regardless of whether they use a deprecated file extension.

Arduino IDE version

2.3.2

Operating system

Windows

Operating system version

11

Additional context

I see the following in the logs when I try to open the example:

2024-02-20T12:47:15.376Z root ERROR Request cloneExample failed with error: ENOENT: no such file or directory, rename 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' -> 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' Error: ENOENT: no such file or directory, rename 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' -> 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino'

I bisected the regression to 074f654 (does not occur with the build for the previous commit 3eef857)


This is a regression of #518


Originally reported by @drf5n at:

https://forum.arduino.cc/t/accelstepper-library-examples-dont-open-with-arduino-ide-2-3-1/1226308/2

Workaround

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Take note of the path shown in the "Sketchbook location" field of the dialog.
  3. Click the "CANCEL" button.
    The "Preferences" dialog will close.
  4. Select File > Open... from the Arduino IDE menus.
  5. Navigate to the libraries subfolder of the path you saw in the "Sketchbook location" field during step (2) of these instructions.
  6. You will see a list of the installation folders of each of the libraries you have installed. Scroll through the list until you find the library for which you want to open an example sketch.
  7. Open the folder of the library and then the examples subfolder.
  8. There you will see a list of the folders of each of the example sketches provided by the library. Open the folder of the example you want to open.
  9. Select the .pde file in the folder.
  10. Click the "Open" button.

The example sketch will now open in an Arduino IDE window as usual.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 20, 2024
@drf5n
Copy link

drf5n commented Feb 20, 2024

This is broken in IDE 2.3.2.

For example, try opening the:

File/Examples/AccelStepper/Bounce example that refers to this file on my Mac:

/Users/drf/Documents/Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde

Using the workaround for a differential test, rename your Random.pde to Random.ino within its library directory and the Arduino IDE will open it as usual.

For example:

/Users/drf/Documents/Arduino/libraries/AccelStepper/examples/Random/Random.ino

...functions as expected.

Tested on MacOS Sonoma 14.2.1 on Apple Silicon M2

image

No screen shot of the silent failure.


I find these other .pde files in my libraries:

libraries % find . -name "*.pde" -print
./TinyWireM/examples/Tiny85_Temp_LCD_RTC/Tiny85_Temp_LCD_RTC.pde
./TinyWireM/examples/Tiny85_Temp_LCD/Tiny85_Temp_LCD.pde
./TinyWireM/examples/Tiny85_Temp/Tiny85_Temp.pde
./Adafruit_BMP085_Unified/examples/sensorapi/sensorapi.pde
./AccelStepper/examples/MultipleSteppers/MultipleSteppers.pde
./AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
./AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde
./AccelStepper/examples/Blocking/Blocking.pde
./AccelStepper/examples/ProportionalControl/ProportionalControl.pde
./AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde
./AccelStepper/examples/MotorShield/MotorShield.pde
./AccelStepper/examples/DualMotorShield/DualMotorShield.pde
./AccelStepper/examples/Quickstop/Quickstop.pde
./AccelStepper/examples/MultiStepper/MultiStepper.pde
./AccelStepper/examples/Overshoot/Overshoot.pde
./AccelStepper/examples/Bounce/Bounce.pde
./AFMotorDrawbot/examples/MotorParty/MotorParty.pde
./AFMotorDrawbot/examples/MotorTest/MotorTest.pde
./AFMotorDrawbot/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
./AFMotorDrawbot/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde
./AFMotorDrawbot/examples/StepperTest/StepperTest.pde
./FreqMeasure/examples/Serial_Output/Serial_Output.pde
./FreqMeasure/examples/LCD_Output/LCD_Output.pde
./LiquidCrystal_I2C/examples/HelloWorld/HelloWorld.pde
./LiquidCrystal_I2C/examples/CustomChars/CustomChars.pde
./LiquidCrystal_I2C/examples/SerialDisplay/SerialDisplay.pde
./FrequencyTimer2/examples/Test/Test.pde
./Adafruit_LED_Backpack_Library/examples/custom_character/customgen/customgen.pde
./NXPMotionSense/OrientationVisualiser/OrientationVisualiser.pde
./FreqCount/examples/Serial_Output/Serial_Output.pde
./FreqCount/examples/LCD_Output/LCD_Output.pde

testing a few of these, I find they fail as well.

drf5n referenced this issue Feb 20, 2024
This commit rewrites how IDE copies sketches as part of the _Save As_
operation. Instead of copying to the destination, IDE copies the sketch
into a temporary location, then to the desired destination.

This commit drops [`cpy`](https://www.npmjs.com/package/cpy).
Ref: sindresorhus/cpy@47b89a7

Closes #2077

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Feb 22, 2024
Closes #2377

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Feb 22, 2024
Closes #2377

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Feb 22, 2024
@per1234
Copy link
Contributor Author

per1234 commented Mar 24, 2024

This is broken in IDE 2.3.2.

@drf5n that is expected. The fix was made after the time of the 2.3.2 release. Please always check with the latest nightly build of Arduino IDE before reporting problems:

https://www.arduino.cc/en/software#nightly-builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants