Re: A problem regarding CacheDir
Bill Deegan <[email protected]> Tue, 20 Dec 2022 08:26:28 -0800
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CFp0fU0hhLuZMWU8YFzGoKVV=QHUkrN_tMhXYOJ6qvHAQ@mail.gmail.com> |
no worries. Glad you found a solution! -Bill On Tue, Dec 20, 2022 at 3:33 AM Steve Hill (Wireless) via Scons-users < [email protected]> wrote: > OK, sorry to reply to my own post but I’ve discovered the root cause to > this problem. Back in the days of Python 2 we had a problem with parallel > builds due to the default behaviour of file handles being inherited. As a > result, we had to monkey patch open to change the default behaviour. This > is still there today, in a dusty corner of our codebase, and it has not > been updated to support the ‘x’ mode so was the cause of this problem. > > > > Apologies for the disruption. > > > > S. > > > > *From:* Scons-users <[email protected]> *On Behalf Of *Steve > Hill (Wireless) via Scons-users > *Sent:* 20 December 2022 08:07 > *To:* SCons users mailing list <[email protected]> > *Cc:* Steve Hill (Wireless) <[email protected]> > *Subject:* [Scons-users] A problem regarding CacheDir > > > > *EXTERNAL EMAIL:* Do not click links or open attachments unless you know > and trust the sender. > > > > Hi all, > > > > I have decided to have a play with using CacheDir with SCons 4.2.0 on > Windows 10 with Python 3.8. The first time that I ran this, it worked (in > so far as the – local, for now – cache directory was created) but any > subsequent runs fail with a “Bad file descriptor” error when it tries to > look up objects in the cache. Digging into the code, the issue seems to be > with this line: > > > > with open(config_file, 'x') as config: > > > > Event though the config file **does** exist, open() does not seem to be > raising a FileExistsError but, when the file is used to write the default > config (json.dump(self.config, config)), you get the “Bad file > descriptor” exception. By putting the following hack before that line, the > cache bursts into life: > > > > if os.path.exists(config_file): > > raise FileExistsError() > > > > I just wanted to check: is CacheDir supported under Windows? > > > > Thanks, > > > > S. > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users