From 98ec18ba46e8dd50ab36666a205f172e5fc06338 Mon Sep 17 00:00:00 2001 From: Jonas Amundsen Date: Sat, 28 Sep 2024 18:52:55 +0200 Subject: [PATCH] Why does this fail on Ubuntu? --- .github/workflows/build.yml | 54 +----------- .github/workflows/examples-branch.yml | 118 -------------------------- .github/workflows/examples-master.yml | 72 ---------------- lib/subpath-entrypoints/esbuild.ts | 12 +++ 4 files changed, 14 insertions(+), 242 deletions(-) delete mode 100644 .github/workflows/examples-branch.yml delete mode 100644 .github/workflows/examples-master.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd55878a..52427a1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,27 +7,14 @@ concurrency: cancel-in-progress: true jobs: - prepare-versions: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set-matrix - name: Prepare - run: echo "matrix=$(node -p "JSON.stringify(require('./package.json').peerDependencies['cypress'].split(' || '))")" >> $GITHUB_OUTPUT - - run: npm -v - test: - needs: prepare-versions runs-on: ubuntu-latest container: image: cypress/browsers:latest strategy: fail-fast: false matrix: - cypress-version: ${{fromJson(needs.prepare-versions.outputs.matrix)}} + cypress-version: ["13"] steps: - uses: actions/setup-node@v4 with: @@ -56,44 +43,7 @@ jobs: - name: Build run: npm run build - name: Test - run: npm run test - - name: Versions - run: | - npx cypress --version - node --version - npm --version - - windows: - runs-on: windows-latest - env: - NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm - CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cypress - steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Checkout - uses: actions/checkout@v4 - - name: Cache NPM modules - uses: actions/cache@v4 - with: - path: .npm - key: npm-windows - - name: Cache Cypress binaries - uses: actions/cache@v4 - with: - path: .cypress - key: cypress-windows - - name: Dependencies - shell: bash - run: npm install --engine-strict - - name: Build - run: npm run build - # https://github.com/webpack/webpack/issues/12759 - - name: Remove Webpack test - run: rm features/loaders/webpack.feature - - name: Test - run: npm run test:integration + run: npm run test:integration -- features/reporters/usage.feature:91 - name: Versions run: | npx cypress --version diff --git a/.github/workflows/examples-branch.yml b/.github/workflows/examples-branch.yml deleted file mode 100644 index a817ff1c..00000000 --- a/.github/workflows/examples-branch.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Examples (branch) - -on: - push: - branches-ignore: - - master - -defaults: - run: - shell: bash - -jobs: - find-examples: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set-matrix - name: Prepare - run: echo "matrix=$(node -p "JSON.stringify(fs.readdirSync('examples').filter(f => f !== 'readme.md'))")" >> $GITHUB_OUTPUT - - build-package: - runs-on: ubuntu-latest - container: - image: cypress/base:latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cache NPM modules - uses: actions/cache@v4 - with: - path: ~/.npm - key: npm-linux@latest - - name: Cache Cypress binaries - uses: actions/cache@v4 - with: - path: ~/.cache/Cypress - key: cypress-linux@latest - - name: Change owner - run: "chown root: ." - - name: Dependencies - env: - CYPRESS_INSTALL_BINARY: "0" - run: | - npm install - - name: Build - run: npm run build - - name: Pack - run: npm pack - - name: Store dirty build - uses: actions/upload-artifact@v4 - with: - name: build - path: badeball-* - - example: - needs: - - find-examples - - build-package - runs-on: ubuntu-latest - container: - image: cypress/base:latest - strategy: - fail-fast: false - matrix: - example: ${{fromJson(needs.find-examples.outputs.matrix)}} - env: - NPM_CONFIG_PACKAGE_LOCK: "false" - steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Checkout - uses: actions/checkout@v4 - - name: Cache NPM modules - uses: actions/cache@v4 - with: - path: ~/.npm - key: npm@${{ matrix.example }} - - name: Cache Cypress binaries - uses: actions/cache@v4 - with: - path: ~/.cache/Cypress - key: cypress-examples - # In lack of native support, https://github.com/actions/checkout/issues/172. - - name: Make checkout sparse - run: | - shopt -s extglob - rm -rf examples/!(${{ matrix.example }}) - rm -rf !(examples) - - name: Retrieve dirty build - uses: actions/download-artifact@v4 - with: - name: build - path: examples/${{ matrix.example }} - - name: Install NPM modules - working-directory: examples/${{ matrix.example }} - run: npm install --engine-strict badeball-* - # For reasons unknown to me, `npm install ` will not trigger postinstall scripts. - # See https://github.com/npm/cli/issues/4804. - - name: Patch packages - working-directory: examples/${{ matrix.example }} - run: npx patch-package - - name: Run Cypress - working-directory: examples/${{ matrix.example }} - run: | - if [[ "${{ matrix.example }}" == ct-* ]]; then - npx cypress run --component - else - npx cypress run --e2e - fi - - name: Versions - run: | - npx cypress --version - node --version - npm --version diff --git a/.github/workflows/examples-master.yml b/.github/workflows/examples-master.yml deleted file mode 100644 index ac147d48..00000000 --- a/.github/workflows/examples-master.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Examples (master) - -on: - push: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - find-examples: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - id: set-matrix - name: Prepare - run: echo "matrix=$(node -p "JSON.stringify(fs.readdirSync('examples').filter(f => f !== 'readme.md'))")" >> $GITHUB_OUTPUT - - example: - needs: find-examples - runs-on: ubuntu-latest - container: - image: cypress/base:latest - strategy: - fail-fast: false - matrix: - example: ${{fromJson(needs.find-examples.outputs.matrix)}} - env: - NPM_CONFIG_PACKAGE_LOCK: "false" - steps: - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Checkout - uses: actions/checkout@v4 - - name: Cache NPM modules - uses: actions/cache@v4 - with: - path: ~/.npm - key: npm@${{ matrix.example }} - - name: Cache Cypress binaries - uses: actions/cache@v4 - with: - path: ~/.cache/Cypress - key: cypress-examples - # In lack of native support, https://github.com/actions/checkout/issues/172. - - name: Make checkout sparse - run: | - shopt -s extglob - rm -rf examples/!(${{ matrix.example }}) - rm -rf !(examples) - - name: Install NPM modules - working-directory: examples/${{ matrix.example }} - run: npm install --engine-strict - - name: Run Cypress - working-directory: examples/${{ matrix.example }} - run: | - if [[ "${{ matrix.example }}" == ct-* ]]; then - npx cypress run --component - else - npx cypress run --e2e - fi - - name: Versions - run: | - npx cypress --version - node --version - npm --version diff --git a/lib/subpath-entrypoints/esbuild.ts b/lib/subpath-entrypoints/esbuild.ts index 0cb246d2..ce590f14 100644 --- a/lib/subpath-entrypoints/esbuild.ts +++ b/lib/subpath-entrypoints/esbuild.ts @@ -47,6 +47,15 @@ export function createEsbuildPlugin( const needPrettify = lastSource != null && !(await isRelativeToProjectRoot(lastSource)); + debug("last source", lastSource); + debug("project root", configuration.projectRoot); + debug( + "isRelativeToProjectRoot", + await isRelativeToProjectRoot(lastSource), + ); + debug("sources before (all)", sourceMap.sources); + debug("sources before (last)", sourceMap.sources.slice(-5)); + /** * There are numerous issues regarding the sources property in esbuild, particularly when * different drives are involved (which is the case on Github actions, when using @@ -80,6 +89,9 @@ export function createEsbuildPlugin( debug("esbuild: using original sources"); } + debug("sources after (all)", sourceMap.sources); + debug("sources after (last)", sourceMap.sources.slice(-5)); + await fs.rm(sourceMapLocation); const encoded = Buffer.from(JSON.stringify(sourceMap)).toString(