Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

428 rader
18 KiB

10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
10 år sedan
9 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
9 år sedan
9 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
9 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 år sedan
  1. %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
  2. %% ex: ts=4 sw=4 et
  3. %% -------------------------------------------------------------------
  4. %%
  5. %% rebar: Erlang Build Tools
  6. %%
  7. %% Copyright (c) 2009 Dave Smith (dizzyd@dizzyd.com)
  8. %%
  9. %% Permission is hereby granted, free of charge, to any person obtaining a copy
  10. %% of this software and associated documentation files (the "Software"), to deal
  11. %% in the Software without restriction, including without limitation the rights
  12. %% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. %% copies of the Software, and to permit persons to whom the Software is
  14. %% furnished to do so, subject to the following conditions:
  15. %%
  16. %% The above copyright notice and this permission notice shall be included in
  17. %% all copies or substantial portions of the Software.
  18. %%
  19. %% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. %% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. %% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. %% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. %% THE SOFTWARE.
  26. %% -------------------------------------------------------------------
  27. -module(rebar_prv_install_deps).
  28. -behaviour(provider).
  29. -export([init/1,
  30. do/1,
  31. format_error/1]).
  32. -include("rebar.hrl").
  33. -include_lib("providers/include/providers.hrl").
  34. -export([do_/1,
  35. handle_deps_as_profile/4,
  36. profile_dep_dir/2,
  37. find_cycles/1,
  38. cull_compile/2]).
  39. -export_type([dep/0]).
  40. -define(PROVIDER, install_deps).
  41. -define(DEPS, [app_discovery]).
  42. -type src_dep() :: {atom(), {atom(), string(), string()}}
  43. | {atom(), string(), {atom(), string(), string()}}.
  44. -type pkg_dep() :: {atom(), binary()} | atom().
  45. -type dep() :: src_dep() | pkg_dep().
  46. %% ===================================================================
  47. %% Public API
  48. %% ===================================================================
  49. -spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
  50. init(State) ->
  51. State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER},
  52. {module, ?MODULE},
  53. {bare, false},
  54. {deps, ?DEPS},
  55. {example, undefined},
  56. {short_desc, ""},
  57. {desc, ""},
  58. {opts, []}])),
  59. {ok, State1}.
  60. -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
  61. do(State) ->
  62. ?INFO("Verifying dependencies...", []),
  63. do_(State).
  64. do_(State) ->
  65. try
  66. Profiles = rebar_state:current_profiles(State),
  67. ProjectApps = rebar_state:project_apps(State),
  68. Upgrade = rebar_state:get(State, upgrade, false),
  69. {Apps, State1} = deps_per_profile(Profiles, Upgrade, State),
  70. State2 = rebar_state:update_all_deps(State1, Apps),
  71. CodePaths = [rebar_app_info:ebin_dir(A) || A <- Apps],
  72. State3 = rebar_state:update_code_paths(State2, all_deps, CodePaths),
  73. Source = ProjectApps ++ Apps,
  74. case find_cycles(Source) of
  75. {cycles, Cycles} ->
  76. ?PRV_ERROR({cycles, Cycles});
  77. {error, Error} ->
  78. {error, Error};
  79. {no_cycle, Sorted} ->
  80. ToCompile = cull_compile(Sorted, ProjectApps),
  81. {ok, rebar_state:deps_to_build(State3, ToCompile)}
  82. end
  83. catch
  84. %% maybe_fetch will maybe_throw an exception to break out of some loops
  85. _:{error, Reason} ->
  86. {error, Reason}
  87. end.
  88. %% @doc convert a given exception's payload into an io description.
  89. -spec format_error(any()) -> iolist().
  90. format_error({dep_app_not_found, AppDir, AppName}) ->
  91. io_lib:format("Dependency failure: Application ~ts not found at the top level of directory ~ts", [AppName, AppDir]);
  92. format_error({load_registry_fail, Dep}) ->
  93. io_lib:format("Error loading registry to resolve version of ~ts. Try fixing by running 'rebar3 update'", [Dep]);
  94. format_error({bad_constraint, Name, Constraint}) ->
  95. io_lib:format("Unable to parse version for package ~ts: ~ts", [Name, Constraint]);
  96. format_error({parse_dep, Dep}) ->
  97. io_lib:format("Failed parsing dep ~p", [Dep]);
  98. format_error({not_rebar_package, Package, Version}) ->
  99. io_lib:format("Package not buildable with rebar3: ~ts-~ts", [Package, Version]);
  100. format_error({missing_package, Package, Version}) ->
  101. io_lib:format("Package not found in registry: ~ts-~ts", [Package, Version]);
  102. format_error({missing_package, Package}) ->
  103. io_lib:format("Package not found in registry: ~ts", [Package]);
  104. format_error({cycles, Cycles}) ->
  105. Prints = [["applications: ",
  106. [io_lib:format("~ts ", [Dep]) || Dep <- Cycle],
  107. "depend on each other\n"]
  108. || Cycle <- Cycles],
  109. ["Dependency cycle(s) detected:\n", Prints];
  110. format_error(Reason) ->
  111. io_lib:format("~p", [Reason]).
  112. %% @doc Allows other providers to install deps in a given profile
  113. %% manually, outside of what is provided by rebar3's deps tuple.
  114. -spec handle_deps_as_profile(Profile, State, Deps, Upgrade) -> {Apps, State} when
  115. Profile :: atom(),
  116. State :: rebar_state:t(),
  117. Deps :: [tuple() | atom() | binary()], % TODO: meta to source() | lock()
  118. Upgrade :: boolean(),
  119. Apps :: [rebar_app_info:t()].
  120. handle_deps_as_profile(Profile, State, Deps, Upgrade) ->
  121. Locks = [],
  122. Level = 0,
  123. DepsDir = profile_dep_dir(State, Profile),
  124. Deps1 = rebar_app_utils:parse_deps(DepsDir, Deps, State, Locks, Level),
  125. ProfileLevelDeps = [{Profile, Deps1, Level}],
  126. RootSeen = sets:from_list([rebar_app_info:name(AppInfo)
  127. || AppInfo <- rebar_state:project_apps(State)]),
  128. handle_profile_level(ProfileLevelDeps, [], RootSeen, RootSeen, Upgrade, Locks, State).
  129. %% ===================================================================
  130. %% Internal functions
  131. %% ===================================================================
  132. %% finds all the deps in `{deps, ...}` for each profile provided.
  133. deps_per_profile(Profiles, Upgrade, State) ->
  134. Level = 0,
  135. Locks = rebar_state:get(State, {locks, default}, []),
  136. Deps = lists:foldl(fun(Profile, DepAcc) ->
  137. [parsed_profile_deps(State, Profile, Level) | DepAcc]
  138. end, [], Profiles),
  139. RootSeen = sets:from_list([rebar_app_info:name(AppInfo)
  140. || AppInfo <- rebar_state:project_apps(State)]),
  141. handle_profile_level(Deps, [], RootSeen, RootSeen, Upgrade, Locks, State).
  142. parsed_profile_deps(State, Profile, Level) ->
  143. ParsedDeps = rebar_state:get(State, {parsed_deps, Profile}, []),
  144. {Profile, ParsedDeps, Level}.
  145. %% Level-order traversal of all dependencies, across profiles.
  146. %% If profiles x,y,z are present, then the traversal will go:
  147. %% x0, y0, z0, x1, y1, z1, ..., xN, yN, zN.
  148. %%
  149. %% There are two 'seen' sets: one for the top-level apps (`RootSeen') and
  150. %% one for all dependencies (`Seen'). The former is used to know when
  151. %% to skip the resolving of dependencies altogether (since they're already
  152. %% top-level apps), while the latter is used to prevent reprocessing
  153. %% deps more than one.
  154. handle_profile_level([], Apps, _RootSeen, _Seen, _Upgrade, _Locks, State) ->
  155. {Apps, State};
  156. handle_profile_level([{Profile, Deps, Level} | Rest], Apps, RootSeen, Seen, Upgrade, Locks, State) ->
  157. Deps0 = [rebar_app_utils:expand_deps_sources(Dep, State)
  158. || Dep <- Deps,
  159. %% skip top-level apps being double-declared
  160. not sets:is_element(rebar_app_info:name(Dep), RootSeen)],
  161. {Deps1, Apps1, State1, Seen1} =
  162. update_deps(Profile, Level, Deps0, Apps
  163. ,State, Upgrade, Seen, Locks),
  164. Deps2 = case Deps1 of
  165. [] -> Rest;
  166. _ -> Rest ++ [{Profile, Deps1, Level+1}]
  167. end,
  168. handle_profile_level(Deps2, Apps1, RootSeen, sets:union(Seen, Seen1), Upgrade, Locks, State1).
  169. find_cycles(Apps) ->
  170. case rebar_digraph:compile_order(Apps) of
  171. {error, {cycles, Cycles}} -> {cycles, Cycles};
  172. {error, Error} -> {error, Error};
  173. {ok, Sorted} -> {no_cycle, Sorted}
  174. end.
  175. cull_compile(TopSortedDeps, ProjectApps) ->
  176. lists:dropwhile(fun not_needs_compile/1, TopSortedDeps -- ProjectApps).
  177. maybe_lock(Profile, AppInfo, Seen, State, Level) ->
  178. Name = rebar_app_info:name(AppInfo),
  179. case rebar_app_info:is_checkout(AppInfo) of
  180. false ->
  181. case Profile of
  182. default ->
  183. case sets:is_element(Name, Seen) of
  184. false ->
  185. Locks = rebar_state:lock(State),
  186. case lists:any(fun(App) -> rebar_app_info:name(App) =:= Name end, Locks) of
  187. true ->
  188. {sets:add_element(Name, Seen), State};
  189. false ->
  190. {sets:add_element(Name, Seen),
  191. rebar_state:lock(State, rebar_app_info:dep_level(AppInfo, Level))}
  192. end;
  193. true ->
  194. {Seen, State}
  195. end;
  196. _ ->
  197. {sets:add_element(Name, Seen), State}
  198. end;
  199. true ->
  200. {sets:add_element(Name, Seen), State}
  201. end.
  202. update_deps(Profile, Level, Deps, Apps, State, Upgrade, Seen, Locks) ->
  203. lists:foldl(
  204. fun(AppInfo, {DepsAcc, AppsAcc, StateAcc, SeenAcc}) ->
  205. update_dep(AppInfo, Profile, Level,
  206. DepsAcc, AppsAcc, StateAcc,
  207. Upgrade, SeenAcc, Locks)
  208. end,
  209. {[], Apps, State, Seen},
  210. rebar_utils:sort_deps(Deps)).
  211. update_dep(AppInfo, Profile, Level, Deps, Apps, State, Upgrade, Seen, Locks) ->
  212. %% If not seen, add to list of locks to write out
  213. Name = rebar_app_info:name(AppInfo),
  214. case sets:is_element(Name, Seen) of
  215. true ->
  216. update_seen_dep(AppInfo, Profile, Level,
  217. Deps, Apps,
  218. State, Upgrade, Seen, Locks);
  219. false ->
  220. update_unseen_dep(AppInfo, Profile, Level,
  221. Deps, Apps,
  222. State, Upgrade, Seen, Locks)
  223. end.
  224. profile_dep_dir(State, Profile) ->
  225. case Profile of
  226. default -> filename:join([rebar_dir:profile_dir(rebar_state:opts(State), [default]), rebar_state:get(State, deps_dir, ?DEFAULT_DEPS_DIR)]);
  227. _ -> rebar_dir:deps_dir(State)
  228. end.
  229. update_seen_dep(AppInfo, _Profile, _Level, Deps, Apps, State, Upgrade, Seen, Locks) ->
  230. Name = rebar_app_info:name(AppInfo),
  231. %% If seen from lock file or user requested an upgrade
  232. %% don't print warning about skipping
  233. case lists:keymember(Name, 1, Locks) of
  234. false when Upgrade ->
  235. ok;
  236. false when not Upgrade ->
  237. {ok, SeenApp} = rebar_app_utils:find(Name, Apps),
  238. Source = rebar_app_info:source(AppInfo),
  239. case rebar_app_info:source(SeenApp) of
  240. Source ->
  241. %% dep is the same version and checksum as the one we already saw.
  242. %% meaning there is no conflict, so don't warn about it.
  243. skip;
  244. _ ->
  245. warn_skip_deps(Name, Source, State)
  246. end;
  247. true ->
  248. ok
  249. end,
  250. {Deps, Apps, State, Seen}.
  251. update_unseen_dep(AppInfo, Profile, Level, Deps, Apps, State, Upgrade, Seen, Locks) ->
  252. {NewSeen, State1} = maybe_lock(Profile, AppInfo, Seen, State, Level),
  253. {_, AppInfo1} = maybe_fetch(AppInfo, Profile, Upgrade, Seen, State1),
  254. DepsDir = profile_dep_dir(State, Profile),
  255. {AppInfo2, NewDeps, State2} =
  256. handle_dep(State1, Profile, DepsDir, AppInfo1, Locks, Level),
  257. AppInfo3 = rebar_app_info:dep_level(AppInfo2, Level),
  258. {NewDeps ++ Deps, [AppInfo3 | Apps], State2, NewSeen}.
  259. -spec handle_dep(rebar_state:t(), atom(), file:filename_all(), rebar_app_info:t(), list(), integer()) -> {rebar_app_info:t(), [rebar_app_info:t()], rebar_state:t()}.
  260. handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) ->
  261. Name = rebar_app_info:name(AppInfo),
  262. AppInfo1 = rebar_app_info:apply_overrides(rebar_app_info:get(AppInfo, overrides, []), AppInfo),
  263. AppInfo2 = rebar_app_info:apply_profiles(AppInfo1, [default, prod]),
  264. Plugins = rebar_app_info:get(AppInfo2, plugins, []),
  265. AppInfo3 = rebar_app_info:set(AppInfo2, {plugins, Profile}, Plugins),
  266. %% Will throw an exception if checks fail
  267. rebar_app_info:verify_otp_vsn(AppInfo3),
  268. %% Dep may have plugins to install. Find and install here.
  269. State1 = rebar_plugins:install(State, AppInfo3),
  270. %% Upgrade lock level to be the level the dep will have in this dep tree
  271. Deps = rebar_app_info:get(AppInfo3, {deps, default}, []) ++ rebar_app_info:get(AppInfo3, {deps, prod}, []),
  272. AppInfo4 = rebar_app_info:deps(AppInfo3, rebar_state:deps_names(Deps)),
  273. %% Keep all overrides from the global config and this dep when parsing its deps
  274. Overrides = rebar_app_info:get(AppInfo, overrides, []),
  275. Deps1 = rebar_app_utils:parse_deps(Name, DepsDir, Deps, rebar_state:set(State, overrides, Overrides)
  276. ,Locks, Level+1),
  277. {AppInfo4, Deps1, State1}.
  278. -spec maybe_fetch(rebar_app_info:t(), atom(), boolean(),
  279. sets:set(binary()), rebar_state:t()) -> {ok, rebar_app_info:t()}.
  280. maybe_fetch(AppInfo, Profile, Upgrade, Seen, State) ->
  281. AppDir = rebar_utils:to_list(rebar_app_info:dir(AppInfo)),
  282. %% Don't fetch dep if it exists in the _checkouts dir
  283. case rebar_app_info:is_checkout(AppInfo) of
  284. true ->
  285. {ok, AppInfo};
  286. false ->
  287. case rebar_app_info:is_available(AppInfo) of
  288. false ->
  289. AppInfo1 = fetch_app(AppInfo, State),
  290. maybe_symlink_default(State, Profile, AppDir, AppInfo1),
  291. {ok, rebar_app_info:is_available(rebar_app_info:valid(AppInfo1, false), true)};
  292. true ->
  293. case sets:is_element(rebar_app_info:name(AppInfo), Seen) of
  294. true ->
  295. {ok, AppInfo};
  296. false ->
  297. maybe_symlink_default(State, Profile, AppDir, AppInfo),
  298. AppInfo1 = maybe_upgrade(AppInfo, AppDir, Upgrade, State),
  299. {ok, AppInfo1}
  300. end
  301. end
  302. end.
  303. needs_symlinking(State, Profile) ->
  304. case {rebar_state:current_profiles(State), Profile} of
  305. {[default], default} ->
  306. %% file will be in default already -- this is the only run we have
  307. false;
  308. {_, default} ->
  309. %% file fetched to default, needs to be linked to the current
  310. %% run's directory.
  311. true;
  312. _ ->
  313. %% File fetched to the right directory already
  314. false
  315. end.
  316. maybe_symlink_default(State, Profile, AppDir, AppInfo) ->
  317. case needs_symlinking(State, Profile) of
  318. true ->
  319. SymDir = filename:join([rebar_dir:deps_dir(State),
  320. rebar_app_info:name(AppInfo)]),
  321. symlink_dep(State, AppDir, SymDir),
  322. true;
  323. false ->
  324. false
  325. end.
  326. symlink_dep(State, From, To) ->
  327. filelib:ensure_dir(To),
  328. case rebar_file_utils:symlink_or_copy(From, To) of
  329. ok ->
  330. RelativeFrom = make_relative_to_root(State, From),
  331. RelativeTo = make_relative_to_root(State, To),
  332. ?INFO("Linking ~ts to ~ts", [RelativeFrom, RelativeTo]),
  333. ok;
  334. exists ->
  335. ok
  336. end.
  337. make_relative_to_root(State, Path) when is_binary(Path) ->
  338. make_relative_to_root(State, binary_to_list(Path));
  339. make_relative_to_root(State, Path) when is_list(Path) ->
  340. Root = rebar_dir:root_dir(State),
  341. rebar_dir:make_relative_path(Path, Root).
  342. fetch_app(AppInfo, State) ->
  343. ?INFO("Fetching ~ts (~p)", [rebar_app_info:name(AppInfo),
  344. rebar_resource_v2:format_source(rebar_app_info:source(AppInfo))]),
  345. rebar_fetch:download_source(AppInfo, State).
  346. maybe_upgrade(AppInfo, _AppDir, Upgrade, State) ->
  347. case Upgrade orelse rebar_app_info:is_lock(AppInfo) of
  348. true ->
  349. case rebar_fetch:needs_update(AppInfo, State) of
  350. true ->
  351. ?INFO("Upgrading ~ts (~p)", [rebar_app_info:name(AppInfo),
  352. rebar_resource_v2:format_source(rebar_app_info:source(AppInfo))]),
  353. rebar_fetch:download_source(AppInfo, State);
  354. false ->
  355. case Upgrade of
  356. true ->
  357. ?INFO("No upgrade needed for ~ts", [rebar_app_info:name(AppInfo)]),
  358. AppInfo;
  359. false ->
  360. AppInfo
  361. end
  362. end;
  363. false ->
  364. AppInfo
  365. end.
  366. warn_skip_deps(Name, Source, State) ->
  367. Msg = "Skipping ~ts (from ~p) as an app of the same name "
  368. "has already been fetched",
  369. Args = [Name,
  370. rebar_resource_v2:format_source(Source)],
  371. case rebar_state:get(State, deps_error_on_conflict, false) of
  372. false ->
  373. case rebar_state:get(State, deps_warning_on_conflict, true) of
  374. true -> ?WARN(Msg, Args);
  375. false -> ok
  376. end;
  377. true ->
  378. ?ERROR(Msg, Args), ?FAIL
  379. end.
  380. not_needs_compile(App) ->
  381. not(rebar_app_info:is_checkout(App))
  382. andalso rebar_app_info:valid(App)
  383. andalso rebar_app_info:has_all_artifacts(App) =:= true.