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

add speedscope #27697

Merged
merged 9 commits into from
Sep 27, 2024
Merged

add speedscope #27697

merged 9 commits into from
Sep 27, 2024

Conversation

moritzwilksch
Copy link
Member

@moritzwilksch moritzwilksch commented Sep 25, 2024

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • If static libraries are linked in, the license of the static library is packaged.
  • Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

@moritzwilksch
Copy link
Member Author

@conda-forge/help-nodejs is this how you package npm packages?

Copy link
Contributor

Hi! This is the staged-recipes linter and your PR looks excellent! 🚀

Copy link
Contributor

github-actions bot commented Sep 25, 2024

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/speedscope/meta.yaml) and found some lint.

Here's what I've got...

For recipes/speedscope/meta.yaml:

  • In your conda_build_config.yaml, please change the name of MACOSX_DEPLOYMENT_TARGET, to c_stdlib_version!

recipes/speedscope/build.sh Outdated Show resolved Hide resolved
recipes/speedscope/build.sh Outdated Show resolved Hide resolved
@moritzwilksch
Copy link
Member Author

where does npm install the package? Do we need to move some things around?

@xhochy
Copy link
Member

xhochy commented Sep 25, 2024

where does npm install the package? Do we need to move some things around?

It should put it into $PREFIX with the binary in $PREFIX/bin. Once the jobs is successful, you can look into the CI logs for the content of the package.

@moritzwilksch
Copy link
Member Author

moritzwilksch commented Sep 25, 2024

according to this we might need to patch package.json and scripts/build-release.sh We get a different error in CI than I do locally

@xhochy
Copy link
Member

xhochy commented Sep 25, 2024

CI needs a compiler, but the osx job has the same error as you probably have locally. @JannikWibkerQC can probably help you do the patching correctly.

@JaninaWibkerQC
Copy link
Contributor

JaninaWibkerQC commented Sep 26, 2024

speedscope has a prepack script which is a hook being executed whenever (p)npm pack (or (p)npm publish), thus running pnpm pack triggers a build. I tried it locally but it fails. I'd maybe suggest just installing the package using npm install -g speedscope@{PKG_VERSION} as this won't run into those issues.

Afterwards you'd still do pnpm install --prod and everything pnpm-licenses related.

Not sure what the opinion is on installing from the npm registry vs. building it manually and installing it from there though. pnpm, prettier and marp-cli all install from the registry while pnpm-licenses gets build using conda-build.

It is to be noted that building pnpm-licenses using build.sh / bld.bat was made easier by writing the tool itself and knowing how the build system works 😅

If you go with the npm registry approach this should work:

#!/bin/sh

set -exuo pipefail

if [[ "${target_platform}" == "osx-arm64" ]]; then
    export npm_config_arch="arm64"
fi
# Don't use pre-built gyp packages
export npm_config_build_from_source=true

rm $PREFIX/bin/node
ln -s $BUILD_PREFIX/bin/node $PREFIX/bin/node

# install speedscope from the npm registry
# all things coming after this are just concerned with generating the third-party-licenses file
export NPM_CONFIG_USERCONFIG=/tmp/nonexistentrc
npm install -g speedscope@${PKG_VERSION}

pnpm import
pnpm install --prod

# generate third party licenses file
pnpm licenses list --json --prod | pnpm-licenses generate-disclaimer --prod --json-input --output-file=third-party-licenses.txt

Like @xhochy mentioned you might need a c compiler or you could patch out the dev dependencies which require it:

requirements:
  build:
    - {{ compiler('c') }}
    - {{ stdlib("c") }}
    - {{ compiler('cxx') }}
    - make
    - nodejs

You might also patch out the dev dependencies which require a compiler. We did something similar in the pnpm-feedstock

Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict.
Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/speedscope/meta.yaml) and found it was in an excellent condition.

@moritzwilksch moritzwilksch marked this pull request as ready for review September 26, 2024 15:09
Copy link
Member

@xhochy xhochy left a comment

Choose a reason for hiding this comment

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

If you can build from the source, we would prefer that as it is more self-contained (well npm packages are never self-contained).

@xhochy xhochy merged commit d43e99a into conda-forge:main Sep 27, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants