Skip to content

Commit 90545b2

Browse files
committed
Problem: rpm throws an interesting exception
``` [ 12/135] Installing libpcap-14:1.10.5-1.fc41.aarch64 100% | 501.3 KiB [ 13/135] Installing libfdisk-0:2.40.4-1.fc41.aarch64 100% | 413.4 KiBterminate called after throwing an instance of 'std::length_error' what(): basic_string::_M_replace_aux ``` This didn't happen before Solution: don't allocate pseudo-terminal in podman We don't really need it. Not clear why it was working before, though. And not clear what kind of problem rpm runs into when it think it's an interactive terminal, but it's a captured terminal. But now it seems to work.
1 parent e95f60c commit 90545b2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/pgpm/package/rust.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def sources
2222

2323
vendor_dir = Dir.mktmpdir("pgpm")
2424

25-
podman_cmd = "run -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} -v #{vendor_dir}:#{vendor_dir} -ti rust"
25+
podman_cmd = "run -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} -v #{vendor_dir}:#{vendor_dir} -i rust"
2626
Podman.run("#{podman_cmd} cargo add --manifest-path #{source}/Cargo.toml --dev cargo-pgrx@#{pgrx_version}")
2727
Podman.run("#{podman_cmd} cargo vendor --versioned-dirs --manifest-path #{source}/Cargo.toml #{vendor_dir}/vendor")
2828
vendored_pgrx_version = Dir.glob("cargo-pgrx-*", base: File.join(vendor_dir, "vendor"))[0].split("-").last

lib/pgpm/rpm/mock/operation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def call
6060
options = @opts.flat_map { |(k, v)| ["--config-opts", "#{k}=#{v}"] }.compact.join(" ")
6161
command = "mock #{options} #{@args.join(" ")}"
6262
map_paths = @paths.map { |p| "-v #{p}:#{p}" }.join(" ")
63-
raise "Failed to execute `#{command}`" unless Podman.run("run -v #{Dir.pwd}:#{Dir.pwd} #{map_paths} --privileged -ti ghcr.io/postgres-pm/pgpm #{command}")
63+
raise "Failed to execute `#{command}`" unless Podman.run("run -v #{Dir.pwd}:#{Dir.pwd} #{map_paths} --privileged -i ghcr.io/postgres-pm/pgpm #{command}")
6464

6565
@cb&.call
6666
end

packages/omnigres/package.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def artifacts(src = nil)
186186
rescue Git::GitExecuteError
187187
share_fix = "-e PGSHAREDIR=#{pgpath}/build/share"
188188
end
189-
unless Pgpm::Podman.run "run -ti #{share_fix} -v #{src}:#{src} -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} #{PGPM_BUILD_CONTAINER_IMAGE} cmake -S #{src} -B #{src}/build -DOPENSSL_CONFIGURED=1 -DPGVER=#{Pgpm::Postgres::Distribution.in_scope.version} -DPGDIR=#{pgpath}"
189+
unless Pgpm::Podman.run "run -i #{share_fix} -v #{src}:#{src} -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} #{PGPM_BUILD_CONTAINER_IMAGE} cmake -S #{src} -B #{src}/build -DOPENSSL_CONFIGURED=1 -DPGVER=#{Pgpm::Postgres::Distribution.in_scope.version} -DPGDIR=#{pgpath}"
190190
raise "Can't configure the project"
191191
end
192192

@@ -301,7 +301,7 @@ def install_prerequisites
301301
images = Oj.load(Pgpm::Podman.run("images --format json", print_stdout: false))
302302
unless images.flat_map { |i| i["Names"] }.include?("localhost/#{PGPM_BUILD_CONTAINER_IMAGE}:latest")
303303
tmpfile = Tempfile.new
304-
Pgpm::Podman.run "run -ti --cidfile #{tmpfile.path} #{PGPM_BUILD_CONTAINER}"
304+
Pgpm::Podman.run "run -i --cidfile #{tmpfile.path} #{PGPM_BUILD_CONTAINER}"
305305
id = File.read(tmpfile.path)
306306
tmpfile.unlink
307307
Pgpm::Podman.run "commit #{id} #{PGPM_BUILD_CONTAINER_IMAGE}"
@@ -319,7 +319,7 @@ def cmake_dependencies(dir_name = "deps")
319319
return if File.exist?(ready_marker)
320320
raise UnsupportedVersion unless File.directory?(File.join(src, "cmake", "dependencies"))
321321

322-
unless Pgpm::Podman.run "run -ti -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} #{PGPM_BUILD_CONTAINER_IMAGE} cmake -S #{src}/cmake/dependencies -B #{deps} -DCPM_SOURCE_CACHE=#{deps}/_deps"
322+
unless Pgpm::Podman.run "run -i -v #{Pgpm::Cache.directory}:#{Pgpm::Cache.directory} #{PGPM_BUILD_CONTAINER_IMAGE} cmake -S #{src}/cmake/dependencies -B #{deps} -DCPM_SOURCE_CACHE=#{deps}/_deps"
323323
raise "Can't fetch dependencies"
324324
end
325325

0 commit comments

Comments
 (0)