packages feed

b9 1.1.0 → 1.1.1

raw patch · 5 files changed

+30/−21 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

.gitignore view
@@ -5,8 +5,6 @@ *.log *.profile BUILD*-dist-dist-newstyle OUT *.orig /.cabal-sandbox/@@ -25,3 +23,4 @@ *.qcow2 *.tar *.vmdk+dist*
CHANGELOG.md view
@@ -1,5 +1,13 @@ # Changelog for B9 ++## 1.1.1++* When `unique_build_dirs` __is enabled:__ +    use a truely random build-id, such that no matter how much+    or how little time passes between two consequitive builds, the `BUILD_ID`s +    will always differ with the same probability.+ ## 1.1.0  * Fix unintended deletion of images that are wrongly classified as obsolete.
README.md view
@@ -376,20 +376,20 @@ This example is the current default configuration:      [global]-    build_dir_root: Nothing+    build_dir_root: /foo/binary     keep_temp_dirs: False-    log_file: Nothing-    max_cached_shared_images: Just 2-    repository: Nothing-    repository_cache: Just (InB9UserDir "repo-cache")+    log_file: /tmp/b9.log+    max_cached_shared_images: 2+    repository: tilia+    repository_cache: InB9UserDir "repo-cache"     unique_build_dirs: True-    verbosity: Just LogInfo-    default_timeout_seconds: Just 3600-    timeout_factor: Just 4+    verbosity: LogInfo+    default_timeout_seconds: 3600+    timeout_factor: 4      [libvirt-lxc]     connection: lxc:///-    emulator_path: Just "/usr/lib/libvirt/libvirt_lxc"+    emulator_path: /usr/lib/libvirt/libvirt_lxc     guest_capabilities: [CAP_MKNOD,CAP_SYS_ADMIN,CAP_SYS_CHROOT,CAP_SETGID,CAP_SETUID,CAP_NET_BIND_SERVICE,CAP_SETPCAP,CAP_SYS_PTRACE,CAP_SYS_MODULE]     guest_ram_size: RamSize 1 GB     network: Nothing@@ -397,19 +397,19 @@      [podman]     guest_capabilities: [CAP_MKNOD,CAP_SYS_ADMIN,CAP_SYS_CHROOT,CAP_SETGID,CAP_SETUID,CAP_NET_BIND_SERVICE,CAP_SETPCAP,CAP_SYS_PTRACE,CAP_SYS_MODULE]-    network: Nothing+    network: default      [systemdNspawn]     console: read-only-    executable: Nothing-    extra_args: Nothing+    executable: /nix/store/bl92gd78ygdwmc94lrqy20ych0lrfis5-systemd-243.7/bin/systemd-nspawn+    extra_args: "--user foo"     guest_capabilities: [CAP_MKNOD,CAP_SYS_ADMIN,CAP_SYS_CHROOT,CAP_SETGID,CAP_SETUID,CAP_NET_BIND_SERVICE,CAP_SETPCAP,CAP_SYS_PTRACE,CAP_SYS_MODULE]-    max_lifetime_seconds: Just 14400+    max_lifetime_seconds: 14400     use_sudo: True      [docker]     guest_capabilities: [CAP_MKNOD,CAP_SYS_ADMIN,CAP_SYS_CHROOT,CAP_SETGID,CAP_SETUID,CAP_NET_BIND_SERVICE,CAP_SETPCAP,CAP_SYS_PTRACE,CAP_SYS_MODULE]-    network: Nothing+    network: default    ### The `[global]` Section
b9.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                b9-version:             1.1.0+version:             1.1.1  synopsis:            A tool and library for building virtual machine images. 
src/lib/B9/BuildInfo.hs view
@@ -34,6 +34,7 @@ import GHC.Stack import System.Directory import System.FilePath+import System.IO.B9Extras import Text.Printf  -- | Build meta information.@@ -76,9 +77,9 @@   Eff (BuildInfoReader ': e) a ->   Eff e a withBuildInfo action = withRootDir $ do-  now <- lift getCurrentTime -- TODO reproducability: make configurable how the build-date is generated, e.g. by using always 1970/01/01-00:01+  now <- lift getCurrentTime   let buildDate = formatTime undefined "%F-%T" now -- TODO make configurable how the build date is formatted-  buildId <- generateBuildId buildDate+  buildId <- generateBuildId    withBuildDir buildId (runImpl buildId buildDate now)   where     withRootDir f = do@@ -91,12 +92,13 @@       localB9Config         (projectRoot ?~ root)         (addLocalStringBinding ("projectRoot", root) f)-    generateBuildId buildDate = do+    generateBuildId = do       -- TODO generate a proper, reproducable build id!       unqiueBuildDir <- _uniqueBuildDirs <$> getB9Config       cfgHash <- hash . show <$> getB9Config+      actionHash <- hash . show <$> randomUUID -- TODO use the actual hash of the input       if unqiueBuildDir-        then return (printf "%08X-%08X" cfgHash (hash buildDate))+        then return (printf "%08X-%08X" cfgHash (hash actionHash))         else return (printf "%08X" cfgHash)     withBuildDir buildId f = do       root <- _projectRoot <$> getB9Config