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

[macOS] Xcode "Clean build folder..." aka <cmd-shift-K> removes bin/data directory #8276

Closed
artificiel opened this issue Feb 22, 2025 · 13 comments
Assignees
Milestone

Comments

@artificiel
Copy link
Contributor

it that the new expected behaviour?

macOS14.4 with of-git 20250222 and project made with PG 0.67.0 (20250115)

@ofTheo
Copy link
Member

ofTheo commented Feb 22, 2025

100% not!
I think maybe there is a mistake setting the build folder to bin/

cc @dimitre @danoli3

@dimitre
Copy link
Member

dimitre commented Feb 22, 2025

Awful issue
My guess it is related to templates, like a sister issue of this one
#8268

I'm not touching templates I'm not able to understand how they work right now.

@ofTheo
Copy link
Member

ofTheo commented Feb 22, 2025

Looking into this and #8268 and the suggestion in #8268 doesn't address/fix either issue.
Also if you look at the GIt Blame those changes have been around for 4+ months at this point.

https://github.com/openframeworks/openFrameworks/blame/master/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig

CONFIGURATION_BUILD_DIR = $(SRCROOT)/bin/

has been around since 0.12.0.

In fact testing an 0.12.0 project it has an exact same setting for CONFIGURATION_BUILD_DIR and DerrivedData.
The only difference is that clean in 0.12.0 results in "Clean Failed" so maybe something got fixed in the nightly making clean work again and now its trashing bin/ successfully where as before it failed.

ie: this is not really a new bug, but exposing a very old bug now that clean is actually working.

@ofTheo
Copy link
Member

ofTheo commented Feb 22, 2025

The closest thing I have found to a fix is if we comment out
CONFIGURATION_BUILD_DIR = $(SRCROOT)/bin/

And use:
BUILD_DIR = ${PROJECT_DIR}/bin

But this has the downside of building this way:

Image

If there is a way to stop Xcode creating the Debug/ and Release/ subfolders we should have a working fix.
Cleaning when BUILD_DIR = ${PROJECT_DIR}/bin doesn't trash the data folder.

@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025 via email

@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025

Best to actually used derived data as default, (normal Xcode build locations) and rsync /data to the binary there, copy the final .app to the bin folder as last pass for OSX if developer wants to run it directly or distribute

for other platforms automatically goes into the derived data folder

@danoli3 danoli3 self-assigned this Feb 23, 2025
@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025

I'll fix this now

@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025

Fixed #8277

@danoli3 danoli3 closed this as completed Feb 23, 2025
@danoli3 danoli3 added this to the 0.12.1 milestone Feb 23, 2025
@artificiel
Copy link
Contributor Author

same behaviour:

  1. quit/restart PG 0.67.0 and point to fresh git clone a0707890270ed8bc5e6b33fd9f0485496726beb9
  2. generate new project from OS X (Xcode) template, outside OF folder to ensure absolute OF_PATH
  3. open in IDE
  4. clean -> failed
  5. build
  6. clean -> success but bin/ disappears
  7. PG update -> re-creates empty bin/data/.gitkeep
  8. build
  9. clean -> success but bin/ disappears

Project.xcconfig.zip

@danoli3 danoli3 reopened this Feb 23, 2025
@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025

confirmed clean is still messed up a stray BUILD_TARGET_DIR remains

@danoli3
Copy link
Member

danoli3 commented Feb 23, 2025

@artificiel fixed #8278

@danoli3 danoli3 closed this as completed Feb 23, 2025
@ofTheo
Copy link
Member

ofTheo commented Feb 23, 2025

@danoli3 can you point to what in #8278 fixes the issue?

@artificiel
Copy link
Contributor Author

artificiel commented Feb 23, 2025

@danoli3 progress is made: the bin/data dir now stays alive (and the DerivedData/$APP/Build dir gets cleaned)!

BUT: the binary in bin/data is not executable (and it's the one in DerivedData that gets launched).

ASLO: archive/export built products provides an empty directory. enabling CODESIGN seems to work, but again export/archive does not allow one to verify and interact with the App Store as was previously possible (see at the bottom).

(update screenshot with better views)
Image

Image

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

4 participants