-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for projects exported as a zip file (affects online compiler) #9967
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
Conversation
@bridadan, thank you for your changes. |
@bridadan Unless I'm mistaken, I think that the conditional exporting was a good thing, at least offline. |
@theotherjimmy was the idea there that you wouldn't blow away your new configuration if you re-export? The trouble there is if you re-zip and the files are present, then they will not be re-generated and therefore not re-zipped. Perhaps if you supply "export to a zip", it can always re-generate or something? |
Oh dear I seem to have broken many a tools test. |
811baaa
to
3245192
Compare
parent_name_parts = components[:n] | ||
if into_path: | ||
parent_name_parts.insert(0, into_path) | ||
parent_name = self._sep.join(parent_name_parts) |
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.
@theotherjimmy I believe this is the correct fix (see my commit message). If you have any concerns about this let me know.
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.
You're correct. That's the fix.
3245192
to
a86b4b9
Compare
@theotherjimmy I've removed the commit that enabled unconditional generation of vscode files to ensure we don't wipe out any user-made changes. If we'd like to revisit that behavior in the future, we should probably do it for all exporters at the same time. @ARMmbed/mbed-os-maintainers I'm done with my changes pending any other comments. |
tools/targets/lint.py
Outdated
@@ -29,6 +29,7 @@ | |||
from copy import copy | |||
from yaml import dump_all | |||
import argparse | |||
from past.builtins import basestring |
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.
is basestring being used? if so, please ignore this comment
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.
I can't ignore your comments 😄 Yeah its used later in the file.
Note: Still waiting on #9995 |
The FileRefs allow you to preserve the correct file paths in the online compiler. It also allows you to preserve the correct file paths for generated files.
This file was being dumped to the filesystem without going through the "gen_file" mechanism, thus it was missed when being zipped up.
When zipping up projects, the makefile exporter brings every directory supplied as --source under the same directory, even if they are in a parent directory. There was some code that was clearing the leading "../" components. This lead to an empty string ("") being supplied to the "into_path" arg for "resources.add_directory". Since "" is not None, the default behavior to place it in the same directory was not being used. The extra "" caused a leading "/" to be added, making everything placed a the absolute root of the filesystem ("/"). Now we check to see if the "into_path" is an empty string and ignore it if that's the case.
a86b4b9
to
60910c0
Compare
Rebased! |
Also #9995 was merged some time ago. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
This is a follow up to #9947 in an attempt to fix #8411.
Currently depends on #9995 and #9964.
NOTE I do not have a vscode environment to test these changes, however I can see the
.vscode
directory is now being included correctly.@janjongboom may have an interest in testing this as well.
To test this, you'll need to run the following command in an mbed-os project:
(The
-z
is so the project will be zipped up)Pull request type
Reviewers
@naveenkaje
@theotherjimmy (there was also an issue when Makefiles were zipped up, perhaps you can double check my resources change)
Release Notes