Skip to content

Commit 346afd5

Browse files
committed
update preprocess file
1 parent ec23251 commit 346afd5

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/spec-node/dockerCompose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export async function buildAndExtendDockerCompose(configWithRaw: SubstitutedConf
168168
const { context, dockerfilePath, target } = serviceInfo.build;
169169
const resolvedDockerfilePath = cliHost.path.isAbsolute(dockerfilePath) ? dockerfilePath : path.resolve(context, dockerfilePath);
170170
let originalDockerfile = (await cliHost.readFile(resolvedDockerfilePath)).toString();
171-
if (params.isPodman && resolvedDockerfilePath.endsWith('.in')) {
171+
if (resolvedDockerfilePath.endsWith('.in')) {
172172
originalDockerfile = await preprocessDockerfileIn(resolvedDockerfilePath, cliHost.exec, output);
173173
}
174174
dockerfile = originalDockerfile;

src/spec-node/dockerfileUtils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,16 @@ export async function preprocessDockerfileIn(dockerfilePath: string, exec: ExecF
274274
exec,
275275
cmd: 'cpp',
276276
// -undef: do not predefine platform/compiler macros
277-
// -fdirectives-only: only process directives, do not expand macros
278277
// -w: suppress warnings
279278
// -P: suppress linemarker output lines
280-
args: ['-undef', '-fdirectives-only', '-w', '-P', dockerfilePath],
279+
args: ['-P', dockerfilePath],
281280
output,
282281
});
283282
} catch (err: any) {
284283
if (err?.code === 'ENOENT' || err?.message?.includes('ENOENT')) {
285284
throw new Error(
286285
`Preprocessing '${dockerfilePath}' requires 'cpp', but it was not found on the host. ` +
287-
`Please install cpp (e.g. "sudo apt-get install cpp") to use Dockerfile.in files with Podman.`
286+
`Please install cpp (e.g. "sudo apt-get install cpp") to use Dockerfile.in files with devcontainers.`
288287
);
289288
}
290289
const stderrText = err?.stderr ? `\n${(err.stderr as Buffer).toString()}` : '';

src/spec-node/singleContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function buildAndExtendImage(buildParams: DockerResolverParameters, config
131131
}
132132

133133
let dockerfile = (await cliHost.readFile(dockerfilePath)).toString();
134-
if (buildParams.isPodman && dockerfilePath.endsWith('.in')) {
134+
if (dockerfilePath.endsWith('.in')) {
135135
dockerfile = await preprocessDockerfileIn(dockerfilePath, cliHost.exec, output);
136136
}
137137
const originalDockerfile = dockerfile;

0 commit comments

Comments
 (0)