@yadurajfleetos/cli 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/archive.js +29 -1
- package/package.json +1 -1
package/dist/archive.js
CHANGED
|
@@ -82,12 +82,40 @@ export async function packContext(dir) {
|
|
|
82
82
|
dir,
|
|
83
83
|
// Ownership and timestamps vary per machine and would make two packs of the
|
|
84
84
|
// same tree differ for no reason.
|
|
85
|
+
//
|
|
86
|
+
// Not sufficient on its own on macOS -- see COPYFILE_DISABLE below.
|
|
85
87
|
'--no-xattrs',
|
|
86
88
|
...excludes.flatMap((p) => ['--exclude', p]),
|
|
87
89
|
'.',
|
|
88
90
|
];
|
|
89
91
|
return new Promise((resolve, reject) => {
|
|
90
|
-
const child = spawn('tar', args, {
|
|
92
|
+
const child = spawn('tar', args, {
|
|
93
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
94
|
+
/**
|
|
95
|
+
* Keep macOS from smuggling AppleDouble files into the build context.
|
|
96
|
+
*
|
|
97
|
+
* bsdtar stores extended attributes as separate `._name` members, and
|
|
98
|
+
* `--no-xattrs` does not stop it -- that flag is a GNU-compatible alias
|
|
99
|
+
* bsdtar accepts for xattr *archiving*, while the AppleDouble members
|
|
100
|
+
* come from copyfile, which only this variable disables.
|
|
101
|
+
*
|
|
102
|
+
* The failure is invisible from a Mac, which is what makes it worth a
|
|
103
|
+
* comment this long. `tar tzf` on macOS does not list those members: it
|
|
104
|
+
* folds them back into xattrs on the file they belong to. GNU tar on the
|
|
105
|
+
* Linux control plane has no such notion and writes them out as real
|
|
106
|
+
* files, so a context packed here arrives there carrying `._Dockerfile`,
|
|
107
|
+
* `._Program.cs` and the rest.
|
|
108
|
+
*
|
|
109
|
+
* That is not merely untidy. Docker's COPY globs use Go's filepath.Match,
|
|
110
|
+
* where `*` matches a leading dot -- unlike a shell -- so a Dockerfile
|
|
111
|
+
* doing `COPY *.csproj .` copies both `Worker.csproj` and
|
|
112
|
+
* `._Worker.csproj`, and `dotnet restore` then refuses with "this folder
|
|
113
|
+
* contains more than one project or solution file". Found exactly that
|
|
114
|
+
* way, on a .NET service in Docker's own example voting app, having
|
|
115
|
+
* built five other services in the same deploy without complaint.
|
|
116
|
+
*/
|
|
117
|
+
env: { ...process.env, COPYFILE_DISABLE: '1' },
|
|
118
|
+
});
|
|
91
119
|
const chunks = [];
|
|
92
120
|
let stderr = '';
|
|
93
121
|
let settled = false;
|