@yadurajfleetos/cli 0.13.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.
Files changed (2) hide show
  1. package/dist/archive.js +29 -1
  2. 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, { stdio: ['ignore', 'pipe', 'pipe'] });
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadurajfleetos/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Fleet OS command-line interface for deploying and orchestrating services on user-owned hardware",
5
5
  "type": "module",
6
6
  "license": "MIT",