How to Bootstrap Your Own Pharo Image

Dec 25, 2023 | Programming

Pharo is a unique, pure object-oriented programming language that provides a rich environment for developers, offering simplicity and immediate feedback—akin to having an integrated development environment (IDE) and an operating system (OS) in one neat package. In this guide, we will explore how to bootstrap your own Pharo image from the sources, ensuring you harness the full potential of this powerful tool.

Step-by-Step Guide to Bootstrapping Pharo

1. Downloading Pharo

First, you’ll need the latest stable version of Pharo. Navigate to the official download page:

2. Understanding the Bootstrapping Process

Bootstrapping Pharo is like planting a seed and nurturing it until it grows into a full-fledged tree. You need to utilize the latest stable version to start this growth.

To bootstrap your Pharo image, use the provided script as follows:

bash .bootstrapscripts/bootstrap.sh

This command will generate and archive images at various stages of the bootstrap process, leading up to a complete image (e.g., Pharo12.0-64bit-hhhhhhh.zip, where hhhhhhh is the hash of your current checkout).

3. Environment Configuration

Before running the bootstrap script, you may want to fine-tune your environment. Here are some useful configurations:

  • Set a unique BUILD_NUMBER to your chosen integer.
  • Determine the BOOTSTRAP_ARCH (32 or 64).
  • Specify BOOTSTRAP_REPOSITORY and BOOTSTRAP_CACHE for alternate sourcing.
  • Indicate BOOTSTRAP_VMTARGET to use an already available virtual machine on your system.
  • If your branch name doesn’t follow the expected naming convention, you can set the BRANCH_NAME accordingly before running the bootstrap script.

4. Bootstrapping with Docker

If you prefer a controlled environment, Docker is an excellent choice! Below is the Dockerfile to set up Pharo:

# docker build --tag pharo .
# docker run --rm --name pharo -it pharo
FROM ubuntu:22.04
RUN apt-get update && apt-get -y install build-essential git wget zip
RUN git clone https://github.com/pharo-project/pharo.git /root/pharo
WORKDIR /root/pharo
RUN git pull && ./.bootstrapscripts/bootstrap.sh
ENTRYPOINT [ "bash" ]

Alternatively, if you are on Windows, set up a Docker volume that points to your project directory:

# in the host environment start a Docker container
docker run --rm -it -v $(pwd):pharo --workdir pharo ubuntu:22.04 bash

# in the container add the required packages and start the bootstrap script
apt-get update && apt-get -y install build-essential git wget zip
./.bootstrapscripts/bootstrap.sh

Troubleshooting Tips

While bootstrapping Pharo, you might encounter some hiccups. Here are a few troubleshooting ideas:

  • If the bootstrap process fails, ensure that you are using the correct version of Pharo and that your environment variables are set up correctly.
  • Consult the comments within the bootstrap.sh script for additional guidance on how to manage snapshots and other configurations.
  • Check your internet connection if the script cannot download dependencies or the virtual machine.
  • Make sure Docker is installed and running if you choose to bootstrap using Docker.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox