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

More local repo documentation tweaks #578

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please lint and spellcheck your contributions before creating a pull request. We
- This project includes `prettier` for markdown and code formatting
- Command: `yarn prettier`
- This project includes Cspell for spell-checking, and has a custom wordlist `.cspell-allowed-wordlist.txt`
- Command: `yarn cspell`
- Command: `go-task spellcheck`
- Note that we use American spelling
- If you use vscode with the Code Spell Checker extension, the custom dictionary will be used
- You can tidy the allowed-wordlist with `go-task tidy-words`
Expand Down
39 changes: 27 additions & 12 deletions docs/packaging/advanced-config/local-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@

### Copying `.eopkg` files to the local repository

To use your locally built `.eopkg` files as a dependencies for another package, you must copy the regular package file, and any accompanying `-devel` packages to the local repository directory `/var/lib/solbuild/local`.
To use your locally built `.eopkg` package files as dependencies for another package, you must copy the regular package files, and any accompanying `-devel` package files to the `/var/lib/solbuild/local` local repository directory.

For example, building the package `libcmis` produces the packages `libcmis` and `libcmis-devel`. Both should be copied to the local repository to build other packages against `libcmis`
For example, building the package `libcmis` produces the packages `libcmis` and `libcmis-devel`. Both should be copied to the local repository to build other packages against `libcmis`.

To copy all `.eopkg` files within a directory to the local repository, use the following command:

```bash
sudo cp *.eopkg /var/lib/solbuild/local
sudo cp -v *.eopkg /var/lib/solbuild/local
```

### Listing locally built eopkg files

Use this to list all index and eopkg files in the local repo folder
Use this to list all index and eopkg files in the local repository:

```bash
go-task list-local
Expand All @@ -51,18 +51,33 @@

Every time you run `go-task build-local`, all `.eopkg` files in the local repository will be re-indexed.

### A streamlined local repository workflow for stack updates

If you know ahead of time that you are going to need to put the package files from the current build into the local repository as dependencies for subsequent builds, you can use:

```bash
go-task build-localcp

Check warning on line 59 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (localcp)
```

The `build-localcp` task will:

Check warning on line 62 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (localcp)
- Build the current package against any existing packages in your local repository.
- Copy the newly built package files to your local repository.
- Re-index your local repository.

The `build-localcp` workflow can be very convenient when you are doing stack updates.

Check warning on line 67 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (localcp)

### Best practices when working with a solbuild local repository

There are some important things to know when working with local repositories, as they may lead to issues later on.

- `solbuild` will use your version of a package from the local repository regardless of whether there's a higher release in the Solus repository. Therefore:
- Only use `go-task build-local` when required
- Remove old packages from the local repository when they are no longer needed, and rebuild its index with the following commands (this will remove all locally built eopkgs)
```bash
go-task clean-local
go-task build-localindex
```
- If a package is already installed in the `solbuild` image, the release must be higher for it to be installed.
- `solbuild` will use your version of a package from the local repository regardless of whether there's a higher release in the Solus repository. Therefore:
- Only use the `build-local` or `build-localcp` tasks when required.

Check warning on line 74 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (localcp)
- Old packages in the local repository can be removed with the `clean-local` task:
```bash
go-task clean-local
```
Note that the `clean-local` task will automatically re-index the (now empty) local repository.
- If a package is already installed in the `solbuild` image, the release number of the updated version must be higher for it to be installed and used as a dependency at build time.

## Installing packages from the local repository index

Expand All @@ -75,7 +90,7 @@
To generate or refresh the `eopkg` index in `/var/lib/solbuild/local`, use the following command:

```bash
go-task build-localindex

Check warning on line 93 in docs/packaging/advanced-config/local-repository.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (localindex)
```

Or, if you have our [helper functions](/docs/packaging/prepare-for-packaging#set-up-repository-helper-functions-optional) set up, you get the same result by running:
Expand Down