Jam not noticing changes?

Hi there, I’m currently building Haiku x86_64 via WSL on Windows 10. I know it’s not a supported build environment, but I got it working and it creates actual working images and everything! However, I have run into a weird issue - it seems like once I build packages/images, jam doesn’t detect any changes to source files. Even if I build with jam -a -q it doesn’t rebuild everything (I purposely injected a syntax error and the build succeeded). It seems like I need to nuke the entire objects folder to get it to see source changes. Then it works until I build a complete image, at which point it stops seeing changes again. Is this just possibly WSL weirdness? I’d rather not rebuild everything if I don’t have to.

On haiku everything but jamfile changes itself triggers a rebuild of the specific components iirc, so this behaviour sounds wrong to me

Not exactly, for instance removing a source file in a Jamfile won’t trigger a rebuild of the linked binary.

yeah, I’ve never had a problem with this on Haiku. I was wondering if there’s a build setting or something.

Looks like a bug in WSL or some incorrect interaction with our tools. This should (obviously) work and it works on other platforms.

Could be a filesystem/implementation wsl limitation, maybe the last modification date doesnt gets updated?

I will have to dig into jam dependency tracking if I want this to work. I found that even deleting the .o files for files I changed doesn’t rebuild them. Other change-tracking tools such as git or make seem to work fine under WSL.

I was hoping someone would point out something silly I was doing (aside from trying to cross-compile on WSL :smiley: ).

I wonder if it’s related to xattrs.

So as an experiment, I tried changing my WSL from the “Legacy” style to actual Ubuntu 18.04 installed in WSL, and I think it works now! I suspect the Legacy WSL, though very much “Ubuntu-like”, might not be quite real enough for serious development.

As far as I understand it WSL 1 is mainly an emulation layer turning Linux syscalls into the Windows equivalent, and of course the emulation isn’t perfect. It is a lot of work to make it perfect and it probably could not ever be perfect, so they decided to move to the virtual machine version in WSL 2. I’m sure there is something in the emulation of fstat or some other file system issue in WSL 1 which was messing up Jam, as extrowerk said.

I use WSL1 to build Haiku on Windows and it seems to work fine here, jam always detects what needs to be rebuilt (at least as well as it seems to on Haiku anyway.)

1 Like

Well, I spoke too soon. I have been unable to get a nightly anyboot out of WSL2 Ubuntu for some reason. WSL/Legacy still works.

Also I learned that WSL2 enables Hyper-V mode, which makes VirtualBox run horribly slow. :frowning:

Maybe I need to dig up a separate machine for Haiku.

Proposed solution: uninstall win, install Haiku.