Windows (and Plan 9) DNS Config #17

Merged
sam merged 4 commits from windows-DNS into master 2022-06-30 22:37:09 +00:00
Owner

Newer version should compile properly, Plan 9 will be tested more when I have free time

Would close #14, #15

Newer version should compile properly, Plan 9 will be tested more when I have free time Would close #14, #15
Collaborator

You can "cross-compile" by doing this

GOOS=windows GOARCH=amd64 go build

which builds it for Windows

image

HOWEVER

This may be a failure on my end using wrong compile flags but...

this was "resolved" by building it on the windows vm directly and then it actually ran as expected

image

Since Windows docker containers cannot be ran on Linux, most likely anything Windows related will need to be tested on Windows directly either in a vm or some other solution.

You can "cross-compile" by doing this `GOOS=windows GOARCH=amd64 go build` which builds it for Windows ![image](/attachments/6c7fcbf1-61b3-4561-bb76-745f850c47be) HOWEVER This may be a failure on my end using wrong compile flags but... this was "resolved" by building it on the windows vm directly and then it actually ran as expected ![image](/attachments/6c0648b1-e113-48da-899c-a3c07ba1414f) Since Windows docker containers cannot be ran on Linux, most likely anything Windows related will need to be tested on Windows directly either in a vm or some other solution.
Collaborator

On further investigation this seems to be because of specific build constraints in the /x/sys/windows package

image

This means it is refusing to build on Linux which I thought we could mitigate by including our own build constraints.

So I pulled the windows stuff into it's own file and attempted to build the project with the following

//go:build windows && amd64
// +build windows,amd64

so it would only build the file on windows/amd64 however I now get

imports git.froth.zone/sam/awl/port: build constraints exclude all Go files in /home/grumb/programming/awl/port

which explains why I could only build it on the windows vm or with GOOS windows the /x/sys/windows/ package refuses to build unless GOOS=windows.

On further investigation this seems to be because of specific [build constraints](https://pkg.go.dev/go/build#hdr-Build_Constraints) in the /x/sys/windows package ![image](/attachments/76da4f6a-68a2-4aa5-b971-05a563dd653c) This means it is _refusing_ to build on Linux which I thought we could mitigate by including our own build constraints. So I pulled the windows stuff into it's own file and attempted to build the project with the following ``` //go:build windows && amd64 // +build windows,amd64 ``` so it would only build the file on windows/amd64 however I now get ``` imports git.froth.zone/sam/awl/port: build constraints exclude all Go files in /home/grumb/programming/awl/port ``` which explains why I could only build it on the windows vm or with GOOS windows the /x/sys/windows/ package refuses to build unless GOOS=windows.
223 KiB
sam changed title from WIP: Windows DNS Config to WIP: Windows (and Plan 9) DNS Config 2022-06-30 12:00:00 +00:00
sam changed title from WIP: Windows (and Plan 9) DNS Config to Windows (and Plan 9) DNS Config 2022-06-30 12:01:01 +00:00
Author
Owner

There's some preproccessor magic I looked into, I think it works now (at least it did to me, but more samples would be appreciated)

There's some preproccessor magic I looked into, I think it works now (at least it did to me, but more samples would be appreciated)
Collaborator

I built awl and it worked both on the windows vm and when ran with wine, no other issues on my end building or running.

I built awl and it worked both on the windows vm and when ran with wine, no other issues on my end building or running.
sam force-pushed windows-DNS from b6359ed047 to 2e2d5187d1 2022-06-30 22:32:38 +00:00 Compare
Author
Owner

Tests all look good, merging

Tests all look good, merging
sam merged commit 220964fc02 into master 2022-06-30 22:37:09 +00:00
sam referenced this pull request from a commit 2022-06-30 22:37:10 +00:00
sam deleted branch windows-DNS 2022-06-30 22:37:10 +00:00
Sign in to join this conversation.
No description provided.