Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expands information for local compilations, clarify not all recipes builds #125

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,38 @@ This repository is primarily intended for use on the unofficial-builds server bu

### Setup for local builds

On deploy, this repository is placed within a the `unofficial-builds` home directory on the server, it is intended to operate from a subdirectory of where the assets are build, it's `$workdir` is the parent directory of wherever it is located. The `local_build.sh` script will create some directories within its `$workdir` so it's best to create a new directory for it to operate in. e.g.:
On deploy, this repository is placed within a the `unofficial-builds` home directory, it is intended to operate from a subdirectory of where the assets are build, it's `$workdir` is the parent directory of wherever it is located. The `local_build.sh` script will create some directories within its `$workdir` so it's best to create a new directory for it to operate in. So the steps for local build will be in general:

* `$workdir`
* unofficial-builds/ *(this repository)*
* staging/src/ *(source files for builds, made by `local_build.sh`)*
* staging/`$disttype`/`$version`/ *(staging directory for builds, made by `local_build.sh`)*
* .ccache/ *(ccache cache directory to speed up repeat builds, made by `local_build.sh`)*
* Install docker from [https://docs.docker.com](https://docs.docker.com/engine/install/)
* Create the `$workdir` directory inside your home as normal user, you will have then:
* unofficial-builds/ *(this repository, created after cloned this git, inside `$workdir`)*
* staging/src/ *(source files for builds, will be created by `local_build.sh`)*
* staging/`$disttype`/`$version`/ *(staging directory for builds, will be created by `local_build.sh`)*
* .ccache/ *(ccache cache directory to speed up repeat builds, will be created by `local_build.sh`)*

e.g. clone this repository using the following commands to place it within an `unofficial-builds-home` directory:
e.g. Login as normal user and clone this repository using the following commands to place it within an `unofficial-builds-home` directory:

```sh
mkdir unofficial-builds-home
cd unofficial-builds-home
rm -fr ~/Devel/unofficial-builds-home
mkdir -p ~/Devel/unofficial-builds-home
cd ~/Devel/unofficial-builds-home
Comment on lines +105 to +107
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should ditch the ~/Deve/ prefixes here, let the user do it in cwd or edit this themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did to avoid mixed files in home, most of users works not so organized .. we must promoted organization but i dont know how to promoted such thing.. what do you suggest? this allows people to know easyle that all related files is under that path only

Copy link
Contributor Author

@mckaygerhard mckaygerhard Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact @rvagg the command with such prefixed helps to understand to others (that are not English native speakers) the confusion of "homedir"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, fair enough and you have documented it below that this is what you're doing. What stands out to me is "Devel" though, it's not a standard thing, looks macOSish, and the user is inevitably going to have to edit that. So maybe just ditch the "/Devel" from your commands and run with ~/unofficial-builds-home.

Copy link
Contributor Author

@mckaygerhard mckaygerhard Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok b eore changin.. as last attempt to defend my point, it is not a macshish but just like this Downloads, and like XDG in linux has Public or Music several subdirectories, in the original text i thought thinked i was forced to use home directly since due to language barriers you always think that it is understood very well, but the examples are essential, if even with this explanation I cannot convince you then I change it as you suggest, but i am here cos many others just get tyred of put issues with questions that canot xperess in good way.. developers always thnks have reason but we are first humans.. that's why i put later $workdir will be ~/Devel/unofficial-builds-home

git clone https://github.com/nodejs/unofficial-builds
```

However, you can override the default `$workdir` behaviour with a `-w <newdir>` argument to `local_build.sh` and direct it to a different directory where it can create its own subdirectories, so the above layout is not strictly necessary.

Please note that these scripts and recipes are intended to run in a Linux x64 environment, they may not work on other platforms, YMMV.
In the script presented, the `$workdir` will be `~/Devel/unofficial-builds-home` and it can be customized with a `-w <newdir>` argument to `local_build.sh`, with the limitation that this script, although they build Nodejs binaries for other platforms, the commands presented will only execute on a 64-bit Linux environment based on x86 cpus. All of those commands are running as a normal user.

### Building

Once you have cloned this repository, you can build a specific recipe by running `bin/local_build.sh` with the recipe (an existing one or one you create within the `recipes/` subdirectory) name and the Node.js version you want to build. e.g.
Once you have cloned this repository, you can build a specific recipe by running `bin/local_build.sh` with the recipe (an existing one or one you create within the `recipes/` subdirectory) name and the Node.js version you want to build. e.g. (following previous example commands)

```sh
bin/local_build.sh -r musl -v v21.0.0 # build musl binaries for Node.js v21.0.0
cd ~/Devel/unofficial-builds-home/unofficial-builds
bin/local_build.sh -r musl -v v21.0.0
```

A successful build will place the source in `$workdir/staging/src/` and binaries in `$workdir/staging/release/v21.0.0/`.
A successful build will place the source in `$workdir/staging/src/` and binaries in `$workdir/staging/release/v21.0.0/` (where `$workdir` currently is `~/Devel/unnofficial-builds-home`). All of those commands are running as a normal user.

You must erase all dockers layers before run a new recipe. Take in considerations that not all recipes can be built for all versions.

## Team

Expand Down