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

Support OpenBSD - Document compilation instructions and code changes to support OpenBSD #2989

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

lfzamora81
Copy link

Added OpenBSD sub-section to the Dependencies section of docs/install.md.

This comment has been minimized.

@abraunegg
Copy link
Owner

@lfzamora81
Thanks for the PR

I wonder if these steps:

image

Can actually be done via the Makefile / Configure script by detecting the OpenBSD .... something to look into and then would simplify things a little further.

@lfzamora81
Copy link
Author

@abraunegg

I am learning OpenBSD port system with eventual goal of porting this natively to OpenBSD similar to the FreeBSD port. And I will likely need to learn Autotools but my knowledge of it at the moment is almost nill--just dangerous enough to cause trouble.

I believe it would start by modifying the configure.ac to detect OpenBSD which then modifies the configure script itself to enact the OS-specific modifications ultimately for the Makefile? Or am I way over-complicating it?

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@abraunegg
Copy link
Owner

@abraunegg

I am learning OpenBSD port system with eventual goal of porting this natively to OpenBSD similar to the FreeBSD port. And I will likely need to learn Autotools but my knowledge of it at the moment is almost nill--just dangerous enough to cause trouble.

I believe it would start by modifying the configure.ac to detect OpenBSD which then modifies the configure script itself to enact the OS-specific modifications ultimately for the Makefile? Or am I way over-complicating it?

I have not forgotten this PR.

I have a number of bugs / issues I need to resolve (2 x issues, 1 undocumented atm) , then I am going to spend some time looking at the relevant files on OpenBSD and try and get this to configure correctly, automatically for OpenBSD / Linux so no massaging of files is required.

@abraunegg abraunegg added this to the v2.5.4 milestone Nov 29, 2024

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@abraunegg abraunegg changed the title OpenBSD-specific install instructions Support OpenBSD - Document compilation instructions and code changes to support OpenBSD Dec 10, 2024
* Use getMaxOpenFiles() to get the maximum number of open files allowed by the system, supporting Linux, OpenBSD and FreeBSD
* Use getMaxInotifyWatches() to get the maximum inotify watches allowed (Linux) or advise kqueue is used for OpenBSD or FreeBSD
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (49)
bashisms
capitalisation
containerised
customisable
customisation
cuz
datasize
equivilant
finalise
finalised
fullstop
gmake
gzipping
initialising
Ioctl
ISPs
kinda
ksh
Kubuntu
libinotify
linotify
logfiles
Lubuntu
malware
maxfiles
meh
optimisations
preinstalled
prioritisation
prioritise
prolly
reparse
resynchronisation
sandboxing
segfault
shitload
Slackware
sourced
Sourcing
spamming
swaping
thingies
Thu
uninitialised
uninstallation
upgradable
utilisation
websites
Xubuntu
To accept these unrecognized words as correct, you could run the following commands

... in a clone of the [email protected]:lfzamora81/onedrive.git repository
on the install-doc-openbsd-dep branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/abraunegg/onedrive/actions/runs/12263516008/attempts/1'

@abraunegg
Copy link
Owner

@lfzamora81

Were you ever able to actually run the client ... or did you just compile it?

To 'run' in monitor mode has required a code change which has been added to this PR, however I am getting very weird application runtime failures - for example:

openbsd$ ./onedrive -m -v    
No user or system config file found, using application defaults
Using 'user' configuration path for application config and state data: /home/alex/.config/onedrive
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.3-23-g6634284
Account Type:         business
Default Drive ID:     b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Default Root ID:      01WIXGO5V6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1022.73 GB (1098151328567 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/alex/OneDrive
OneDrive synchronisation interval (seconds): 300
Maximum allowed open files:                  7030
Maximum allowed inotify user watches:        N/A (uses kqueue)
Initialising filesystem inotify monitoring ...
Monitoring directory: .
Performing initial synchronisation to ensure consistent local state ...
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Starting a sync with Microsoft OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 200
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 3
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 11
Skipping path - The Microsoft OneNote Notebook File '/Notebooks/online_notebook/Untitled Section.one' is not supported by this client
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 11
Skipping path - The Microsoft OneNote Notebook File '/Notebooks/online_notebook/Open Notebook.onetoc2' is not supported by this client
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
GOT HERE - set thisItemName
GOT HERE 2
GOT HERE 4
GOT HERE 6
GOT HERE 8
GOT HERE 9
GOT HERE 10
GOT HERE 12
GOT HERE 13
GOT HERE 14
GOT HERE 15
PROCESSING NEW JSON
Monitored directory removed: ./
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
std.json.JSONException@std/json.d(688): Key not found: id
----------------
??:? pure @safe noreturn std.exception.bailOut!(std.json.JSONException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x1ed1777d43e]
??:? pure @safe inout(std.json.JSONValue)* std.exception.enforce!(std.json.JSONException).enforce!(inout(std.json.JSONValue)*).enforce(inout(std.json.JSONValue)*, lazy const(char)[], immutable(char)[], ulong) [0x1ed178cbb4c]
??:? inout pure ref @safe inout(std.json.JSONValue) std.json.JSONValue.opIndex(return scope immutable(char)[]) [0x1ed178cb601]
??:? void syncEngine.SyncEngine.processDeltaJSONItem(std.json.JSONValue, long, int, long, bool) [0x1ed1780fc32]
??:? void syncEngine.SyncEngine.fetchOneDriveDeltaAPIResponse(immutable(char)[], immutable(char)[], immutable(char)[]) [0x1ed1780d118]
??:? void syncEngine.SyncEngine.syncOneDriveAccountToLocalDisk() [0x1ed1780adb5]
??:? void main.performStandardSyncProcess(immutable(char)[], monitor.Monitor) [0x1ed176c10b1]
??:? _Dmain [0x1ed176beebf]

For X number of items, the code works, then without reason fails .. and it should not be failing like this.

As OpenBSD is potentially your knowledge area - what compile options are you using?

@lfzamora81
Copy link
Author

@abraunegg

No special compile options were used, in fact my main goal was to stick to the stock instructions as much as possible only deviating where absolutely necessary as documented under my submitted notes for OpenBSD. In all other aspects, I followed the build instructions from: https://github.com/abraunegg/onedrive/blob/master/docs/install.md and used the FreeBSD dependency list as a guide.

Was always wondering about the compiler differences and the fact that DMD does not need to be "activate" on OpenBSD as explained in the above instructions. At the time, LDC was still broken in the ports system so could not be tested. Not sure if that may make a difference as well.

My version is/was a bit behind now at v2.5.3-1-gaeb0a0e. I will try a fresh build from scratch soon so I can compare notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants