Replies: 13 comments 30 replies
-
Have the same requirement but no idea how to get started... We need someone who knows how to build stuff like that, or learn it |
Beta Was this translation helpful? Give feedback.
-
Okay, according to this blog post: https://tailwindcss.com/blog/standalone-cli - they use pkg by vercel in order to bundle the source code into a binary. (https://github.com/vercel/pkg) I have
I tried this on a freebsd machine with the following arguments: /usr/local/bin/pkg -t node16-freebsd-x64 index.js This starts doing a lot... but exits with an error shortly before the end, as a file was not found... Last few words from the build-process: cc -o /tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/obj.target/genccode/deps/icu-small/source/tools/genccode/genccode.o ../deps/icu-small/source/tools/genccode/genccode.c '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_WITHOUT_NODE_OPTIONS' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common -I../deps/icu-small/source/i18n -I../deps/icu-small/source/tools/toolutil -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -flto=4 -ffat-lto-objects -fno-omit-frame-pointer -MMD -MF /tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/.deps//tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/obj.target/genccode/deps/icu-small/source/tools/genccode/genccode.o.d.raw -c
cc: error: unsupported argument '4' to option 'flto='
cc: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
gmake[1]: *** [tools/icu/genccode.target.mk:106: /tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/obj.target/genccode/deps/icu-small/source/tools/genccode/genccode.o] Error 1
gmake: *** [Makefile:113: node] Error 2
strip: open /tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/node failed: No such file or directory
> Error! Error: ENOENT: no such file or directory, open '/tmp/pkg.30b7e2b34fe9e950427bc4ac/node/out/Release/node' Anyone else successfully tried to compile sucessfully for freebsd? |
Beta Was this translation helpful? Give feedback.
-
Hi folks, I could manage to compile it under FreeBSD 13 install npm & gcc temporarily disable cc and c++ binaries
create symlinks to gcc
then:
(edit package.json to add The first time you'll run pkg as follows it will take a long while to compile
now:
prease restore cc & co when finished:
this solution is not ideal but is a good starting point to understand how fix the problem definitively |
Beta Was this translation helpful? Give feedback.
-
mmm if you get this working from src, let me know. I recall this working ~ v3.0.3 ? try this:
From my older project:
the instructions in preceding commits aren't correct, perhaps @ovenpasta you can try During compilation, try and avoid the symlink mess with this?
I'd love to know what's needed to use the existing nodejs binaries from FreeBSD pkg. /me waves to @norbu09 you still in Portugal? |
Beta Was this translation helpful? Give feedback.
-
Okay - new challenge here, @ovenpasta has shown how to compile. Haven't tried it yet, but would anywhere in the tailwind require the plugins or add the packages to the package.json and then compile the whole thing... |
Beta Was this translation helpful? Give feedback.
-
any chance we can get this into the official build pipeline for tailwind? would be awesome if my |
Beta Was this translation helpful? Give feedback.
-
hey folks, I have tried very hard to replicate my successful With the compiler tweaks, I can still build the nodejs binary, $ time npm run build
|
Beta Was this translation helpful? Give feedback.
-
After a bit of fiddling, it's trivial to build directly from tailwind-cli git source: $ sudo pkg install -yr FreeBSD lang/gcc devel/binutils devel/git@tiny www/npm-node16 lang/python
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
$ export TMPDIR=$(mktemp -d -t tailwind)
$ export NPM_CONFIG_CACHE=${TMPDIR}/.npm
$ export PKG_CACHE_PATH=${TMPDIR}/.pkg-cache
$ export TAILWIND=${TMPDIR}/src
$ ln -s /usr/local/bin/gmake ${TMPDIR}/make
$ ln -s /usr/local/bin/gcc ${TMPDIR}/cc
$ ln -s /usr/local/bin/g++ ${TMPDIR}/c++
$ export PATH=${TMPDIR}:$PATH
$ git clone https://github.com/tailwindlabs/tailwindcss ${TAILWIND}
Cloning into 'tailwindcss'...
remote: Enumerating objects: 32753, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (53/53), done.
Receiving objects: 47% (15394/32753), 17.75 MiB | 11.83 MiB/s04 MiB/s
remote: Total 32753 (delta 51), reused 79 (delta 43), pack-reused 32657
Receiving objects: 100% (32753/32753), 62.22 MiB | 8.52 MiB/s, done.
Resolving deltas: 100% (24027/24027), done.
$ cd ${TAILWIND}
$ git reset --hard v3.2.4
HEAD is now at f2f1ee9b 3.2.4
$ npm run prepublishOnly
$ cd ${TAILWIND}/standalone-cli
$ npm install
$ ./node_modules/.bin/pkg . \
--target node16-freebsd-x64 \
--compress Brotli \
--no-bytecode \
--public-packages "*" \
--public And note that if @norbu09 @marschro @ovenpasta would be great if you can +1 this as the solution. Regarding next steps, we have a couple of choices on getting FreeBSD added to the tailwind CLI family, I'm mainly interested in the Phoenix side ofc: @adamwathan & tailwind folks: vercel/pkg doesn't provide the pre-built .pkg-cache/v3.4/ Options:
This would mean people can install it like so: $ sudo pkg install -r FreeBSD www/tailwindcss Or whatever the name you prefer, for both the package and the In general, dropping in the pre-built binary to your toolchain, Longer term, the port option is the BSD way (tm) and at least for Thoughts? |
Beta Was this translation helpful? Give feedback.
-
@adamwathan + team see phoenixframework/tailwind#71 which addresses our downstream Phoenix issue, at least initially, and we can now produce the artefact via CI, rather than just my trusty machines. What are your thoughts on using a CI run to generate the the |
Beta Was this translation helpful? Give feedback.
-
Here's where we are at with installing, after phoenixframework/tailwind#60 was merged today.
I'd like to see this dropped into tailwind proper, as above, if that's possible? |
Beta Was this translation helpful? Give feedback.
-
🌈 🥯 🍋 🍫 🧪 tailwind v3.3.2 ready for testing Bump your
If somebody with solid C & make skills can figure out how to build this with base FreeBSD's clang, instead of gcc, we can probably attempt a proper port into the official ports tree. This has been, without exaggeration, the nastiest, ugliest, time-sucking vampire of a port I've ever tackled with FreeBSD. 🧮 feel free to top up my coffee jar https://github.com/sponsors/skunkwerks |
Beta Was this translation helpful? Give feedback.
-
you can always hack this into your project to make it fetch the right build for FreeBSD without requiring further human intervention
|
Beta Was this translation helpful? Give feedback.
-
i recently switched back to FreeBSD from Linux and wanted to continue using the tailwind cli but have issues with it running in Linux compat mode under Freebsd 13 (it won't exit and stalls phoenix compiles) so i wanted to make a FreeBSD binary. Does anyone have any pointers/docs on how to compile the cli? Normally Linux and FreeBSD builds are very similar so any Linux related docs/scripts would be a great help :)
The issue I have with the Linux version under FreeBSD is that it times out waiting for some resource from what i can tell:
Beta Was this translation helpful? Give feedback.
All reactions