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

platformio.ini untouched, without src_dir #137

Closed
thinkyhead opened this issue Jul 17, 2017 · 31 comments
Closed

platformio.ini untouched, without src_dir #137

thinkyhead opened this issue Jul 17, 2017 · 31 comments

Comments

@thinkyhead
Copy link
Contributor

thinkyhead commented Jul 17, 2017

Operating system

macOS 10.12.5

Description of problem

Upon build, Deviot overwrites platformio.ini with the user's personal workspace data. It should not need to do this, and this workaround creates a nuisance and potential security risk for users of version control systems.

image

Steps to Reproduce

Do a new install of Deviot and PlatformIO. Use platformio.ini in the manner allowed and prescribed by platformio.ini documentation for a project that doesn't have or want a src folder.

Actual Results

The platformio.ini file is altered, leading to the possibility that unique local environment info will be checked in as a change to the global repository.

Expected Results

The platformio.ini file is read, properly groked by Deviot, and left untouched.

@gepd
Copy link
Owner

gepd commented Jul 17, 2017

To avoid that, select Options > Use PlatformIO Structure in the Deviot Menu

@gepd gepd added the Question label Jul 17, 2017
@fiveangle
Copy link

fiveangle commented Jul 27, 2017

Identical issue here, but selecting Options > Use PlatformIO Structure did not resolve. Windows 7, latest ST3/DevIoT and dev PIO (3.4.1a6):

untitled

diff

@gepd
Copy link
Owner

gepd commented Jul 27, 2017

I've pushed a fix, please use the developer branch following this instructions and let me know if that solved the problem.

@fiveangle
Copy link

fiveangle commented Jul 27, 2017

That was an amazingly easy switch to a realtime dev branch 👍

Fix appears to keep the bulk of the entries, but now removing the src_dir entry entirely:
still_broke

[ Deviot 2.0.1 ] Starting...
[07/26/17 21:55:56] Processing Re-ARM (extra_scripts: Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py; build_flags: !python Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py; lib_deps: U8glib-ARM; board_f_cpu: 100000000L; platform: nxplpc; lib_ldf_mode: off; src_filter: +<*> -<example_configurations> -<src/HAL/HAL_*> +<src/HAL/HAL_LPC1768>)
Verbose mode can be enabled via `-v, --verbose` option
Collected 3 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <U8glib-ARM> v1.18.1
Error: Nothing to build. Please put your source code files to 'C:\dev\github\Marlin\src' folder
 [ERROR] Took 7.95 seconds 
 [SUMMARY] 
Environment megaatmega2560  	[SKIP]
Environment megaatmega1280  	[SKIP]
Environment printrboard     	[SKIP]
Environment printrboard_revf	[SKIP]
Environment brainwavepro    	[SKIP]
Environment rambo           	[SKIP]
Environment DUE             	[SKIP]
Environment teensy35        	[SKIP]
Environment Re-ARM          	[ERROR]
 [ERROR] Took 7.96 seconds 

gepd added a commit that referenced this issue Jul 27, 2017
…the temp folder when "Use PlatformIO Structure" is activate

Improvement: the 'src_dir' flag will be added before compile/upload the sketch and remove after the task is finished
Issue: #137
@gepd
Copy link
Owner

gepd commented Jul 27, 2017

Ok, I've pushed new changes, please check and let me know if this time it work as you expect

@gepd gepd changed the title Deviot corrupting platformio.ini platformio.ini untouched, without src_dir Jul 27, 2017
@gepd
Copy link
Owner

gepd commented Aug 14, 2017

open this issue again if you keep having problems

@gepd gepd closed this as completed Aug 14, 2017
@fiveangle
Copy link

Sorry for not getting back to you. It didn't resolve the problem but I questioned how to tell that I was in fact picking up the changes, and haven't had time to figure that out.

@fiveangle
Copy link

fiveangle commented Aug 14, 2017

@thinkyhead - are you still having this problem ? (I switched to Atom to try and get PIO working for the Re-ARM hw since DeVIoT appeared to not like the newer multi-line syntax for library inclusion as well as the src dir issue you reported)

@gepd
Copy link
Owner

gepd commented Aug 14, 2017

You keep getting the error or the changes didn't remove the src_dir?

@fiveangle
Copy link

fiveangle commented Aug 14, 2017

Changes did remove the src_dir entry, and so would get error that it couldn't find the source files. It would leave all entries except src_dir, so it was partially fixed. This is the repo: https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x
https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/platformio.ini

@gepd
Copy link
Owner

gepd commented Aug 14, 2017

That is weird, I did replicate your issue the first time but after the last commit I don't got it anymore.

The new multi-line syntax should work too, but you should check if you have installed the last version of platformio

@gepd gepd reopened this Aug 14, 2017
@fiveangle
Copy link

since you're intersted in fixing, I'll try to prioritize this

@gepd
Copy link
Owner

gepd commented Aug 14, 2017

Thanks I appreciate that

If you still have installed deviot please try deselect Options > Use PlatformIO Structure since after the last changes I made, this behavior changed

@fiveangle
Copy link

fiveangle commented Aug 16, 2017

Opened project ./platformio.ini and ./Marlin/Marlin.ino. With ino tab active, attempted to select Environment and option was greyed-out. Edited platformio.ini to remove multi-line lib_deps and put on single comma-separated line and env was then available:

env_available

Ensured "Use platformio structure" unselected in Deviot

Selected Re-ARM, Compile, and it looks to have succeeded:

arm-none-eabi-objcopy -O binary .pioenvs/Re-ARM/firmware.elf .pioenvs/Re-ARM/firmware.bin
text	   data	    bss	    dec	    hex	filename
9844	    472	     44	  10360	   2878	.pioenvs/Re-ARM/firmware.elf
========================= [SUCCESS] Took 8.70 seconds =========================
================================== [SUMMARY] ==================================
Environment megaatmega2560  	[SKIP]
Environment megaatmega1280  	[SKIP]
Environment printrboard     	[SKIP]
Environment printrboard_revf	[SKIP]
Environment brainwavepro    	[SKIP]
Environment rambo           	[SKIP]
Environment DUE             	[SKIP]
Environment teensy35        	[SKIP]
Environment Re-ARM          	[SUCCESS]
========================= [SUCCESS] Took 8.70 seconds =========================

Reviewed changes to source, and found platformio.ini changed beyond the edit to consolidate the multi-line lib_deps, including removal of src filter for the selected Re-ARM env:

platformio ini corrupted

ps- Let me know if you want me to open a new issue for the multi-line lib_deps issue.

@gepd
Copy link
Owner

gepd commented Aug 16, 2017

yes, would be good to open a new issue, so it will more easy to follow and better for future search from other users

@fiveangle
Copy link

fiveangle commented Aug 26, 2017

fyi... you probably already know this, but I just retested after resolution of the multi-line lib_deps issue and it seems to be moving backwards a bit, as it's now also strippinng comments and swashing multi blank/trailing lines :)

screen shot 2017-08-25 at 8 26 35 pm

@gepd
Copy link
Owner

gepd commented Aug 27, 2017

I didn't know about that, I'll copy you coment to the other issue and will let it open it to fix that

@fiveangle
Copy link

It seems the subject should be changed back to it's original:

@gepd gepd changed the title from Deviot corrupting platformio.ini to platformio.ini untouched, without src_dir on Jul 27

@gepd
Copy link
Owner

gepd commented Sep 5, 2017

I don't think so, technically, the platformio file isn't corrupted, you can work with it, and the curruption word is more related to an error

@fiveangle
Copy link

fiveangle commented Sep 21, 2017

This appears to be fixed too 👍 (as long as "User PIO Structure" is not selected)

Thanks @gepd !

@gepd
Copy link
Owner

gepd commented Sep 21, 2017

I didn't note it changed something when Use PIO Structure is selected, I'll check again to make it compatible as well

@fiveangle
Copy link

fiveangle commented Sep 21, 2017

I originally had Use PIO Structure selected and got compile errors, but did not mean to indicate deviot changed the files. I agree it would be good to confirm it doesn't just to be sure. (I can't check right now as not at my system).

Thanks again for the great plugin ! ST3+Deviot/PIO is soooooo much better than Atom 🥇

-=dave

@fiveangle
Copy link

Okay, latest report (soooooo close):

When select "Compile", DevIoT will immediately duplicate first lib_deps = line in a multi-line format lib_deps statement:

screen shot 2017-09-24 at 12 01 16 am

Selecting "Use PIO Structure" results in expected compile failure (cannot find source files) but lib_deps = line is duplicated same as when "Use PIO Structure" is not selected. Good news is that the extra "lib_deps =" line does not cause compile to fail.

I do not know if this is related to the fix for this issue, #144, or entirely new. Let me know if you would like me to open a separate issue, continue here, or re-open #144.

Thanks,

-=dave

@gepd
Copy link
Owner

gepd commented Sep 24, 2017

Fixed. You shouldn't have this problem in v2.2.0-dev.5 and now it should have the same behavior with Use PIO Structure and without

@fiveangle
Copy link

fiveangle commented Sep 25, 2017

v2.2.0-dev.5 does not duplicate the lib_deps = entry in either PIO structure mode and regular, so that is fixed 👍

However, if the environment selected contains a lib_extra_dirs entry, it removes it on Compile:

screen shot 2017-09-25 at 8 58 11 am

gepd added a commit that referenced this issue Sep 26, 2017
…viot before compile or upload (Issue: #137)

- Factorized code to avoid write platformio.ini when it's not neccesary. This will avoid to re-compile the project when it's not neccesary (Issue: #175)
- Re-organized Deviot menu
- Minor language strings updates
@gepd
Copy link
Owner

gepd commented Sep 26, 2017

I've added a new option in Deviot Menu> Compile / Upload Options> platformio.ini untouch to activate this feature, in the last commit I've solve the lib_extra_dirs problem too.

As reference, read this issue to know why was neccesary to add this option

It's available in 2.2.0-dev.6

@fiveangle
Copy link

fiveangle commented Oct 7, 2017

Without "platformio.ini untouch" option selected (default), platformio.ini gets changed with many critical lines missing.
With "platformio.ini Untouch" option selected, compile does not proceed and entire contents of platformio.ini is deleted.

I think it may be easier for you to see the problem yourself by simply download this repo snapshot:

And perform the following (restarting where required):
Install Windows 7 Professional 64-bit and all updates
Install git for Windows (selecting adding to PATH as appropriate)
Install Python 2.7.14 for Windows (selecting adding to PATH as appropriate)
Install Sublime Text 3 for WIndows 64-bit
Install Package Control
Add Deviot dev repo
Install Deviot dev edition [ Deviot 2.2.0-dev.9 ]
Select Deviot : Options : Full Verbose Output when building
Select Deviot : Options : Install PIO development version
Download repo snapshot: https://github.com/fiveangle/Marlin/archive/bf20-pb_simple_metal.zip
open Marlin/Marlin/Marlin.ino from snapshot directory tree
Select Deviot : Environment : Teensy 2.0++ Select Deviot : Compile/Upload options : platformio.ini Untouch
Select Deviot : Compile (observe above error)
De-select Deviot : Compile/Upload options : platformio.ini Untouch
Select Deviot : Compile (observe platformio.ini has many critical lines removed and error "please move src directory to Marlin/src and unable to compile).

@gepd gepd added this to the v2.2 milestone Oct 21, 2017
@fiveangle
Copy link

As of 2.2.0 d12, without "platformio.ini untouch" option, the platformio.ini file appears to remain untouched. As far as I know this can likely be closed for the orginal issue it was opened for.

However with the new "platformio.ini untouch" option enabled, platformio.ini file ironically is very much touched, as it's entire content is deleted 😆

-=dvae

@thinkyhead
Copy link
Contributor Author

I haven't been using Deviot for a few months while awaiting patches, but I will give the latest version a shot. Thanks for being diligent about these issues!

@fiveangle
Copy link

@thinkyhead - you have to enable dev Deviot branch (currently rev12), plus enable Use development PIO, and don't enable "platformio.ini untouch" and it's been working like a charm.

@thinkyhead
Copy link
Contributor Author

Great! I really want to get back to building Marlin 2.0.x for the other platforms. I've got boards to flash!

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

No branches or pull requests

3 participants