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

How to compile aeacus #96

Closed
Mobmaker55 opened this issue Mar 8, 2021 · 20 comments
Closed

How to compile aeacus #96

Mobmaker55 opened this issue Mar 8, 2021 · 20 comments
Labels
good first issue Good for newcomers

Comments

@Mobmaker55
Copy link
Collaborator

Following your directions, I tried to compile the latest version myself. I installed go and garble using the command go get mvdan.cc/garble.
When running make win, I got this error:
'make' is not recognized as an internal or external command, operable program or batch file.
What did I do wrong?

@safinsingh
Copy link
Collaborator

safinsingh commented Mar 8, 2021

Assuming you're using Windows, you'll need to install GNU Make in order to build aeacus using something like GNUWin, MinGW, or MSYS2.

@Mobmaker55
Copy link
Collaborator Author

After trying multiple times to install GNUWin and MinGW (that part is probably on me), I switched to the latest version of Ubuntu (20.04.2).
I tried to run make win again, and this time, got this error:
make: *** No rule to make target 'win'. Stop.
I also tried to just make. That did not work either.
I'm following your directions, I made sure to install go go version go1.16 linux/amd64 and garble using go get mvdan.cc/garble.
What am I still missing?

@safinsingh
Copy link
Collaborator

Ah, my bad; we had removed the Makefile in an earlier commit. As of c08b240, you should be able to run the command successfully. Please re-pull and try again; sorry about that.

@Mobmaker55
Copy link
Collaborator Author

Mobmaker55 commented Mar 8, 2021

It's alright, I'm not used to compiling with anything other than gradle or Maven, so this is a good new experience for me, haha!
Okay, so I think I messed up installing garble...
mob@ubuntu:~/aeacus$ make win
CGO_ENABLED=0 GOOS=windows garble build -ldflags '-s -w' -tags phocus -o ./phocus.exe . && \
CGO_ENABLED=0 GOOS=windows garble build -ldflags '-s -w' -o ./aeacus.exe . && \
echo "Windows production build successful!"
/bin/sh: 1: garble: not found
make: *** [Makefile:30: win] Error 127
That's the invocation and the error? that resulted.

@safinsingh
Copy link
Collaborator

Is garble installed and has it been added to your $PATH?

@Mobmaker55
Copy link
Collaborator Author

I installed garble using the command go get mvdan.cc/garble
but other than that, I haven't done anything else...

@Mobmaker55
Copy link
Collaborator Author

I don't see where garble would be installed, and I can't find it just browsing through my file tree. How would I add it to my $PATH?

@safinsingh
Copy link
Collaborator

By default, Go installs binaries to $GOPATH/bin. In order to set your $PATH correctly, execute the following:

export PATH="$PATH:${GOPATH:-$HOME/go}/bin"

@Mobmaker55
Copy link
Collaborator Author

This is the error I received after running your export PATH-
It started for like 10 minutes, and then randomly stopped with this error, I tried it again just to be sure, but this was the same error the second time too.

go list error: exit status 1: ../go/pkg/mod/github.com/gen2brain/[email protected]/notify_windows.go:16:2: missing go.sum entry for module providing package golang.org/x/sys/windows/registry (imported by github.com/elysium-suite/aeacus/cmd); to add:
go get github.com/elysium-suite/aeacus/cmd
../go/pkg/mod/github.com/iamacarpet/[email protected]/services.go:12:2: missing go.sum entry for module providing package golang.org/x/sys/windows (imported by github.com/elysium-suite/aeacus/cmd); to add:
go get github.com/elysium-suite/aeacus/cmd
../go/pkg/mod/github.com/iamacarpet/[email protected]/services.go:13:2: missing go.sum entry for module providing package golang.org/x/sys/windows/svc (imported by github.com/judwhite/go-svc/svc); to add:
go get github.com/judwhite/go-svc/[email protected]
../go/pkg/mod/github.com/iamacarpet/[email protected]/services.go:14:2: missing go.sum entry for module providing package golang.org/x/sys/windows/svc/mgr (imported by github.com/iamacarpet/go-win64api); to add:
go get github.com/iamacarpet/[email protected]
go build golang.org/x/sys/windows/registry: no Go files in
go build golang.org/x/sys/windows: no Go files in
go build golang.org/x/sys/windows/svc: no Go files in
go build golang.org/x/sys/windows/svc/mgr: no Go files in
make: *** [Makefile:30: win] Error 1

@Mobmaker55
Copy link
Collaborator Author

I kept trying different stuff (including re-cloning the source), but nothing has worked. I have no idea how to fix this error, do you have any ideas?

@safinsingh
Copy link
Collaborator

Have you installed dependencies with go get -v -d -t ./...?

@sourque
Copy link
Collaborator

sourque commented Mar 8, 2021

If your goal is to just have the code compiled, and you're not looking to change crypto.go at all, we also made a 'new' release which should be up to date.

@Mobmaker55
Copy link
Collaborator Author

Mobmaker55 commented Mar 8, 2021

Have you installed dependencies with go get -v -d -t ./...?

Thank you :) this worked! Sorry, I've never used go before, this is all new to me.
However, I did change crypto.go a little, so I want to compile that in.

Okay, so now, do I just move aeacus.exe and phocus.exe to my C:\aeacus directory? Or do I need to move more stuff?

@safinsingh
Copy link
Collaborator

You'll also need the assets and misc directories from the repository; that's all.

@Mobmaker55
Copy link
Collaborator Author

You'll also need the assets and misc directories from the repository; that's all.

The misc directory is not in your latest release... would I need to download and install the misc directory separately from a release?

I'm trying to make a configuration guide not only for myself, but for my team, so they can understand how to use aeacus. So, I'm sorry if this is a lot of questions-

@safinsingh
Copy link
Collaborator

No problem. The Makefile hasn't been updated to include the misc directory but you should copy it from the cloned repository into /opt/aeacus.

@Mobmaker55
Copy link
Collaborator Author

Sounds good! This answers all of my compilation questions, thank you!

@safinsingh safinsingh pinned this issue Mar 8, 2021
@Mobmaker55 Mobmaker55 reopened this Mar 10, 2021
@Mobmaker55
Copy link
Collaborator Author

Mobmaker55 commented Mar 10, 2021

I feel bad about bothering all of you more, but I'm once again trying with Windows (I am so sorry)...
I ran make win, and got a different error that I've never seen before-

C:(directory stuff)>make win
CGO_ENABLED=0 GOOS=windows garble build -ldflags '-s -w' -tags phocus -o ./phocus.exe . && \
CGO_ENABLED=0 GOOS=windows garble build -ldflags '-s -w' -o ./aeacus.exe . && \
echo "Windows production build successful!"
'CGO_ENABLED' is not recognized as an internal or external command,
operable program or batch file.
make: *** [Makefile:30: win] Error 1

It's probably something stupid and easy to fix, but I have no idea how to fix this...
again, my first time using Go, so I have no idea what I'm doing even remotely haha

Thank you so much for taking the time to respond to all of my questions too, it's really helpful and kind of all of you!

EDIT: I'm just going to save all of you time and go back to compiling on the FAR SUPERIOR Linux. Sorry for spamming your inboxes by opening and closing this issue haha...

@safinsingh
Copy link
Collaborator

No worries! The reason it wasn't working is because there's a different syntax for setting environment variables on cmd; namely set/setx. I would agree, however, that it's much easier to compile on Linux 😄

@Mobmaker55
Copy link
Collaborator Author

No worries! The reason it wasn't working is because there's a different syntax for setting environment variables on cmd; namely set/setx. I would agree, however, that it's much easier to compile on Linux 😄

Right! I didn't realize that's how a Makefile worked-- shows how much I know xD
I'll totally try that on Windows some other time... whenever that is :P

@Mobmaker55 Mobmaker55 added the good first issue Good for newcomers label Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants