What is the recommanded way to install Bazel on macOS? - macos

Installing Bazel on Ubuntu
says:
Use Bazelisk (recommended)
Installing Bazel on macOS says:
Use the binary installer (recommended)
Isn't Bazelisk the recommended way to install Bazel on macOS? Or is Installing Bazel on macOS outdated?

/bin/bash -c "$(curl -fsSL \
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install bazel
brew upgrade bazel
its as simple as the site says

Related

Can't deploy heroku on Mac OS M1

I'm new on Heroku and trying to deploy my project here. After I typed this command in the terminal: curl https://cli-assets.heroku.com/install.sh | sh
and I also typed the administrative password correctly , I got this error message: unsupported arch: arm64
The script does not support arm64 (see line 40 pf the script).
The easier option is to install via brew
brew tap heroku/brew && brew install heroku
or download the tarball for macOS (if you still prefer doing it manually)
Download the tarball macOS
tar xvf heroku-darwin-x64.tar
sudo mv heroku /usr/local/lib
cd /usr/local/bin
ln -s /usr/local/lib/heroku/bin/heroku .
heroku --help
Apple Silicon Issues
If you’re getting the following error on a machine with an Apple M1 chip, you haven’t installed or declined to install Rosetta 2.
Bad CPU type in executable
Installing Rosetta 2 resolves this issue.
If you don’t want to install Rosetta 2 on your machine, you can install the Heroku npm package globally and use your own Node binary locally. Only v16 of Node has M1 ARM support and npm isn’t the recommended install method.
ref: heroku install
brew tap heroku/brew && brew install heroku
This command doesn't work for me
==> Installing heroku from heroku/brew
Error: Your Xcode (14.0.1) is too outdated.
Please update to Xcode 14.1 (or delete it).
Xcode can be updated from the App Store.
but there is no update in theApp Store.
Try
arch -arm64 brew install heroic
Try
arch -arm64 brew install heroku

MacOs Big Sur: Failure to install RPM with brew

I'm trying to install rpm on mac os big sur with:
brew install rpm
but i'm getting always the same error:
Error: rpm: no bottle available!
Already tried
brew update
brew upgrade
brew update-reset
and no good.
My brew version is:
❯ brew --version
Homebrew 3.2.9-64-g6da8630
Any ideas what's going on?
Thanks
You're using an ARM Mac and the rpm doesn't support built as native arm64 package. You need to install a Rosetta Homebrew as well.
Check gdb: no bottle available-gdb install for detail explanation.

How do you install QMK with the new Mac M1 (ARM) chip

I keep getting compiling errors whenever I follow the homebrew install guide for QMK.
==> Installing qmk from qmk/qmk
avr-gcc#8: The x86_64 architecture is required for this software.
Error: An unsatisfied requirement failed this build.
Not sure how to get this to install correctly.
Install Homebrew using Rosetta 2 to do the compilation for you:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then, install QMK with the x86_64 arch:
arch -x86_64 brew install qmk/qmk/qmk
Then follow the rest of the guide from the QMK website: https://beta.docs.qmk.fm/tutorial/newbs_getting_started#3-run-qmk-setup-id-set-up-qmk.
I use Docker (podman actually, but both works)as the container can be amd64 with Rosetta and Podman (there is a solution for Docker too)
Then I build an image like that, and I run inside the container (I override the default keyboard layout with mine, so that I don't have to create a user)
When you run it, mount a volume from your machine as '/output' and copy the bin or do a podman/docker copy
FROM docker.io/qmkfm/base_container:latest
RUN pip install qmk && \
qmk setup -y -H /qmk_firmware
WORKDIR /qmk_firmware
COPY keymap/keymap.c /qmk_firmware/keyboards/novelkeys/nk65/keymaps/default/keymap.c
COPY config/qmk/qmk.ini /root/.config/qmk/qmk.ini
# make bash as default command
CMD ["/bin/bash"]
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.

How to install Siege with libssl?

I am trying to install Siege with libssl on Mac OS 10.12, but when I use the utility against an https url I am receiving the following error.
[error] HTTPS requires libssl: Unable to reach https://example.com/
with this protocol: Socket is already connected
I am installing with the following commands from this wiki:
./configure --with-ssl
make
make install
This is on macOS Mojave, with openssl installed using HomeBrew. You'll be using a brew command to get the openssl install directory:
git clone https://github.com/JoeDog/siege.git
cd siege
./utils/bootstrap
# here's what you're looking for:
./configure --with-ssl=$(brew --prefix openssl)
make
Now you can run siege with ./src/siege https://whatever.domain.invalid. This was tested with Siege 4.0.4rc3 commit hash 05dcfac88ecdd57bd94276e4ce82477cba9129b6 and openssl 1.0.2s on macOS 10.14.5.
use brew to install siege.
it fixed the issue for me. the only extra thing i had to do was to link siege.
https://coderwall.com/p/qfrk1w/making-siege-work-with-https-on-os-x-mavericks .
brew uninstall siege
brew install openssl
brew link --force openssl
brew install siege
The extra steps ti had to do (Mac OS Sierra low) .
ln -s /usr/local/Cellar/siege/4.0.4/bin/siege /usr/local/bin/siege .

Trouble installing m2crypto with pip on OS X / macOS

pip install m2crypto
Generates the following output:
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include -I/usr/include/openssl -includeall -modern -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_m2crypto.i:30: Error: Unable to find 'openssl/opensslv.h'
SWIG/_m2crypto.i:33: Error: Unable to find 'openssl/safestack.h'
SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1
I've run:
brew install swig
I wanted a nicer way without installing manually and using only Homebrew (which also does not link openssl by default). Also using pip was a requirement. This seems to work with newest m2crypto 0.22.5. I also tested it once with m2crypto 0.22.3 and seems also to work. The OpenSSL version here is 1.0.2d:
brew install openssl
brew install swig
Finally install m2crypto on macOS in your Bash. It is a long command but it changes SWIG and clang environment variables only during pip install so that m2crypto will get all OpenSSL requirements:
env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
btw. the last command also works if you use e.g. a requirements.txt.
Update:
Additional also the command for fish shell users...
env LDFLAGS="-L"(brew --prefix openssl)"/lib" \
CFLAGS="-I"(brew --prefix openssl)"/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I"(brew --prefix openssl)"/include" \
pip install m2crypto
thanks to therealmarv env flags i was able to get this to work with the macports version of openssl/swig, this is what i did:
sudo port install openssl
sudo port install swig
sudo port install swig-python
then use therealmarv lines but replace "$(brew --prefix openssl)" with the dir from macports which should be "/opt/local"
sudo env LDFLAGS="-L/opt/local/lib" \
CFLAGS="-I/opt/local/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I/opt/local/include" \
pip install M2Crypto
I just went through a lot of pain getting this working in El Capitan. Here is what I had to do:
Install OpenSSL (you have to use an older version, m2crypto will not compile otherwise)
curl -O https://www.openssl.org/source/openssl-0.9.8zg.tar.gz
tar -xvzf openssl-0.9.8zg.tar.gz
cd openssl-0.9.8zg
./Configure --prefix=/usr/local darwin64-x86_64-cc
make && make test
sudo make install
Install m2crypto
git clone https://github.com/martinpaljak/M2Crypto.git
cd M2Crypto
python setup.py build build_ext --openssl=/usr/local
sudo python setup.py install build_ext --openssl=/usr/local
AFAIK it is installed... I still have to do some testing though.
Got exact same issue on Ubuntu 18.04 LTS, while trying to execute
pip install M2Crypto==0.24.0
Did the following to get rid of it:
sudo apt-get install swig
sudo apt-get install libssl1.0-dev
This fixed my problem (Python 2.7):
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
macos v10.15.6
m2crypto v0.35.6
pip v20
Solution by therealmarv works,
If the program does not take effect, you can try to upgrade your brew packages. Before the solution.
brew update # update homebrew self
brew upgrade # upgrade all
sudo apt-get install python-m2crypto

Resources