Which returns me to my original thinking - the toolchain is very brittle, but any work on it is seemingly best directed at filling in the current gaps when running under node.
This is a bit problematic just yet - both inline and external documentation of toolchain components are Spartan in the extreme, with domain knowledge seemingly gone with the original authors. And, there is an apparent unwillingness to form a consensus on just what should be supported, what functionality is critical, and on what platforms.
fwiw, this comes to mind: fontinfo
and imagesize
are currently native macOS utilities. Their normal use is by nib2cib
— this implies that tool should only ever be usable on the macOS platform. Nevertheless, the xib format is XML and thus ripe for auto generation and maniplulation by external tools - on any platform. Should fontinfo
and imagesize
be left as-is, or should platform-agnostic versions be substituted, leaving open the option for eliminating ibtool
and plutil
dependance and making the toolchain cross-platform (conceptutually, at least).
As it turns out, imagesize
has other problems. It doesn’t escape spaces in pathnames, and thus fails in the same way the autotools suite does. And, on my own Monterey installation, it is failing to build and install when Cappuccino source is bootstrapped.
One of the (perhaps minor) advantages of moving to node is escaping the prison of autotools requiring pathnames without spaces in.
All other effort should be directed towards filling in the gaps in node support, along with developing a proper C.I. regime for the entire toolchain.
If more than just one person is going to work on this it’s necessary to settle on some guiding principles though.
@daboe01 I agree philosophically. There is, though, a potential advantage for some workflows in running C.I. or deployement/packaging processes on a non-macOS platform. In particular, our tool chain is brittle — in part because it isn’t subject to the same amount of automated testing.
This lack of automated testing is particularly acute with those tools which are macOS-native. It’s arguable that logistical difficulties in setting up automated tests for those native tools are partially responsible for the lack of testing. Compilers and other tools are often more difficult to test, so it’s not the only reason.
I’m skeptical that having a pure Objective-J + Javascript toolchain will, alone, improve the robustness of the toolchain — but it wouldn’t hurt to have this as an objective.
Jakefile
to fit my structure!jake build
I get this errorbach@mbp14 _cappDevelop % jake build
(in /Users/bach/Library/Mobile Documents/com~apple~CloudDocs/Bach/Projekte/Websites/WWW-michaelbach-de/ot/ang-Bourdon/_cappDevelop)
options.args: Resources/MainMenu.xib,/Users/bach/Library/Mobile,Documents/com~apple~CloudDocs/Bach/Projekte/Websites/WWW-michaelbach-de/ot/ang-Bourdon/_cappDevelop/Build/Debug/capp/Resources/MainMenu.cib
options.args.length > 2, will crash
jake release
the Resources folder remains empty.options.args
output does not appear in the user where everything works. Is the path possibly too long?
index.html
I only use relative paths, and don't use spaces. But somewhere during the compile process the path is expanded to full length, and near its "upper end" (see above) there sits "Mobile Documents". So I don't see where I could insert a soft link.
jake release
there and find the same crash. So unfortunately this does not help. Of course I could move my actual tree with all of ~100 Capp. programs out the of iCloud tree, but would loose synchronising across machines (unless switching to some other offer, with its own problems). So here's to hoping it's only very little work to fix the Node branch to make do with spaces in path names (escaping or only use relative paths). Would love to fully switch to the Node branch!
(in /Users/bach/…
; after the secondoptions.args: … will crash
occurs, and this is generated within nib2cib in a parsing context. Of course, once that is fixed, there might be more places later… or not… :)
nib2cib
with one or more spaces in the path to the .xib
file. I have made a fix in this branch: https://github.com/mrcarlberg/cappuccino/tree/nib2cib_space_in_path. You should be able to install that version with the instructions from the wiki under the headling "... from source ....". Use above path to the repository and the branch nib2cib_space_in_path
.
git clone https://github.com/mrcarlberg/cappuccino/␍
cd cappuccino␍
git checkout nib2cib_space_in_path
npm install
producednpm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/capp/Documents/Cappuccino/cappuccino/node_modules/.staging/@objj/utils-ef80a171
npm ERR! dest /Users/capp/Documents/Cappuccino/cappuccino/node_modules/@objj/utils
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/capp/Documents/Cappuccino/cappuccino/node_modules/.staging/@objj/utils-ef80a171' -> '/Users/capp/Documents/Cappuccino/cappuccino/node_modules/@objj/utils'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent …
@michaelbach Append .patch
to the commit URL, then save locally. Your browser (Safari at least) will likely want to append .txt
to the file - the file can be named whatever you want, but make the extension .patch
.
Then, use the branch of cappuccino you’ve normally been using (with a quick fork, if you wish) and apply the patch - git-apply path/to/patchfile
. This should avoid differences in the npm lockfile?
fontinfo
takes a path as an argument
NAME
fontinfo -- retrieve information about a font
SYNOPSIS
fontinfo [-n] font [size [string]]
DESCRIPTION
fontinfo is a tiny utility that returns information about a font.
The font name must be a full PostScript name, not a display name. So you would use something
like "LucidaGrande-Bold", not "Lucida Grande Bold". The size can be any floating point number
@michaelbach We’re likely best off supporting only the current LTS version of Node (now at 16). I use the macOS installer package from nodejs.org — I normally avoid Homebrew (it has an idiosyncratic and unconvential perspective on best practices for package management) and use MacPorts. In this case, the MacPorts package has a Python3 dependency (which seems gratuitous), so the canonical installer seems the best bet.
When trying out a change on a source installation which has suddently broken, a quick branch from the last known working version, followed by any changes, is the sanest way to keep a production environment in working order. Reversion is a quick Stash and Checkout away. I keep a collection of patches proven to work for Github PRs which have yet to be merged but are otherwise safe.
It’s usually easiest to apply a patch, if those changes originate elsewhere. If a Git GUI client doesn’t have an option to apply a patch, the client is probably overly-simplistic, immature or otherwise not a good candidate for regular use. Having said that, one can always use the command line to apply a patch.
cappuccino-nib2cib_space_in_path
dest library to the ~/.npm/…
folders?
@michaelbach fontinfo
is a compiled binary - it’s subject to Gatekeeper signature/integrity checks.
Use which fontinfo
to confirm the location of the instance you’re using. xattr -d com.apple.quarantine /path/to/fontinfo
will remove the quarantine flag. It’s possible it was set when copying.
capp
template Jakefile
for NibApplication about the build directory but I can't replicate your problem. I have committed a fix to the branch.martin@marm ~/L/M/c/D/t/cappuccino (nib2cib_space_in_path)> capp gen -t NibApplication MyTestNib
Creating Frameworks directory in /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks...
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/objective-j/Frameworks/Objective-J ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/Objective-J
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/objective-j/Frameworks/Debug/Objective-J ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/Debug/Objective-J
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/cappuccino/Frameworks/Foundation ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/Foundation
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/cappuccino/Frameworks/Debug/Foundation ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/Debug/Foundation
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/cappuccino/Frameworks/AppKit ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/AppKit
Copying /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/dist/cappuccino/Frameworks/Debug/AppKit ==> /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib/Frameworks/Debug/AppKit
martin@marm ~/L/M/c/D/t/cappuccino (nib2cib_space_in_path)> cd MyTestNib/
martin@marm ~/L/M/c/D/t/c/MyTestNib (nib2cib_space_in_path)> jake build
(in /Users/martin/Library/Mobile Documents/com~apple~CloudDocs/Developer/test test/cappuccino/MyTestNib)
Compiling [Browser] AppController.j...
Compiling [Browser] main.j..
Creating static file... /Users/martin/Developer/Build/Debug/MyTestNib/Browser.environment/MyTestNib.sj
Compiling [CommonJS] AppController.j...
Compiling [CommonJS] main.j..
Creating static file... /Users/martin/Developer/Build/Debug/MyTestNib/CommonJS.environment/MyTestNib.sj
----------------------------
Debug app built at path: /Users/martin/Developer/Build/Debug/MyTestNib
----------------------------
Calculating application file sizes...
Executables: 19443119, sprite data: 476594, total: 19919713
Build took 1 second
martin@marm ~/L/M/c/D/t/c/MyTestNib (nib2cib_space_in_path)>
npm install -g @objj/cappuccino
. Success, and capp gen HelloWorld
works. Next step:git clone https://github.com/mrcarlberg/cappuccino.git
. No errors, and git status
after cd cappuccino
says "working tree clean".git checkout nib2cib_space_in_path
results in "Switched to a new branch 'nib2cib_space_in_path'", looking good so far. Next, following the wiki:npm install
. Here various errors crop up:bach@mbp14 cappuccino % npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/bach/Library/Mobile Documents/com~apple~CloudDocs/Bach/myProgs/Cappuccino/cappuccino/node_modules/.staging/@objj/utils-ce17aa86
npm ERR! dest /Users/bach/Library/Mobile Documents/com~apple~CloudDocs/Bach/myProgs/Cappuccino/cappuccino/node_modules/@objj/utils
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/bach/Library/Mobile Documents/com~apple~CloudDocs/Bach/myProgs/Cappuccino/cappuccino/node_modules/.staging/@objj/utils-ce17aa86' -> '/Users/bach/Library/Mobile Documents/com~apple~CloudDocs/Bach/myProgs/Cappuccino/cappuccino/node_modules/@objj/utils'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
bach@mbp14 cappuccino % which node
/opt/homebrew/bin/node