`xsv` is no longer maintained and the author recommends `xan` instead.
Fortunately, `xan` is very suitable for our use-case; is very efficient,
and produces no differences in our expected output.
Also update build process for a successful build and better caching.
Despite recent releases, hledger-iadd's stack configuration is not
regularly maintained (very out of date). The install documentation is
also very out of date. The maintainer appears to be using cabal for
building.
As discussed in #216, hledger-flow breaks with the latest hledger
release (1.50).
Until hledger-flow has another release, current master tip appears to be
as stable as v0.15.0 and includes fixes that work with hledger 1.50.
This commit brings a complete overhaul of the build system:
- Creates a separation of concerns for 'local' and 'remote' building
* 'local' is built locally via the docker-finance `build` command
* 'remote' is built *outside* of the docker-finance `build` command
(pushed to a remote registry and then pulled by the 'local' build)
* Related refactoring
- Dockerfiles
- `lib_gen`
- Adds remote image 'hledger-suite'
* Provides the latest versions of all `hledger` related binaries
* No longer relies on package maintainers / out-dated packages
- Adds remote image 'docker-finance'
* Provides base image for 'finance' and 'dev-tools' images
- tags 'archlinux' | 'ubuntu' | 'dev-tools'
- Removes previous `hledger` related build modules
* Removes building any `hledger` related binaries locally
- Removes 'experimental' build
* End-user can use local custom Dockerfile and/or custom tag instead
- Updates the 'default' | 'slim' | 'tiny' | 'micro' build types
* Refactors build type requirements into separate build modules
- Adds 'fetch' module
- Adds 'track' module
- Adds 'user' module
* creates container user *after* base and all other modules
* allows for quick re-building across multiple local users
- Updates 'root' module
* `lib_docker`
- Updates usage help
- Adds build modules per build type
- Huge optimizations
* Vastly improves build times
- ~60% faster w/ a fresh build
- ~60%-90% faster rebuild (depending on image type)
* Vastly improves image sizes
- e.g., 'default' Arch Linux image size is ~50% smaller
Adding the finance user as late as possible within the base Dockerfile
will allow for faster build times when rebuilding with different users
(the base layers won't need to be rebuilt).
- Dockerfiles: separation of concerns for build types
- Dockerfiles: pull from respective hledger-based branches/tags
- Dockerfiles: move hledger-based test building into experimental
- docker-finance.yaml: add commented package 'unuran' (experimental)
When running `finance` image's `import` command (but only when
container's hledger-flow coinbase/coinbase-pro accounts are imported),
the following error is given:
```
IsADirectoryError: [Errno 21] Is a directory: '/etc/timezone'
Selector name 'id' does not exist as a named header in the given CSV data.
```
specifically, after enabling verbose printing of `csvjoin` (which is only
used within these accounts), the following error is given:
```
File "/home/user/.local/share/pipx/venvs/csvkit/lib/python3.12/site-packages/babel/localtime/_unix.py", line 57, in _get_localzone
with open(tzpath, 'rb') as tzfile:
^^^^^^^^^^^^^^^^^^
```
where all errors prevent the successful import of applicable accounts.
The python error appears to have been introduced in csvkit 2.0.0 and
appears to be the result of an upstream decision (or bug) to not test
whether /etc/timezone is a directory or a file (Arch Linux treats
/etc/timezone as a directory).
Fortunately, docker-finance's mounting of /etc/localtime appears to
satisfy use-case requirements; so, /etc/timezone is no longer needed.
Removing /etc/timezone resolves all errors.