website/content/contributing/setting-up-xtchain.md
Aiken Harris ece7cab08b
All checks were successful
Builds / ExectOS WebSite (push) Successful in 19s
Add section on Git Bash support for XTchain setup
2025-07-17 07:39:52 +02:00

54 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

+++
title = 'Setting up XTchain'
date = 2025-07-16T19:29:14+02:00
+++
XTchain is a script-based compilation environment designed to streamline complex build processes across multiple platforms.
This guide explains how to set up and use XTchain efficiently on your system. You will learn how to launch the XTchain
environment, configure your terminal for convenience, and ensure that your development setup is ready for building projects
like ExectOS.
## Setting Up XTchain on Windows
On Windows, the simplest way to launch XTchain is by defining a dedicated profile in Windows Terminal that automatically
opens PowerShell, loads the XTchain environment, and remains interactive for further commands.
### 1. Create a Custom Windows Terminal Profile
A dedicated terminal profile ensures that every time you open XTchain, the environment is preconfigured and ready to use.
1. Open **Windows Terminal**.
2. Click the down-arrow next to a tab and select **Settings**.
3. Choose **Add a new profile**.
4. In the **Command line** field, enter:
```
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoExit -File "C:\Path\To\XTchain\xtchain.ps1"
```
Replace C:\Path\To\XTchain with the actual folder where xtchain.ps1 resides. Give the profile a name (for example, XTchain),
assign an icon if desired, and save the settings. Now when you select the XTchain profile, Windows Terminal will launch
PowerShell, bypass execution restrictions, run the initialization script, and keep the window open. The command works as follows:
it starts the built-in PowerShell executable (%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe), temporarily disables
the script execution policy with **-ExecutionPolicy Bypass**, prevents the terminal from closing after the script finishes using
**-NoExit**, and runs the XTchain initialization script specified with **-File "C:\Path\To\XTchain\xtchain.ps1"**. This setup
ensures that the XTchain environment is ready every time you open the terminal.
### 2. Handling Execution Policy Errors
When running the profile, you might see the following error message: **File ... cannot be loaded because running scripts is
disabled on this system.**. This indicates that your systems execution policy is set to block all or unsigned scripts. To
permanently fix it, open PowerShell as Administrator and enter:
```
Set-ExecutionPolicy RemoteSigned
```
This policy allows:
- All locally created scripts (including xtchain.ps1) to run without signing.
- Scripts downloaded from the internet to require a trusted digital signature.
Warning: Only change execution policy if you trust the scripts you run.
### 3. Use Git Bash for a Unix-like Environment
As an alternative, if you have installed Git for Windows along with the bundled MSYS2 tools, you can leverage its Bash shell and
Unix-style scripts to initialize XTchain exactly as on Linux. During the installation process, you have the option to include a set
of additional Unix utilities that, combined with the Bash shell, provide a powerful and familiar development environment. This setup
allows you to run XTchains shell scripts seamlessly on Windows, mirroring the Linux workflow and ensuring consistency across
platforms without the need for platform-specific adjustments.
For added convenience, you can also configure a dedicated profile in Windows Terminal that automatically launches Git Bash with the
XTchain environment pre-initialized. This makes it easy to jump straight into a ready-to-use shell session. The process for creating
this terminal profile is analogous to the one described in section 1.