about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2019-12-19 chore(buildGo): Relayout for depot mergeVincent Ambo9-0/+0
2019-12-15 fix(external): Correctly determine binary name if locator is emptyVincent Ambo1-1/+1
If the root of a project is a binary, the previous logic would generate invalid names. This ensure that the last path component of the name is used.
2019-12-13 feat(external): Compile Go assembly and include it in pkg archiveVincent Ambo1-5/+17
This was the final step required to add support for packages that make use of Go assembly, such as golang.org/x/sys.
2019-12-13 feat(external): Include *.s (ASM) files in external buildsVincent Ambo2-0/+9
2019-12-13 feat(buildGo): Support linking of symabi files for ASM sourcesVincent Ambo1-2/+7
2019-12-13 fix(external): Fix "inverted" local dependenciesVincent Ambo1-1/+3
Usually in large packages the root depends on one or more sub-packages (or there is no root), but some projects (e.g. golang.org/x/oauth2) do it the other way around. This fix adds compatibility for both ways.
2019-12-13 docs(README): Update description of buildGo.externalVincent Ambo1-13/+14
2019-12-13 fix(proto): Refactor gRPC dependencies to match new external layoutVincent Ambo1-8/+24
This is now a lot more fine-grained than before, but it actually works fine. This stuff is a bit annoying to write by hand. There are multiple different options available (e.g. carrying an attribute set of all subpackages in each `external` and only passing that, having a tool generate this, etc.).
2019-12-13 fix(buildGo): Correctly refer to goGrpc packageVincent Ambo1-1/+1
2019-12-13 feat(external): Support foreign dependencies in external packagesVincent Ambo1-5/+22
Users can supply a list of foreign dependencies in calls to buildGo.external. These are now appropriately inserted into packages that *need them* and no further, resolving issues with complex internal recursion in some repositories!
2019-12-13 fix(external): Skip folders with "no buildable Go files"Vincent Ambo1-2/+13
This error is returned by the build analysis logic if the target package does not have any relevant Go files, which might be the case if `+build` flags and such are used.
2019-12-13 style(external): Minor formatting fixesVincent Ambo1-1/+11
2019-12-13 fix(buildGo): Update buildGo.proto for compatibility with externalVincent Ambo2-8/+4
Changes in the structure of buildGo.external meant that the package layout for the protobuf library is now slightly different. `proto` has been amended to work with the new structure. Callers of buildGo.proto do not need to be updated (i.e. the example still works).
2019-12-13 feat(external): Switch between packages & programs automaticallyVincent Ambo2-9/+21
2019-12-13 feat(buildGo): Expose new external builderVincent Ambo1-87/+14
2019-12-13 feat(external): Implement builder function for externalsVincent Ambo1-2/+29
Implements a builder function that calls the analysis tool on the provided source and builds up the required attribute set, including local dependencies.
2019-12-13 feat(external): Add fully qualified import path to analyser outputVincent Ambo1-6/+8
This is used by Nix to build the derivation names for individual packages.
2019-12-13 fix(external): Correctly set names for root packagesVincent Ambo1-5/+13
Fixes the prefix trimming logic for package names and source files if the source files appear in the package root (which is, unsurprisingly, very common).
2019-12-13 fix(external): Ensure findGoDirs "finds" top-level directoryVincent Ambo1-20/+10
Due to the lexical walk order of `filepath.Walk` the previous directory identification logic failed under certain conditions if the top-level directory contained Go files that showed up *after* the first subdirectories. To simplify the logic a set of directories is now gathered instead on a file-level.
2019-12-13 feat(external): Return references in more useable format for NixVincent Ambo1-16/+20
Sub-packages of external dependencies are traversed by Nix as a tree of attribute sets which need to be accessed by "path". To make this easier, the dependency analyser now returns "paths" as string lists.
2019-12-13 feat(external): Implement tool to analyse external dependenciesVincent Ambo2-0/+188
Adds a tool that can analyse dependencies that were not originally meant to be built with buildGo.nix and return information that can be used to construct appropriate Nix dependencies. The tool will return information about package-local and foreign dependencies separately to let Nix determine whether all required dependencies are provided and to correctly link together sub-packages. To avoid listing standard library imports in the dependencies, a list of all packages in the standard library is generated statically to allow for those to be filtered out during the analysis. This tool is still work-in-progress.
2019-12-13 feat(buildGo): Expose Go import path for packagesVincent Ambo1-1/+1
2019-12-13 fix(buildGo): Ensure 'proto' libraries are overridableVincent Ambo1-1/+1
2019-12-13 feat(buildGo): Add new traversing external' implementationVincent Ambo1-9/+46
Adds an alternative implementation of a builder for external packages which traverses packages and builds up an attribute set tree out of their structure. Currently this is not functional because there is no useable method of specifying dependencies within that package set.
2019-12-09 feat(buildGo): Add 'overrideGo' argument overriding functionVincent Ambo1-2/+14
This makes it possible to override arguments to the Go builders downstream in the style of `overrideAttrs` from standard nixpkgs derivations. For example, given a Nix value `foo` that builds a binary called `foo` the name of this binary could be changed and a new dependency on `somelib` added like so: foo.overrideGo(old: { name = "bar"; deps = old.deps ++ [ somelib ]; })
2019-11-27 docs: Add README file that describes project usage & backgroundVincent Ambo1-0/+139
2019-11-26 feat(buildGo): Add support for gRPC packagesVincent Ambo1-5/+8
Introduces buildGo.grpc which is like buildGo.proto, but adds dependencies on the gRPC libraries.
2019-11-26 feat(proto): Add protobuf & gRPC dependencies via externalVincent Ambo2-12/+74
Moves the Protobuf & gRPC dependencies to a separate file which uses buildGo.external to build the dependencies. The versions are pinned at master of 2019-11-26.
2019-11-26 feat(buildGo): Add 'srcOnly' and 'targets' parameters for externalVincent Ambo1-4/+4
Adds two new parameters to buildGo.external: * `srcOnly` toggles whether the created derivation should contain only the source code, or the built package. This is useful in situations where some sub-packages of a larger package are needed and the build should be deferred to the package depending on them. It defaults to false, meaning that external packages are built by default. * `targets` controls which "sub-packages" of the target package are built. It defaults to building all sub-packages.
2019-11-25 feat(buildGo): Add support for building "external" Go librariesVincent Ambo1-53/+51
Adds a buildGo.external function that can build packages following the default go-tool package layout. Dependencies work the same way as they do for other buildGo-packages, but instead of being passed straight to the compiler a fake GOPATH is assembled using a symlink forest. External currently supports very few direct configuration options and was primarily created to build the protobuf packages, but it is also useful for including external dependencies in buildGo-native projects. The previous complex build logic for the protobuf package has been replaced with a call to `external`.
2019-11-24 feat(example): Demonstrate usage of x_defs flag to buildGo.programVincent Ambo2-0/+7
2019-11-24 feat(buildGo): Add support for x_defs option in buildGo.programVincent Ambo1-2/+4
This lets users define an attribute set with link time options.
2019-11-24 feat(example): Add an example for how to use buildGo buildersVincent Ambo4-0/+84
2019-11-24 feat: Add support for Protobuf-generated librariesVincent Ambo1-3/+75
Adds a 'buildGo.proto' function which takes a single .proto file as its source and generates a corresponding Go library which can then be imported. 'proto' takes these arguments (Yants-style type definition): struct "protoArgs" { # required: name = string; proto = path; # optional: extraDeps = list goLib; # defaults to [ ] protocFlags = option string; } Note that proto libraries will automatically have dependencies for the required protobuf Go libraries added to them. gRPC is not (yet) supported.
2019-11-23 feat: Check in buildGo with program & package buildersVincent Ambo1-0/+70
2019-11-23 chore: initial commitVincent Ambo0-0/+0