Cannot use compressed archive in yarn resolution - yarnpkg

For a typescript stenciljs project I'm working on I was having issues with interactions between rollup-plugin-node-builtins and node-gyp-build which was being used in a dependency. To resolve it I was able to make some changes to the rollup plugin and set it as a custom yarn resolution in stencil
"resolutions": {
"#stencil/core/**/rollup-plugin-node-builtins": "https://github.com/Matthew-Smith/rollup-plugin-node-builtins.git"
}
This works fine when I run it locally, but our build process didn't have git available when we execute yarn install So we attempted to set the resolution to a .tar.gz release of the plugin:
"resolutions": {
"#stencil/core/**/rollup-plugin-node-builtins": "https://github.com/Matthew-Smith/rollup-plugin-node-builtins/archive/v2.1.3.tar.gz"
}
This seemed to properly clone the code into node_modules:
> l node_modules | grep rollup
drwxr-xr-x 8 matthewsmith staff 256B Jan 9 11:26 rollup
drwxr-xr-x 9 matthewsmith staff 288B Jan 9 11:26 rollup-plugin-commonjs
drwxr-xr-x 13 matthewsmith staff 416B Jan 9 11:26 rollup-plugin-node-builtins
drwxr-xr-x 8 matthewsmith staff 256B Jan 9 11:26 rollup-plugin-node-resolve
drwxr-xr-x 7 matthewsmith staff 224B Jan 9 11:26 rollup-pluginutils
> l node_modules/rollup-plugin-node-builtins
total 64
drwxr-xr-x 13 matthewsmith staff 416B Jan 9 11:26 .
drwxr-xr-x 670 matthewsmith staff 21K Jan 9 11:26 ..
-rw-r--r-- 1 matthewsmith staff 36B Jan 9 11:13 .babelrc
-rw-r--r-- 1 matthewsmith staff 650B Jan 9 11:13 .eslintrc
-rw-r--r-- 1 matthewsmith staff 5B Jan 9 11:13 .gitignore
-rw-r--r-- 1 matthewsmith staff 14B Jan 9 11:13 .npmignore
drwxr-xr-x 5 matthewsmith staff 160B Jan 9 11:26 browser-test
-rw-r--r-- 1 matthewsmith staff 500B Jan 9 11:13 build-constants.js
-rw-r--r-- 1 matthewsmith staff 1.3K Jan 9 11:13 package.json
-rw-r--r-- 1 matthewsmith staff 2.5K Jan 9 11:13 readme.md
-rw-r--r-- 1 matthewsmith staff 216B Jan 9 11:13 rollup.config.js
drwxr-xr-x 4 matthewsmith staff 128B Jan 9 11:26 src
drwxr-xr-x 4 matthewsmith staff 128B Jan 9 11:26 test
but when I attempt to build the code I am getting this output:
$ sd concurrent "stencil build --dev --watch" "stencil-dev-server"
[26:41.1] #stencil/core v0.12.4 🏋
[26:41.2] build, app, dev mode, started ...
[26:41.7] transpile started ...
[26:43.8] transpile finished in 2.07 s
[26:43.8] module map started ...
[26:43.8] generate styles started ...
[26:43.8] module map finished in 12 ms
[26:43.9] generate styles finished in 76 ms
[ ERROR ] Cannot find module 'rollup-plugin-node-builtins' at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15) at Function.Module._load
(internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at
require (internal/modules/cjs/helpers.js:20:18) at
/Users/matthewsmith/penfield/node_modules/#stencil/core/dist/compiler/index.js:18322:26
at Generator.next (<anonymous>) at
/Users/matthewsmith/penfield/node_modules/#stencil/core/dist/compiler/index.js:18306:71
at new Promise (<anonymous>) at __awaiter$13
(/Users/matthewsmith/penfield/node_modules/#stencil/core/dist/compiler/index.js:18302:12)
at createBundle
(/Users/matthewsmith/penfield/node_modules/#stencil/core/dist/compiler/index.js:18310:12)
Is there a special process to using compressed archives for yarn resolutions?
EDIT
here is what my yarn.lock looks like for this dependency:
rollup-plugin-node-builtins#2.1.2, "rollup-plugin-node-builtins#https://github.com/Matthew-Smith/rollup-plugin-node-builtins/archive/v2.1.3.tar.gz":
version "2.1.3"
resolved "https://github.com/Matthew-Smith/rollup-plugin-node-builtins/archive/v2.1.3.tar.gz#af40f65e716e2c62e698cbea169127f9c1717e7d"
dependencies:
browserify-fs "^1.0.0"
buffer-es6 "^4.9.2"
crypto-browserify "^3.11.0"
process-es6 "^0.11.2"
Yarn Version:
1.12.3
Node Version:
10.12.0
Stencil Version:
0.12.4

So I was able to solve this, though I don't really understand why it worked as a git dependency in the first place.
Looking deeper I noticed that the package.json lists the main as:
"main": "dist/rollup-plugin-node-builtins.cjs.js",
and there is a script to build the package:
"build": "rollup -c -f cjs -o dist/rollup-plugin-node-builtins.cjs.js && rollup -c -f es -o dist/rollup-plugin-node-builtins.es6.js && node build-constants.js",
So I executed build, packaged it via npm pack . and then using that compressed file in my dependency resolutions worked!
NOTE: before learning about npm pack . I tried using tar -czvf and that was giving me the same errors as before.

Related

Gradle is changing my zip file from resources

Welcome,
I would like to add custom resources - a zip file to my project
Gradle is somehow changing my zip file and I don't know how and why
Sources:
total 11576
drwxr-xr-x 5 user staff 160 Nov 1 00:39 .
drwxr-xr-x 7 user staff 224 Oct 31 14:17 ..
-rw-r--r-- 1 user staff 5900938 Oct 31 15:33 Custom.zip
-rw-r--r-- 1 user staff 16452 Nov 1 00:35 swagger.yaml.zip
-rw-r--r-- 1 user staff 12 Nov 1 00:39 test.txt
Build directory
total 20880
drwxr-xr-x 5 user staff 160 Nov 1 00:39 .
drwxr-xr-x 7 user staff 224 Nov 1 00:39 ..
-rw-r--r-- 1 user staff 10652091 Nov 1 00:39 Custom.zip
-rw-r--r-- 1 user staff 29355 Nov 1 00:39 swagger.yaml.zip
-rw-r--r-- 1 user staff 12 Nov 1 00:39 test.txt
Zip files in build resources have more bytes and are not valid zips anymore, simple text file is not changed
Environment
Gradle 7.5
------------------------------------------------------------
Build time: 2022-07-14 12:48:15 UTC
Revision: c7db7b958189ad2b0c1472b6fe663e6d654a5103
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.4.1 (Azul Systems, Inc. 17.0.4.1+1-LTS)
OS: Mac OS X 12.6 aarch64

BPF SDK path does not exist

I'm following the Anchor docs here, but I keep getting this error...
BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2)
I ran ls -al /Users/herbie/.cargo/bin and got this output:
total 239152
drwxr-xr-x 17 herbie staff 544 31 Jan 16:55 .
drwxr-xr-x 9 herbie staff 288 13 Dec 11:58 ..
-rwxr-xr-x 1 herbie staff 12574724 31 Jan 16:49 anchor
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 cargo
-rwxr-xr-x 1 herbie staff 7578989 14 Dec 14:05 cargo-build-bpf
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 cargo-clippy
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 cargo-fmt
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 cargo-miri
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 clippy-driver
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rls
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rust-gdb
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rust-lldb
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rustc
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rustdoc
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rustfmt
-rwxr-xr-x 12 herbie staff 8521112 31 Jan 16:55 rustup
Haven't found much online, and have never heard of BPF before...
It's unclear when you're getting the error during the installation, but here's a few things to try:
be sure that you're using an up-to-date version of Rust stable with rustup update stable
check that you're using the Solana CLI version designated in the docs using solana -V
run cargo build-bpf on the hello world Rust application: https://github.com/solana-labs/example-helloworld/tree/master/src/program-rust
For more reference, BPF is the bytecode format used by on-chain programs with Solana. You can find some more info at the links contained within https://docs.solana.com/developing/on-chain-programs/overview#berkeley-packet-filter-bpf
Try removing the solana cache before running your code. It worked for me. Basically, the BPF SDK hasn't been installed accurately.
rm -rf ~/.cache/solana/*
After deleting the solana cache run. It should download the BPF SDK again
solana build

Nativescript project cannot run ng serve

If I try to run the following command, this happens:
ng serve
An unhandled exception occurred: No projects support the 'serve' target.
See "/tmp/ng-YKKFYj/angular-errors.log" for further details.
in the same directory, where the angular.json, the package.json, src folder etc. is, see:
forest#forest:~/<project-path>$ ls -lsa
total 380
4 drwxrwxr-x 8 forest forest 4096 dec 17 17:44 .
4 drwxrwxr-x 7 forest forest 4096 dec 17 16:20 ..
4 -rw-r--r-- 1 forest forest 383 okt 26 1985 angular.json
4 drwxrwxr-x 4 forest forest 4096 dec 12 14:16 App_Resources
4 -rw-r--r-- 1 forest forest 202 okt 26 1985 .editorconfig
4 -rw-r--r-- 1 forest forest 260 dec 17 15:43 .gitignore
4 drwxrwxr-x 5 forest forest 4096 dec 17 14:02 hooks
4 drwxr-xr-x 3 root root 4096 dec 13 15:41 .idea
12 -rw-r--r-- 1 forest forest 11368 okt 26 1985 LICENSE
20 drwxrwxr-x 567 forest forest 20480 dec 17 16:15 node_modules
4 -rw-r--r-- 1 forest forest 62 okt 26 1985 nsconfig.json
4 -rw-rw-r-- 1 forest forest 1315 dec 17 16:15 package.json
264 -rw-rw-r-- 1 forest forest 267877 dec 17 16:15 package-lock.json
4 drwxrwxr-x 3 forest forest 4096 dec 17 16:04 platforms
4 drwxrwxr-x 4 forest forest 4096 dec 17 15:26 src
4 -rw-r--r-- 1 forest forest 670 dec 17 16:34 tsconfig.json
4 -rw-r--r-- 1 forest forest 126 okt 26 1985 tsconfig.tns.json
4 -rw-r--r-- 1 forest forest 38 okt 26 1985 tsfmt.json
4 -rw-rw-r-- 1 forest forest 3093 dec 17 17:44 tslint.json
4 -rw-r--r-- 1 forest forest 1575 dec 12 18:16 tslint_old.json
16 -rw-rw-r-- 1 forest forest 14103 dec 17 13:23 webpack.config.js
forest#forest:~/<project-path>$ ng serve
An unhandled exception occurred: No projects support the 'serve' target.
See "/tmp/ng-dO1bgr/angular-errors.log" for further details.
Versions:
$ng --version:
Angular CLI: 8.3.19
Node: 12.3.1
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
------------------------------------------------------
#angular-devkit/architect 0.803.19 (cli-only)
#angular-devkit/core 8.2.2
#angular-devkit/schematics 8.3.19 (cli-only)
#ngtools/webpack 8.2.2
#schematics/angular 8.3.19 (cli-only)
#schematics/update 0.803.19 (cli-only)
rxjs 6.5.3
typescript 3.5.3
webpack 4.27.1
$tns --version
6.2.2
The project can be build for Android though.
You should use Schematics for code sharing project which does all the setup for Web and iOS / Android.
If you had created it from template, you might have to manually configure the project to support web.

Conda not using .condarc in root environment

We are using a centralized conda install. The Continuum docs say:
A .condarc file may also be located in the root environment, in which case it overrides any in the home directory.
Perhaps I'm not understanding what "root environment" means. I put a .condarc at the top level in the conda install directory. However anytime I run any conda operation (including just conda list), it overrides the one in the root environment and creates one in my home directory.
With the newest version of conda under debian I copy the config file as such
root#e42dc1ece1e3:/home/jonb4# ls -la /opt/conda/
total 24
drwxr-xr-x 11 root root 155 Sep 28 11:53 .
drwxr-xr-x 3 root root 19 Jun 4 08:23 ..
-rw-r--r-- 1 root root 1058 Sep 28 11:53 .condarc
-rw-rw-r-- 1 root root 3699 May 12 20:59 LICENSE.txt
drwxr-xr-x 2 root root 4096 Jun 4 08:24 bin
drwxr-xr-x 2 root root 4096 Jun 4 08:24 conda-meta
drwxr-xr-x 2 root root 6 Jun 4 08:24 envs
drwxr-xr-x 3 root root 18 Jun 4 08:24 etc
drwxr-xr-x 5 root root 314 Jun 4 08:24 include
drwxr-xr-x 8 root root 4096 Jun 4 08:24 lib
drwxr-xr-x 28 root root 4096 Jun 4 08:24 pkgs
drwxr-xr-x 4 root root 29 Jun 4 08:24 share
drwxr-xr-x 3 root root 71 Jun 4 08:24 ssl
Then as a user my correct config settings are read without a problem.

Java classpath in Cocoa

I am developing an application in cocoa which uses some java classes .I need to set the app point to
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
instead of:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK.
Is it possible to do this..
Thanks in advance
Not a solution, just wanted to point out that your problem (which is I guess that your app does not run with Java6, but needs Java5) may be bigger than you think, because on Snow Leopard, these two directories are the same:
$ ls -la /System/Library/Frameworks/JavaVM.framework/Versions/
total 64
drwxr-xr-x 13 root wheel 442 Dec 5 12:16 .
drwxr-xr-x 12 root wheel 408 Dec 5 12:16 ..
lrwxr-xr-x 1 root wheel 5 Dec 5 12:15 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 Jul 21 2009 1.3.1
lrwxr-xr-x 1 root wheel 10 Dec 5 12:15 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Dec 5 12:15 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Dec 5 12:15 1.5 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 Dec 5 12:15 1.5.0 -> CurrentJDK
lrwxr-xr-x 1 root wheel 5 Dec 5 12:15 1.6 -> 1.6.0
drwxr-xr-x 8 root wheel 272 Oct 19 10:54 1.6.0
drwxr-xr-x 9 root wheel 306 Dec 5 12:16 A
lrwxr-xr-x 1 root wheel 1 Dec 5 12:15 Current -> A
lrwxr-xr-x 1 root wheel 3 Dec 5 12:15 CurrentJDK -> 1.6
It does seem possible, though, to copy the real Java5 over from a 10.5 installation.

Resources