BPF SDK path does not exist - solana

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

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

how to import vagrant without going through 'vagrant add box'

I have the vagrant 'virtualbox' virtual machine, however I can no longer access vagrant with another pc to retrieve my information contained in the virtual machine.
'ubuntu/focus'
how can I proceed?
In your project directory (the one where you have the Vagrantfile) vagrant will create . .vagrant folder. The content of this folder has the Virtalbox vm information
for example:
ls -all .vagrant/machines/default/virtualbox/
total 72
drwxr-xr-x 11 fhenri staff 352 Aug 28 22:20 .
drwxr-xr-x 3 fhenri staff 96 Aug 27 22:38 ..
-rw-r--r-- 1 fhenri staff 40 Aug 28 22:20 action_provision
-rw-r--r-- 1 fhenri staff 10 Aug 28 22:18 action_set_name
-rw-r--r-- 1 fhenri staff 148 Sep 6 09:42 box_meta
-rw-r--r-- 1 fhenri staff 3 Aug 28 22:18 creator_uid
-rw-r--r-- 1 fhenri staff 36 Aug 28 22:18 id
-rw-r--r-- 1 fhenri staff 32 Aug 28 22:18 index_uuid
-rw------- 1 fhenri staff 1679 Aug 28 22:18 private_key
-rw-r--r-- 1 fhenri staff 316 Sep 6 10:18 synced_folders
-rw-r--r-- 1 fhenri staff 63 Aug 28 22:18 vagrant_cwd
the name of the vagrant machine is default and provider is virtual box in this case.
If you copy the virtual box VM into another PC, you also need to copy this folder or need to recreate it. It contains the id of virtual box VM which helps vagrant to map and link with the VM.

"/etc/sudoers is world writable” on Mac OS Mojave

I have gone through a lot of google results. Let me explain what I have tried first. I am currently working on a corporate laptop. Mac OS Mojave 10.14.6.
Error that I get:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
ls -le /etc
-rwxrwxrwx 1 root wheel 179 Aug 18 2018 shells
drwxrwxrwx 4 root wheel 128 Aug 18 2018 snmp
drwxrwxrwx 5 root wheel 160 Nov 11 2019 ssh
drwxrwxrwx 6 root wheel 192 Nov 11 2019 ssl
-rwxrwxrwx 1 root wheel 257 Aug 18 2018 sudo_lecture
-rwxrwxrwx 1 root wheel 1630 Mar 11 11:51 sudoers
drwxrwxrwx 2 root wheel 64 Aug 18 2018 sudoers.d
drwxrwxrwx 4 root admin 128 Dec 25 2018 symantec
-rw-rw-rw-# 1 01244861 wheel 47 Feb 2 18:13 sysctl.conf
-rwxrwxrwx 1 root wheel 96 Aug 21 2018 syslog.conf
-rwxrwxrwx 1 root wheel 1316 Aug 18 2018 ttys
drwxrwxrwx 6 root wheel 192 Aug 18 2018 wfs
-rwxrwxrwx 1 root wheel 0 Aug 18 2018 xtab
-rwxrwxrwx 1 root wheel 126 Aug 18 2018 zprofile
-rwxrwxrwx 1 root wheel 207 Aug 18 2018 zshrc
I have changed permission using chmod 440 /etc/sudoers and chmod 777 /etc/sudoers and also using info and manually updating from the file properties.
I am using iTerm2 as my terminal.
echo $PATH
/Users/01244861/.yarn/bin:/Users/01244861/.nvm/versions/node/v10.13.0/bin:/usr/local/opt/node#10/bin:/usr/local/opt/node#10/bin:/usr/local/opt/node#10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/go/bin
echo $SHELL
/bin/zsh
My user permissions:
Is there anything else that I can do to fix this?
Thanks

Why mutiple local jar under a same maven groupId, artifactId and version?

I'm modifying the version of a jar config from 1.0.28 to 1.0.29-SNAPSHOT in my pom.xml for updating it. But I've found two jars in my local repository folder. Specially, the central repository is maintained by my company.
The maven version I've used is 2.2.1, and the version of jdk is 1.8.0_151
<dependency>
<groupId>com.my.company</groupId>
<artifactId>common</artifactId>
<version>1.0.29-SNAPSHOT</version>
</dependency>
I only need common-1.0.29-SNAPSHOT.jar. But I don't know why there is common-1.0.29-20181228.142316-1.jar here.
This is the file list on my computer:
-rw-r--r-- 1 staff staff 255 Dec 29 10:04 _remoterepositories
-rw-r--r-- 1 staff staff 371 Jan 2 09:53 maven-metadata-centralxml
-rw-r--r-- 1 staff staff 41 Jan 2 09:53 maven-metadata-centralxmlsha1
-rw-r--r-- 1 staff staff 1002 Jan 2 09:51 maven-metadata-mirror-allxml
-rw-r--r-- 1 staff staff 41 Jan 2 09:51 maven-metadata-mirror-allxmlsha1
-rw-r--r-- 1 staff staff 191 Jan 2 09:51 resolver-statusproperties
-rw-r--r-- 1 staff staff 48058 Dec 29 10:04 common-1029-20181228142316-1jar
-rw-r--r-- 1 staff staff 40 Dec 29 10:04 common-1029-20181228142316-1jarsha1
-rw-r--r-- 1 staff staff 7801 Dec 29 10:04 common-1029-20181228142316-1pom
-rw-r--r-- 1 staff staff 40 Dec 29 10:04 common-1029-20181228142316-1pomsha1
-rw-r--r-- 1 staff staff 48058 Dec 29 10:04 common-1029-SNAPSHOTjar
-rw-r--r-- 1 staff staff 7801 Dec 29 10:04 common-1029-SNAPSHOTpom
This is how Maven keeps track of what -SNAPSHOT actually means in the local repository. It is the timestamp for (if I recall correctly) when the artifact was installed.
A guess could be that a copy is kept in case an install process does not succeed for rollback.

Location of virtual machines in mac for virtual box

What is the location of all .vbox files that are created in virtual box in a mac. And how can we delete it?
I mistakenly deleted virtualbox.app file from Applications and now I want to delete all the remains of all virtual box files.
I tried following things:
drwxr-xr-x# 3 user admin 102 Dec 19 19:57 vagrant
-rw-r--r-- 1 root wheel 1824496 Feb 21 17:17 com.vagrant.vagrant.bom
-rw-r--r-- 1 root wheel 240 Feb 21 17:17 com.vagrant.vagrant.plist
drwx------ 5 root wheel 170 Feb 21 16:59 ubuntu-cloudimg-precise-vagrant-amd64_1487725164672_27815
./private/var/root/VirtualBox VMs/ubuntu-cloudimg-precise-vagrant-amd64_1487725164672_27815:
-rw------- 1 root wheel 3036 Feb 21 16:59 ubuntu-cloudimg-precise-vagrant-amd64_1487725164672_27815.vbox
-rw------- 1 root wheel 3036 Feb 21 16:59 ubuntu-cloudimg-precise-vagrant-amd64_1487725164672_27815.vbox-prev
lrwxr-xr-x 1 root wheel 24 Feb 21 17:17 vagrant -> /opt/vagrant/bin/vagrant
But I could not find the location of .vbox files to manually delete them.
By default the .vbox files normally go into your users' home directory:
pwd
/Users/Astro58/VirtualBox VMs
total 264
drwx------# 6 lance staff 204 Feb 22 19:03 ./
drwxr-xr-x+ 88 lance staff 2992 Feb 22 16:11 ../
drwx------ 6 lance staff 204 Feb 22 19:50 Laravel_default_1487808229046_76286/
drwx------ 7 lance staff 238 Feb 20 12:53 legacy_default_1487457532080_39585/
You should be able to delete the "VirtualBox VMs" directory via the rm command or via the Mac Finder.

Resources