Closed cramoisi closed 6 years ago
I think the grep on mac is BSD and differ a little from the GNU one...
Yup, /proc is a Linux-specific virtual filesystem ;).
Does getconf _NPROCESSORS_ONLN
output something sane on macOS?
Also, c.f., https://crosstool-ng.github.io/docs/os-setup/
MacBook:~ sebastien$ getconf _NPROCESSORS_ONLN
4
MacBook:~ sebastien$
I don't know what i did with my mac between now and 2 months ago but even the emu doesn't compile anymore. The ./kodev release kobo didn't work at all last time I tried so it the reason I tried this (and was more or less aware of the answer :))
Also, c.f., https://crosstool-ng.github.io/docs/os-setup/
will test that !
Fixed in my branch ;). (At least this bit, you still have to cross a few fingers nothing else will blow up, I've never tried ct-ng on a macOS host, it's not as bad as a Win32 host, but there may be growing pains ^^).
I'm not quite sure why @houqp went with a Linux-specific solution (I've always been using getconf in my script), but hopefully the new version is extra-hard to break ;).
(I'm guessing virtualization shenanigans?)
(not related but mac doesn't really want i use it :
MacBook:koreader sebastien$ ./kodev fetch-thirdparty grep: /proc/1/cgroup: No such file or directory git submodule init
MacBook:koreader sebastien$ ./kodev build
....
HEAD is now at 9b41062... DynASM: Fix warning. [ 37%] No patch step for 'luajit' [ 50%] No update step for 'luajit' [ 62%] No configure step for 'luajit' [ 75%] Performing build step for 'luajit' sed: impossible de lire : No such file or directory make[4]: [luajit-prefix/src/luajit-stamp/luajit-build] Error 2 make[3]: [CMakeFiles/luajit.dir/all] Error 2 make[2]: [all] Error 2 make[1]: [build/x86_64-apple-darwin17.6.0-debug/luajit] Error 2 make: *** [base/build/-debug/luajit] Error 2 Failed to build emulator! Try run with -v for more information. MacBook:koreader sebastien$
Is the emu compilation failing on an actual compiler error, or a GNU-ism?
EDIT: Too late. :D. GNU-ism ;).
I don't exactly remember what homebrew exactly does with the GNU tools, I know you can call them with their g\<name> variant, and autotools should pick them up, but that may not be enough for everything...
so I need to remove something ?
Let me check if that sed call is ours or LuaJIT ;).
We handle the sed switch properly on our end, and LuaJIT's sed calls don't use the offending -i
flag, so that's strange...
Try with a verbose build?
export VERBOSE=1
export V=1
[ 12%] Performing build step for 'luajit' cd /Users/sebastien/koreader/base/thirdparty/luajit/build/x86_64-apple-darwin17.6.0-debug/luajit-prefix/src/luajit && sh -c "sed -i '' -e 's|#CCDEBUG= -g|CCDEBUG= -g|' /Users/sebastien/koreader/base/thirdparty/luajit/build/x86_64-apple-darwin17.6.0-debug/luajit-prefix/src/luajit/src/Makefile && /Library/Developer/CommandLineTools/usr/bin/make -j5" sed: impossible de lire : No such file or directory make[4]: [luajit-prefix/src/luajit-stamp/luajit-build] Error 2 make[3]: [CMakeFiles/luajit.dir/all] Error 2
Right, that one's ours :D.
And it means sed is now gsed, but we detect it as macOS's sed. Joy.
I assume you have gnu-sed installed via homebrew?
MacBook:koreader sebastien$ brew install gnu-sed
Warning: gnu-sed 4.5 is already installed and up-to-date
To reinstall 4.5, run brew reinstall gnu-sed
On my end, you can't call it as sed unless it's installed with the "with-default-names" option, or you added homebrew's gnubin path to your PATH...
Does any of that ring a bell?
it's installing. Yep, it rings a bell ; i already gone through all this in february and everything worked fine
==> Reinstalling gnu-sed --with-default-names ==> Downloading https://ftp.gnu.org/gnu/sed/sed-4.5.tar.xz Already downloaded: /Users/sebastien/Library/Caches/Homebrew/gnu-sed-4.5.tar.xz ==> ./configure --prefix=/usr/local/Cellar/gnu-sed/4.5
i.e., which sed
, echo $PATH
, brew info gnu-sed
.
Okay, trouble is: we don't detect gsed that way, so you should NOT install it with --with-default-names
;).
As for ct-ng, it's autotools all the way, so it should detect gsed properly without needing that, too ;).
MacBook:koreader sebastien$ which sed /usr/local/bin/sed
/usr/local/opt/gettext/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
gnu-sed: stable 4.5 (bottled) GNU implementation of the famous stream editor https://www.gnu.org/software/sed/ Conflicts with: ssed (because both install share/info/sed.info) /usr/local/Cellar/gnu-sed/4.5 (49 files, 991.8KB) * Built from source on 2018-07-05 at 01:38:09 with: --with-default-names From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnu-sed.rb ==> Options --with-default-names Do not prepend 'g' to the binary
Yep, reinstall it without --with-default-names ;).
it doesn't give me the choice :)
brew reinstall gnu-sed --without-default-names?
MacBook:koreader sebastien$ brew reinstall gnu-sed --without-default-name ==> Reinstalling gnu-sed --with-default-names Warning: gnu-sed: this formula has no --without-default-name option so it will be ignored! ==> Downloading https://ftp.gnu.org/gnu/sed/sed-4.5.tar.xz Already downloaded: /Users/sebastien/Library/Caches/Homebrew/gnu-sed-4.5.tar.xz ==> ./configure --prefix=/usr/local/Cellar/gnu-sed/4.5
Okay, take two: uninstall, then install without any flag? ^^
Wait, it's names, not name (plural)
MacBook:koreader sebastien$ brew uninstall gnu-sed Uninstalling /usr/local/Cellar/gnu-sed/4.5... (49 files, 991.8KB) MacBook:koreader sebastien$ brew install gnu-sed ==> Downloading https://homebrew.bintray.com/bottles/gnu-sed-4.5.high_sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring gnu-sed-4.5.high_sierra.bottle.tar.gz ==> Caveats The command has been installed with the prefix "g". If you do not want the prefix, install using the "with-default-names" option.
If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc like: PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
Additionally, you can access their man pages with normal names if you add the "gnuman" directory to your MANPATH from your bashrc as well: MANPATH="/usr/local/opt/gnu-sed/libexec/gnuman:$MANPATH" ==> Summary 🍺 /usr/local/Cellar/gnu-sed/4.5: 12 files, 529KB MacBook:koreader sebastien$
ok it worked
which sed should now point to /usr/bin/sed, right?
Right !
The compilation of the emu is running ; i will check the toolchain tomorrow ; thanks !
strange :
[*] create symlink instead of copying files in development mode
cd koreader-emulator--debug/koreader && \
ln -sf ../../base/build/-debug/* .
[*] install front spec only for the emulator
cd koreader-emulator--debug/koreader/spec && test -e front || \
ln -sf ../../../../spec ./front
/bin/bash: line 0: cd: koreader-emulator--debug/koreader/spec: No such file or directory
cd koreader-emulator--debug/koreader/spec/front/unit && test -e data || \
ln -sf ../../test ./data
/bin/bash: line 0: cd: koreader-emulator--debug/koreader/spec/front/unit: No such file or directory
for f in reader.lua setupkoenv.lua frontend resources defaults.lua datastorage.lua l10n tools README.md COPYING; do \
ln -sf ../../$f koreader-emulator--debug/koreader/; \
done
[*] Install plugins
cp -R plugins/* koreader-emulator--debug/koreader/plugins/
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
make: *** [all] Error 64
Failed to build emulator! Try run with -v for more information.
That looks like MACHINE being misdetected (as in, not at all). Not at a computer right now, I'll take a look later this afternoon ;).
What is your koreader-emulator-whatever folder actually named?
urg, strange : koreader-emulator--debug
I can't explain myself why it worked without problem 1 month ago
Could it be related to @NiLuJe 's recent bumps?
That vaguely looks like a bsd make issue (it doesn't support the $(shell) semantics, AFAIK, which is why KindleTool's Makefiles jumps through so many shitty hoops).
What's strange is that make is gmake 3.81 on my 10.13.5 system...
And I haven't installed gmake.
What does make --version
say on your system?
As well as clang -dumpmachine
, on the off-chance it's something much stupider ;).
As for the cp call themselves, https://github.com/koreader/koreader/pull/4055/commits/3f34f19102a296e11174f3424219e45ed52422be might help?
MacBook:koreader sebastien$ make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
What about the rest? ;)
any lead ?