Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speedup windows ci on stable #2122

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- uses: ./.github/actions/setup
with:
use_lockfile: false
- name: Work around windows short path alias # https://github.com/actions/runner-images/issues/712
if: runner.os == 'Windows'
run: new-item D:\temp -ItemType Directory; echo "TEMP=D:\temp" >> $env:GITHUB_ENV
- name: suite
run: ${{ matrix.command }}
working-directory: ${{ matrix.dir }}
2 changes: 1 addition & 1 deletion packages/shared-internals/src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function explicitRelative(fromDir: string, toFile: string) {
if (!isAbsolute(result) && !result.startsWith('.')) {
result = './' + result;
}
if (isAbsolute(toFile) && result.endsWith(toFile)) {
if (isAbsolute(toFile) && result.split(sep).join('/').endsWith(toFile)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if this is necessary the real bug is elsewhere. Callers are supposed to be passing toFile in system format. If they're passing it in unix format on windows, that is the bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i copied this from main. #2048

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, ok.

// this prevents silly "relative" paths like
// "../../../../../Users/you/projects/your/stuff" when we could have just
// said "/Users/you/projects/your/stuff". The silly path isn't incorrect,
Expand Down
5 changes: 2 additions & 3 deletions tests/scenarios/compat-renaming-test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { PreparedApp } from 'scenario-tester';
import { appScenarios, baseAddon } from './scenarios';
import QUnit from 'qunit';
import { resolve, sep } from 'path';
const { module: Qmodule, test } = QUnit;

import type { ExpectFile } from '@embroider/test-support/file-assertions/qunit';
Expand Down Expand Up @@ -238,12 +237,12 @@ appScenarios
expectAudit
.module('./components/import-somebody-elses-original.js')
.resolves('somebody-elses-package')
.to(resolve('/@embroider/ext-cjs/somebody-elses-package').split(sep).join('/'));
.to('/@embroider/ext-cjs/somebody-elses-package');

expectAudit
.module('./components/import-somebody-elses-original.js')
.resolves('somebody-elses-package/deeper')
.to(resolve('/@embroider/ext-cjs/somebody-elses-package/deeper').split(sep).join('/'));
.to('/@embroider/ext-cjs/somebody-elses-package/deeper');
});
test('single file package gets captured and renamed', function () {
expectAudit
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/core-resolver-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AddonMeta, AppMeta, RewrittenPackageIndex } from '@embroider/shared-internals';
import { outputFileSync, readJsonSync, writeJSONSync } from 'fs-extra';
import { resolve, sep } from 'path';
import { resolve } from 'path';
import QUnit from 'qunit';
import type { PreparedApp } from 'scenario-tester';
import { Project, Scenarios } from 'scenario-tester';
Expand Down Expand Up @@ -609,7 +609,7 @@ Scenarios.fromProject(() => new Project())
'app.js': `import "rsvp"`,
});
await configure({});
expectAudit.module('./app.js').resolves('rsvp').to(resolve('/@embroider/ext-cjs/rsvp').split(sep).join('/'));
expectAudit.module('./app.js').resolves('rsvp').to('/@embroider/ext-cjs/rsvp');
});

test(`known ember-source-provided virtual packages are not externalized when explicitly included in deps`, async function () {
Expand Down
Loading