- Create repo
- Create
portsandversionsdirectories - Create
versions/baseline.json
- Add
ports/<name>/portfile.cmakewith a CMake instructions on how to obtain the sources - Add
ports/<name>/vcpkg.jsonwith the package details and dependencies - Add patches if required
- Add
ports/<name>/CMakeLists.txtwith build instructions - Test the build with
vcpkg install <portname> --overlay-ports=./port/<name> - Commit port content
- Add
versions/<first-letter-of-name-and-minus>/<name>.jsonwith the desired version and point git-tree field to the commit of the port, using an output ofgit rev-parse HEAD:ports/<name> - Add (if it's the first one added) or update package's version in
versions/baseline.json(it always points to the latest within the registry) vcpkg --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions x-add-version --all --verbosein the root directory
Clang
# vcpkg --help
# vcpkg install --debug --clean-buildtrees-after-build --no-print-usage --overlay-ports=./ports/ <portname>
# vcpkg x-ci-clean
# vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verbose
devcontainer up --config=.devcontainer/clang/devcontainer.json --remove-existing-container --id-label=label=vcpkg-clang --workspace-folder .
# devcontainer exec --id-label=label=vcpkg-clang --config=.devcontainer/clang/devcontainer.json --workspace-folder . <command>
devcontainer exec --id-label=label=vcpkg-clang --config=.devcontainer/clang/devcontainer.json --workspace-folder . vcpkg install --debug --clean-buildtrees-after-build --no-print-usage --overlay-ports=./ports/ hermes
devcontainer exec --id-label=label=vcpkg-clang --config=.devcontainer/clang/devcontainer.json --workspace-folder . vcpkg x-ci-clean
devcontainer exec --id-label=label=vcpkg-clang --config=.devcontainer/clang/devcontainer.json --workspace-folder . vcpkg remove hermes
devcontainer exec --id-label=label=vcpkg-clang --config=.devcontainer/clang/devcontainer.json --workspace-folder . vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verboseGCC
# vcpkg --help
# vcpkg install --debug --clean-buildtrees-after-build --no-print-usage --overlay-ports=./ports/ <portname>
# vcpkg x-ci-clean
# vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verbose
devcontainer up --config=.devcontainer/gnu/devcontainer.json --remove-existing-container --id-label=label=vcpkg-gcc --workspace-folder .
# devcontainer exec --id-label=label=vcpkg-gcc --config=.devcontainer/gnu/devcontainer.json --workspace-folder . <command>
devcontainer exec --id-label=label=vcpkg-gcc --config=.devcontainer/gnu/devcontainer.json --workspace-folder . vcpkg install --debug --clean-buildtrees-after-build --no-print-usage --overlay-ports=./ports/ hermes
devcontainer exec --id-label=label=vcpkg-gcc --config=.devcontainer/gnu/devcontainer.json --workspace-folder . vcpkg x-ci-clean
devcontainer exec --id-label=label=vcpkg-gcc --config=.devcontainer/gnu/devcontainer.json --workspace-folder . vcpkg remove hermes
devcontainer exec --id-label=label=vcpkg-gcc --config=.devcontainer/gnu/devcontainer.json --workspace-folder . vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verboseImagine that we're at the moment of RN 0.76.6 release, while this registry points to the RN 0.76.5 as the latest. Our goal is to update react-native-jsi port to the latest version.
- Prerequisites:
vcpkgbinary or container (ghcr.io/danceaway-app/vcpkg:latest),danceaway-app/vcpkgrepo cloned - Modify
ports/react-native-jsi/portfile.cmake: setREFto the new tag, 0.76.6; setSHA512to any value, like 0 - Modify
ports/react-native-jsi/vcpkg.json: setversion-stringto the new tag, 0.76.6 - If any dependencies like folly are updated, change them accordingly
- Run
devcontainer up --workspace-folder .once to setup build container (CLang and vcpkg environment) - Run
devcontainer exec --workspace-folder . vcpkg install react-native-jsi --overlay-ports=./ports/react-native-jsito evaluate new version - could you build it. If there are any errors, review output and logs (recommended to attach to building container in a separate terminal and troubleshoot build issues - There would be at least one error caused by the
SHA512being set to 0 previously. In the output the correct hash is printed, use it to modifyportfile.cmake'sSHA512(this is DA official WAY, btw) - If needed, build state in the container could be reset with
devcontainer exec --workspace-folder . vcpkg x-ci-clean(other commands are described byvcpkg help commands) - Once the new version builds and installed, commit changes in the
portdirectory. I suggest to form commit message as "[react-native-jsi] 0.76.6 port files" - Now, adding the changes to the history (baseline) could be done either manually or by vcpkg command, choose your poison:
- Manually:
- Run
git rev-parse HEAD:ports/react-native-jsito obtain commit hash - Modify
versions/r-/react-native-jsi.json: add new version object, use commit hash from previous step to fillgit-treefield value - Modify
versions/baseline.json: changebaselineversion to the latest, 0.76.6 in this example - Commit change in the
versionsdirectory. I suggest to form commit message as "[react-native-jsi] 0.76.6 add to baseline" - Run
devcontainer exec --workspace-folder . vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verbose: if everything is done correctly, green output is printed. Otherwise, error in red would be present and (!) versions in baseline.json and react-native-jsi.json would be reverted
- Run
- Via vcpkg:
- Run
devcontainer exec --workspace-folder . vcpkg x-add-version --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions --all --verbose - Commit change in the
versionsdirectory. I suggest to form commit message as "[react-native-jsi] 0.76.6 add to baseline"
- Run