Skip to content

Commit e702367

Browse files
authored
Merge pull request #305 from Jakuje/regenrate-bindings
misc: Add simple containerfile to regenerate bindings
2 parents 4913b50 + 5b9b4a3 commit e702367

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

cryptoki-sys/Containerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Simple ubuntu container that can be used to regenerate bindings with the provided script
2+
# when one does not use ubuntu
3+
#
4+
# Instructions:
5+
# $ podman build -t rust-cryptoki .
6+
# $ podman run -v $PWD:/src:z rust-cryptoki
7+
#
8+
FROM ubuntu:latest
9+
RUN export DEBIAN_FRONTEND=noninteractive; \
10+
export DEBCONF_NONINTERACTIVE_SEEN=true; \
11+
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
12+
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
13+
apt-get update -q && apt-get install -y rustup clang && rustup default stable
14+
15+
WORKDIR /src
16+
ENV CARGO_TARGET_DIR /src/target
17+
CMD [ "/bin/bash", "regenerate_bindings.sh" ]

cryptoki-sys/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,22 @@ available, feel free to raise a Pull Request to add it or to use build-time
2020
generation of bindings. All the committed bindings **MUST** be generated from
2121
the library version found under the `vendor` submodule.
2222

23+
## Generate bindings in container
24+
25+
To simplify generating bindings, we provide a simple container that ca be
26+
executed regardless of the operating system in use from the `cryptoki-sys`
27+
directory.
28+
29+
To generate the bindings in container, just build the container from the
30+
`Containerfile` in this directory:
31+
```
32+
$ podman build -t rust-cryptoki .
33+
```
34+
And then run it with the current working directory mounted in the container:
35+
```
36+
$ podman run -v $PWD:/src:z rust-cryptoki
37+
```
38+
It will download all the rust dependencies and regenerate all the binding
39+
tiplets.
40+
2341
*Copyright 2021 Contributors to the Parsec project.*

0 commit comments

Comments
 (0)