Installing npm package of git type with yarn in poudriere

I am trying to port pgadmin4 https://github.com/pgadmin-org/pgadmin4/tree/REL-9_14, but have (currently) two problems that prevent me finishing porting.

For the server, the install instruction says to issue yarn install in web subdirectory.
I am trying to be offline in the build phase in the port's Makefile like below (partly):

Code:
.include <bsd.port.pre.mk>

MAKE_ENV+=      YARN_CACHE_FOLDER=${WRKDIR}/yarncache \
                YARN_HOME=${WRKDIR}
PGADMIN4_DISTFILE_YARNCACHE=    ${PORTNAME}-yarncache-${PORTVERSION}${EXTRACT_SUFX}

post-fetch:
.if !exists(${DISTDIR}/${PGADMIN4_DISTFILE_YARNCACHE})
        ${SETENVI} ${MAKE_ENV} yarn config set cafile \
                ${LOCALBASE}/share/certs/ca-root-nss.crt
        ${TAR} -C ${WRKDIR} -xf ${DISTDIR}/${DISTFILE_DEFAULT}
        cd ${WRKSRC}/web && ${SETENVI} ${MAKE_ENV} yarn install
        ${TAR} -C ${WRKDIR} -acf ${DISTDIR}/${PGADMIN4_DISTFILE_YARNCACHE} yarncache
.endif

post-extract:
        ${TAR} -C ${WRKDIR} -xf ${DISTDIR}/${PGADMIN4_DISTFILE_YARNCACHE}

do-build:
        cd ${WRKSRC}/web && ${SETENVI} ${MAKE_ENV} yarn install --offline

But there is an entry in the yarn.lock file of git type:
Code:
"react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#8ddaa7bed99c8329e39b8ff37ba156f7fc8e85d4":
  version: 7.0.0-beta.58
  resolution: "react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#commit=8ddaa7bed99c8329e39b8ff37ba156f7fc8e85d4"
  peerDependencies:
    react: ^19.2
    react-dom: ^19.2
  checksum: 10c0/531f86c950e4f656cc45f496f7d5f95aaf2c7e2884d864d7954456e531810e7a7d99d52ee984b4140f034fafdc3f601913b8aa0949c8a06df784716dda66f06c
  languageName: node
  linkType: hard

This seem to trigger git and the build fails with the error below.
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads https://github.com/pgadmin-org/react-data-grid.git
Directory: /wrkdirs/usr/ports/databases/pgadmin4/work/pgadmin4-REL-9_14/web
Output:
fatal: unable to access 'https://github.com/pgadmin-org/react-data-grid.git/': Could not resolve host: github.com

How can I avoid this. Is there any port that deals with a similar situation?

The second problem is that build of devel/electron* all fail in the fetch phase.
===> Fetching and setting up yarn version 4.12.0
Adding yarn@4.12.0 to the cache...
Internal Error: Error when performing the request to https://repo.yarnpkg.com/4.12.0/packages/yarnpkg-cli/bin/yarn.js; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
at fetch (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22089:11)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async fetchUrlStream (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22119:20)
at async download (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22290:18)
at async installVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22386:55)
at async Engine.ensurePackageManager (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22899:32)
at async PackCommand.execute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23424:34)
at async PackCommand.validateAndExecute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:20278:22)
at async _Cli.run (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21215:18)
at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23704:19)
*** Error code 1

For this problem, I am currenty ignoring the desktop (electron) version of the software, and only dealing with the web server version.
 
By default, poudriere only allows network access in the fetch phase. So, doing naively yarn install in the build phase does not work with poudriere. Off course there is option to allow network access in build phase, but it will not work in the official package build.
 
Back
Top