diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index f2f63f53..eb030cc4 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -29,14 +29,14 @@ jobs: steps: # - name: Install libunwind # run: sudo apt-get install libunwind-dev wget2 - + - uses: actions/checkout@v4 - + - name: ccache uses: hendrikmuhs/ccache-action@v1.2.14 with: key: ${{ matrix.cfg.target }} - + - name: Determine Release id: vars shell: bash @@ -56,19 +56,19 @@ jobs: fi TAG_NAME=${GITHUB_REF#refs/tags/} echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV - + - name: Install run: ./scripts/linux/ci_install_core.sh - + - name: List directory run: ls -lah ./ - + - name: Build run: ./../openFrameworks/apps/projectGenerator/scripts/linux/build_cmdline.sh - - name: Test cmdline + - name: Test cmdline run: ./../openFrameworks/apps/projectGenerator/scripts/linux/test_cmdline.sh - + - name: List output directory run: ls -lah ./../openFrameworks/apps/projectGenerator/commandLine/bin @@ -76,28 +76,6 @@ jobs: run: | cp ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator ./../openFrameworks/apps/projectGenerator/frontend/app/projectGenerator chmod 755 ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator - - - name: Build and Package projectGenerator Linux GUI - shell: bash - run: | - cd ../openFrameworks/apps/projectGenerator/frontend - npm install - npm update - npm run dist:linux64 - cd dist - pwd - ls - - - name: Build and Package projectGenerator Linux GUI - shell: bash - run: | - cd ../openFrameworks/apps/projectGenerator/frontend - npm install - npm update - npm run dist:linux:arm64 - cd dist - pwd - ls - name: Build and Package projectGenerator Linux GUI shell: bash @@ -105,7 +83,7 @@ jobs: cd ../openFrameworks/apps/projectGenerator/frontend npm install npm update - npm run dist:linux:armv7l + npm run dist:linux64 cd dist pwd ls @@ -116,18 +94,8 @@ jobs: - name: Copy GUI tarball to root directory run: | cd ./../openFrameworks/apps/projectGenerator/frontend/dist - mv projectGenerator-0.95.0.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-gui.gz - - - name: Copy GUI tarball to root directory - run: | - cd ./../openFrameworks/apps/projectGenerator/frontend/dist - mv projectGenerator-0.95.0-arm64.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-arm64-gui.gz + mv projectGenerator-*.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-gui.gz - - name: Copy GUI tarball to root directory - run: | - cd ./../openFrameworks/apps/projectGenerator/frontend/dist - mv projectGenerator-0.95.0-armv7l.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-armv7l-gui.gz - - name: Test Artefact zip run: | cd ./../openFrameworks/apps/projectGenerator/commandLine/bin/ @@ -154,26 +122,160 @@ jobs: tag_name: ${{ env.RELEASE }} files: projectGenerator-linux-gui.gz - - name: Update Release Linux gui - arm64 + - name: Update Latest Tag - DateTime + uses: EndBug/latest-tag@latest + if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + with: + ref: nightly + description: Latest Always Nightly Builds + force-branch: true + + # Ubuntu 22.04 build - older glibc baseline, covers users/distros that can't + # run binaries linked against 24.04's newer glibc. + build-linux-ubuntu22: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + key: ubuntu22-linux + + - name: Determine Release + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=bleeding" >> $GITHUB_ENV + else + echo "RELEASE=bleeding" >> $GITHUB_ENV + fi + + - name: Install + run: ./scripts/linux/ci_install_core.sh + + - name: Build + run: ./../openFrameworks/apps/projectGenerator/scripts/linux/build_cmdline.sh + + - name: Test cmdline + run: ./../openFrameworks/apps/projectGenerator/scripts/linux/test_cmdline.sh + + - name: Copy commandLine to frontend + run: | + cp ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator ./../openFrameworks/apps/projectGenerator/frontend/app/projectGenerator + chmod 755 ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator + + - name: Build and Package projectGenerator Linux GUI + shell: bash + run: | + cd ../openFrameworks/apps/projectGenerator/frontend + npm install + npm update + npm run dist:linux64 + + - name: Copy GUI tarball to root directory + run: | + cd ./../openFrameworks/apps/projectGenerator/frontend/dist + mv projectGenerator-*.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-ubuntu22-gui.gz + + - name: Test Artefact zip + run: | + cd ./../openFrameworks/apps/projectGenerator/commandLine/bin/ + tar -cjf projectGenerator-linux-ubuntu22.tar.bz2 projectGenerator + mv projectGenerator-linux-ubuntu22.tar.bz2 $GITHUB_WORKSPACE/projectGenerator-linux-ubuntu22.tar.bz2 + + - name: Update Release Linux ubuntu22 if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') uses: softprops/action-gh-release@v2.0.8 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} - files: projectGenerator-linux-arm64-gui.gz + files: projectGenerator-linux-ubuntu22.tar.bz2 - - name: Update Release Linux gui - armv7l + - name: Update Release Linux gui ubuntu22 if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') uses: softprops/action-gh-release@v2.0.8 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} - files: projectGenerator-linux-armv7l-gui.gz + files: projectGenerator-linux-ubuntu22-gui.gz - - name: Update Latest Tag - DateTime - uses: EndBug/latest-tag@latest - if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + # Native arm64 build for Raspberry Pi (64-bit Raspberry Pi OS / Ubuntu on Pi 3+). + # Runs on a real arm64 runner so the commandLine binary is actually arm64 - + # the previous armv7l/arm64 GUI packages just repackaged the x64 binary built + # above, which can't run on arm hardware at all. + build-linux-arm64: + runs-on: ubuntu-22.04-arm + steps: + - uses: actions/checkout@v4 + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.14 with: - ref: nightly - description: Latest Always Nightly Builds - force-branch: true + key: arm64-linux + + - name: Determine Release + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=bleeding" >> $GITHUB_ENV + else + echo "RELEASE=bleeding" >> $GITHUB_ENV + fi + + - name: Install + run: ./scripts/linux/ci_install_core.sh + + - name: Build + run: ./../openFrameworks/apps/projectGenerator/scripts/linux/build_cmdline.sh + + - name: Test cmdline + run: ./../openFrameworks/apps/projectGenerator/scripts/linux/test_cmdline.sh + + - name: Copy commandLine to frontend + run: | + cp ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator ./../openFrameworks/apps/projectGenerator/frontend/app/projectGenerator + chmod 755 ./../openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator + + - name: Build and Package projectGenerator Linux GUI + shell: bash + run: | + cd ../openFrameworks/apps/projectGenerator/frontend + npm install + npm update + npm run dist:linux:arm64 + + - name: Copy GUI tarball to root directory + run: | + cd ./../openFrameworks/apps/projectGenerator/frontend/dist + mv projectGenerator-*-arm64.tar.gz $GITHUB_WORKSPACE/projectGenerator-linux-arm64-gui.gz + + - name: Test Artefact zip + run: | + cd ./../openFrameworks/apps/projectGenerator/commandLine/bin/ + tar -cjf projectGenerator-linux-arm64.tar.bz2 projectGenerator + mv projectGenerator-linux-arm64.tar.bz2 $GITHUB_WORKSPACE/projectGenerator-linux-arm64.tar.bz2 + + - name: Update Release Linux arm64 + if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.0.8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.RELEASE }} + files: projectGenerator-linux-arm64.tar.bz2 + + - name: Update Release Linux gui arm64 + if: github.repository == 'openframeworks/projectGenerator' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.0.8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.RELEASE }} + files: projectGenerator-linux-arm64-gui.gz diff --git a/.github/workflows/build-vs.yml b/.github/workflows/build-vs.yml index a4c1d553..bc4c43e4 100644 --- a/.github/workflows/build-vs.yml +++ b/.github/workflows/build-vs.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - uses: msys2/setup-msys2@v2 with: update: true diff --git a/commandLine/App.xcconfig b/commandLine/App.xcconfig index 8e3b8d7a..7697dd20 100644 --- a/commandLine/App.xcconfig +++ b/commandLine/App.xcconfig @@ -2,4 +2,4 @@ OF_NO_FMOD = 1 OF_CORE_LIBS = $(LIB_GLEW) $(LIB_PUGIXML) OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_FREETYPE) $(HEADER_FREETYPE2) $(HEADER_FMOD) $(HEADER_GLEW) $(HEADER_FREEIMAGE) $(HEADER_TESS2) $(HEADER_CAIRO) $(HEADER_RTAUDIO) $(HEADER_GLFW) $(HEADER_UTF8) $(HEADER_JSON) $(HEADER_GLM) $(HEADER_CURL) ${HEADER_SSL} $(HEADER_URIPARSER) $(HEADER_PUGIXML) ${HEADER_BROTLI} -OF_CORE_FRAMEWORKS = -framework Accelerate -framework AGL -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework OpenGL -framework QuartzCore -framework Security -framework SystemConfiguration -framework Metal +OF_CORE_FRAMEWORKS = -framework Accelerate -framework AppKit -framework ApplicationServices -framework AudioToolbox -framework AVFoundation -framework Cocoa -framework CoreAudio -framework CoreFoundation -framework CoreMedia -framework CoreServices -framework CoreVideo -framework Foundation -framework IOKit -framework OpenGL -framework QuartzCore -framework Security -framework SystemConfiguration -framework Metal diff --git a/commandLine/src/addons/ofAddon.cpp b/commandLine/src/addons/ofAddon.cpp index 7e1546d3..0018e7c1 100644 --- a/commandLine/src/addons/ofAddon.cpp +++ b/commandLine/src/addons/ofAddon.cpp @@ -842,7 +842,24 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo s = fixPath(s); // alert("fixpath after " + ofPathToString(s)); addToFolder(s, parentFolder); - srcFiles.emplace_back(s); + + // getLibsRecursively picks up source files sitting alongside an + // addon's prebuilt libs (e.g. ofxLua's bundled lua/lpeg C sources). + // They must be classified by extension rather than dumped into + // srcFiles, or a .c file compiles as C++ and mangles its symbols + // (see #8546). + string ext = ofPathToString(s.extension()); + if (ext == ".c") { + csrcFiles.emplace_back(s); + } else if (ext == ".cpp" || ext == ".cc" || ext == ".cxx") { + cppsrcFiles.emplace_back(s); + } else if (ext == ".m" || ext == ".mm") { + objcsrcFiles.emplace_back(s); + } else if (ext == ".h" || ext == ".hpp") { + headersrcFiles.emplace_back(s); + } else { + srcFiles.emplace_back(s); + } } // so addons will never be system. diff --git a/commandLine/src/projects/baseProject.cpp b/commandLine/src/projects/baseProject.cpp index 5ef81c66..aa7e1ba1 100644 --- a/commandLine/src/projects/baseProject.cpp +++ b/commandLine/src/projects/baseProject.cpp @@ -22,7 +22,13 @@ baseProject::baseProject(const string & _target) : target(_target) { bLoaded = false; } -fs::path baseProject::getPlatformTemplateDir(std::string templateDir) { +fs::path baseProject::getPlatformTemplateDir() { + // This must always resolve to the platform's own base template (the one + // holding emptyExample.xcodeproj / platform Makefiles, etc.) - an extra + // template requested via `templateName` (gitignore, gl3.2, nofmod, ...) + // is layered on top afterwards via recursiveTemplateCopy and must never + // replace this folder, or createProjectFile() ends up copying from a + // template with no platform project file at all (see #8479). string folder { target }; if ( target == "msys2" || target == "linux" @@ -33,9 +39,6 @@ fs::path baseProject::getPlatformTemplateDir(std::string templateDir) { ) { folder = "vscode"; } - if (templateDir != "") { - folder = templateDir; - } return fs::weakly_canonical(getOFRoot() / templatesFolder / folder); } @@ -137,7 +140,7 @@ bool baseProject::create(const fs::path & _path, string templateName){ addons.clear(); extSrcPaths.clear(); - auto pathTemplate = getPlatformTemplateDir(templateName); + auto pathTemplate = getPlatformTemplateDir(); if (fs::exists(pathTemplate)) { templatePath = normalizePath(pathTemplate); } else { @@ -659,7 +662,7 @@ void baseProject::addSrcFiles(ofAddon& addon, const vector &filepaths, } fs::path normalizedDir = makeRelative(getOFRoot(), s); ofLogVerbose("baseProject::addSrcFiles") << "Adding addon " << toString(type) << " source file: [" << s.string() << "] folder:[" << addon.filesToFolders[s].string() << "]"; - addSrc(normalizedDir, addon.filesToFolders[s]); + addSrc(normalizedDir, addon.filesToFolders[s], type); } } diff --git a/commandLine/src/projects/baseProject.h b/commandLine/src/projects/baseProject.h index 83c0c963..4f4cd18a 100644 --- a/commandLine/src/projects/baseProject.h +++ b/commandLine/src/projects/baseProject.h @@ -82,7 +82,7 @@ class baseProject { std::vector