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

refactor!: Circular dependencies - src/crypto/crypto.js and src/auth/pluggable-auth-client.js #1539

Open
nstuyvesant opened this issue Apr 16, 2023 · 3 comments
Labels
Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. type: cleanup An internal cleanup or hygiene concern.

Comments

@nstuyvesant
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

  1. Is this a client library issue or a product issue?
    Client library

  2. Did someone already solve this?
    No

  3. Do you have a support contract?
    No

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

  • OS: macOS 13.3.1
  • Node.js version: 18.16.0
  • npm version: 9.6.4
  • google-auth-library version: 8.7.0

Steps to reproduce

  1. Examine the files listed below in sequence to see circular dependencies...
Circular dependency: node_modules/google-auth-library/build/src/crypto/crypto.js -> node_modules/google-auth-library/build/src/crypto/browser/crypto.js -> node_modules/google-auth-library/build/src/crypto/crypto.js
Circular dependency: node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js -> node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js -> node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js
@nstuyvesant nstuyvesant added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 16, 2023
@ddelgrosso1
Copy link

@nstuyvesant is this causing you some kind of error? It is unclear from the description.

@ddelgrosso1 ddelgrosso1 added needs more info This issue needs more information from the customer to proceed. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 17, 2023
@nstuyvesant
Copy link
Author

Just getting warnings when I do a build.

@ddelgrosso1 ddelgrosso1 added type: cleanup An internal cleanup or hygiene concern. and removed needs more info This issue needs more information from the customer to proceed. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 17, 2023
@danielbankhead danielbankhead added semver: major Hint for users that this is an API breaking change. Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version labels Oct 16, 2023
@danielbankhead danielbankhead changed the title Circular dependencies - src/crypto/crypto.js and src/auth/pluggable-auth-client.js refactor!: Circular dependencies - src/crypto/crypto.js and src/auth/pluggable-auth-client.js Oct 16, 2023
@valiantlynx
Copy link

valiantlynx commented Oct 16, 2023

i am in a turborepo with docker.
the problem is when im building locally, though it takes a lot of time if works.
but in a docker container i have to be careful about the memory. for my project i think because of this circular dependancy. it keeps using more and more memory.
i have teted this by allocating 8GB to the process and it still gets killed.

here is my out put when i run docker compose

1.209 • Packages in scope: svelte-manga
1.209 • Running build in 1 packages
1.209 • Remote caching disabled
1.209 svelte-manga:build: cache miss, executing c6424c443bb1c23f
1.422 svelte-manga:build: $ vite build
2.522 svelte-manga:build:
2.522 svelte-manga:build: vite v4.4.11 building SSR bundle for production...
2.558 svelte-manga:build: transforming...
3.909 svelte-manga:build:
3.909 svelte-manga:build: ╭── 🌼 daisyUI 3.9.2 https://daisyui.com
4.008 svelte-manga:build: │
4.008 svelte-manga:build: ├── 29 themes are enabled. How to add more themes:
4.008 svelte-manga:build: │   https://daisyui.com/docs/themes
4.008 svelte-manga:build: │
4.008 svelte-manga:build: ╰── ⭐️ Star daisyUI project on GitHub: https://github.com/saadeghi/daisyui
4.008 svelte-manga:build:
4.646 svelte-manga:build: ✓ 153 modules transformed.
4.659 svelte-manga:build: Generated an empty chunk: "entries/pages/manga/_page.ts".
4.708 svelte-manga:build: rendering chunks...
6.489 svelte-manga:build:
6.489 svelte-manga:build: vite v4.4.11 building for production...
6.495 svelte-manga:build: transforming...
8.690 svelte-manga:build: ✓ 194 modules transformed.
8.771 svelte-manga:build: rendering chunks...
8.844 svelte-manga:build: computing gzip size...
8.856 svelte-manga:build: .svelte-kit/output/client/_app/version.json                                        0.03 kB │ gzip:  0.05 kB
8.856 svelte-manga:build: .svelte-kit/output/client/.vite/manifest.json                                     13.53 kB │ gzip:  1.30 kB
...             
9.704 svelte-manga:build: .svelte-kit/output/server/entries/pages/contact/_page.svelte.js                                  10.33 kB
9.704 svelte-manga:build: .svelte-kit/output/server/entries/pages/dashboard/reading-progress/_page.svelte.js               13.04 kB
9.704 svelte-manga:build: .svelte-kit/output/server/entries/pages/manga/_id_/_page.svelte.js                               17.60 kB
9.704 svelte-manga:build: .svelte-kit/output/server/chunks/Icon.js                                                         47.07 kB
9.704 svelte-manga:build: .svelte-kit/output/server/index.js                                                               88.88 kB
9.704 svelte-manga:build:
9.704 svelte-manga:build: Run npm run preview to preview your production build locally.
9.707 svelte-manga:build:
9.707 svelte-manga:build: > Using @sveltejs/adapter-node
28.23 svelte-manga:build: Circular dependency: ../../node_modules/google-auth-library/build/src/crypto/crypto.js -> ../../node_modules/google-auth-library/build/src/crypto/browser/crypto.js -> ../../node_modules/google-auth-library/build/src/crypto/crypto.js
28.23 svelte-manga:build: Circular dependency: ../../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js -> ../../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js -> ../../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js        
64.30 svelte-manga:build: Killed
64.48 svelte-manga:build: error Command failed with exit code 137.
64.48 svelte-manga:build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
64.69 svelte-manga:build: ERROR: command finished with error: command (/app/apps/svelte-manga) yarn run build exited (137)
64.69 svelte-manga#build: command (/app/apps/svelte-manga) yarn run build exited (137)
64.69
64.69  Tasks:    0 successful, 1 total
64.69 Cached:    0 cached, 1 total
64.69   Time:    1m4.217s
64.69 Failed:    svelte-manga#build
64.69
64.70  ERROR  run failed: command  exited (137)
65.02 error Command failed with exit code 137.
65.02 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: process "/bin/sh -c NODE_OPTIONS=\"--max-old-space-size=8192\" yarn turbo run build --filter=svelte-manga --concurrency 2" did not complete successfully: exit code: 137

This is the dockerfile responsible:

FROM node:18-alpine AS base

# This Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker.
# Make sure you update both files!

FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune svelte-manga --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN


# You can adjust the memory limit based on your specific requirements.
RUN NODE_OPTIONS="--max-old-space-size=8192" yarn turbo run build --filter=svelte-manga --concurrency 2


# Create a new stage for the runner
FROM base AS runner
WORKDIR /app
# takes too much space. like 80% of the image
RUN yarn global add vite

# Don't run production as root - add a non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 svelte
USER svelte


# Copy the necessary files from the installer stage
COPY --from=installer /app/apps/svelte-manga/package.json .
COPY --from=installer /app/apps/svelte-manga/.svelte-kit .

EXPOSE 4173

# Modify this line to start your SvelteKit application, e.g., run your server.js or the appropriate script.
CMD [ "yarn", "preview", "--host" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

4 participants