-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
"briefcase clean" command to delete all build artifacts #1859
Comments
I understood your original request from #1830 as essentially "a wrapper around However, based on this description, it sounds like you're talking about a more fine grained "clean" from the perspective of the Xcode (or whatever) project itself. This is a lot harder for me to get behind. In terms of the broader goals of Briefcase, any manual modification to the build folder is a bug - it should be considered entirely ephemeral. If you've got manual modifications you need to make to the templated project, the current recommended suggestion is to fork the template for your backend of choice, and make the modifications there. In terms of your specific workflow, it isn't clear to me why an "Xcode clean" is needed at all. You mention "cleaning up build artefacts"... but... why? What artefacts need to be cleaned up? If you are making manual modifications to the Xcode project file... make those changes and rebuilt. Why is a "clean" required at all? Xcode will do an updated build when you modify the Xcode project. |
I guess my question would be why are things created by
generally speaking you're right to think that in a perfect world it shouldn't be necessary to have a (also peace of mind is valuable, but i digress) bigger picture just as far as xcode's "clean build folder" option IMHO xcode's heuristic where it decides what build steps need to be run after a recent set of changes is (again IMHO) close to fundamentally broken. it's way too easy to create an xcode build process here you assume xcode is going to do Step X every time you press "build" but because of the way you've configured the build xcode's heuristic just decides that doesn't need to run Step X because it ran it during the last build. seen it happen many, many times just in the last few weeks (not here, but in a react native app with a lot of cocoapods dependencies). in particular xcode seems really good at getting itself into a situation where cleaning the build dir is fully necessary if anything went wrong during the last build, at least in the react native project i've been working on simultaneously as my briefcase app. |
just $0.02 but forking a whole separate template repo to change 1 line is kind of a PITA compared to just making my desired 1-2 lines of changes to a FWIW i did this - commit the
as a nice side effect i was able to observe what xcode itself changes in |
fwiw one of the things that made me raise my eyebrow about why perhaps files templated by
there's nothing inherently wrong with it but it does kind of imply that there's some silent semantic overloading going on with the word "build" |
The naming follows the historical Python convention of putting intermediate artefacts in The complication is that Briefcase requires a step before "invoking a compilation step", because the project sources don't contain all the code needed to perform the "compilation". We call the "fill in the blanks" step "create", and the compilation step "build". If the name
I can't speak to your personal experience, but I can't say this has ever been the case for me. The only issues I've ever had with a "clean" build have more to do with OS-level caching, or artefacts that are left on disk in the installed location for an iOS simulator. In this case a "clean" build doesn't fix anything; you need to delete the app from the simulator (and sometimes restart the simulator). I'll also note that, in terms of Briefcase's design approach - if your build folder is ephemeral, and you're hitting one of these "2% cases" that you describe, deleting the build folder and recreating the project solves the issue completely.
The key word in my reply is currently. I make no claim that this is a great developer experience; however, it's an approach that is consistent with the broader goal of Briefcase that the build folder is entirely ephemeral. As I've indicated on other tickets (#1861), we're open to adding additional configuration points that reduce the need for manual modifications to the Xcode (or any other) project template.
If you're having success with this technique, then good luck with that. What I'm flagging is that, as a project, we make zero guarantees that this workflow will continue to work, and we're not going to make feature modifications designed to support or reinforce this use case.
To be clear: is this "briefcase didn't work" or "I've got a very specific set of requirements in my app that aren't part of the advertised feature set of Briefcase"? To me, it sounds like the latter.
You may have noticed that Briefcase supports multiple operating systems, using the platform-provided tools. Xcode uses a subfolder called "build". So does Gradle when building for Android, but the location inside the generated code is different. On Windows, Visual Studio uses a folder named "Release". We're not in control of how the platforms structure their compilation artefacts - we have to accomodate what they provide. And, again, from Briefcase's perspective - you shouldn't ever need to look in the top level |
This discussion is rapidly ratholing into microlitigating some fairly fundamental aspects of the design of Briefcase, unrelated to the original topic of this ticket. To summarise my current position:
The original PR was effectively (1), implemented using the interface for (2). |
just to be clear i've never had any issue along these lines with briefcase. briefcase has worked impressively well for me. where i've run into this issue is with the React Native part of my app which i'm bundling together with the briefcase part. the underlying problem is that Xcode is good at understanding when it needs to recompile / link / whatever code changes to source files managed by Xcode but the approach it uses to figure out whether build scripts need to be re-run is (IMHO) fundamentally extremely broken when it comes to stuff not managed by Xcode. react native is kind of custom made to run into this issue. unfortunately bc i had these frustrating issues with the React Native part of my app I found myself wanted to just clear out all my app's build artifacts bc at the time i had no idea what was the actual problem (i know a bit better now) and part of my app is built by briefcase.
good to know, but also kind of expected. given that my
you are correct; it was the latter.
the more i understand about how briefcase works the more i think you could almost totally solve this just by adding a couple of these additional configuration points. |
What is the problem or limitation you are having?
I opened a PR for discussion earlier that jump started a discussion but as i've gone through the workflow a bit more I realized that my quick off the cuff implementation would not have provided the feature i actually want. Here's a concrete explanation of why a
briefcase clean
or similar option be useful to me and why the current situation is a bit rough:Situation
I have setup a
macos Xcode
project withbootstrap create
and then made manual minor modifications to theproject.pbxproj
to get a couple of compile flags in there that i want. i would like to be able to clean up build artifacts but not have to runbriefcase create
all over again.My current workflow for cleaning and rebuilding looks something like this:
rm -fr build/illmaticapp/macos/xcode
(not strictly necesssary bc step 2 will do this anyways but illustrative)briefcase create macos Xcode
git checkout build/illmaticapp/macos/xcode/Illmatic App.xcodeproj/project.pbxproj
(to get my changes back - i have my customizations stored in version control)briefcase build macos Xcode
Describe the solution you'd like
.xcodeproj
dir is a product ofbriefcase create
I would like an approach to cleaningbuild
artifacts that doesn't also blow away thecreate
artifacts.briefcase clean
would also have some kind of intelligence and or optionality around blowing away 3rd partyapp_packages
for the various python package / chip architecture combinations because as far as i know those aren't always really "build products" of the app being developed1, they're just fixtures downloaded frompypi
or whatever and avoiding redownloading them would speed things up considerably.The
build/illmaticapp/macos/xcode
dir has a whole lot of stuff going on though so as a semi-new user it's very unclear to me what should be deleted when i'm trying to delete build artifacts so i end up having to recreate from scratch every time.Describe alternatives you've considered
We discussed on my PR the possibilities of:
rm -fr build/macos/
(not ideal for reasons outlined above)briefcase clean macos Xcode
(@freakboy3742's suggestion which is in line with classic hits of the 1970s likemake clean
and makes a lot of sense to me for that reason)briefcase build macos Xcode --clean
(my original suggestion, which made sense to me as a new user - the first place i was looking for any kind of build cleanup option was by runningbriefcase build --help
)Additional context
No response
Footnotes
At least, as far as I know. Briefcase's packaging has worked so well for me that I've never had to look into the details of whate is or isn't happening as far as importing 3rd party packages into the bundle other than this situation, where i'm looking to be absolutely sure no artifacts of previous builds could possibly be interfering / causing problems with the next build. ↩
The text was updated successfully, but these errors were encountered: